siemens s7 db concept

T

Thread Starter

thomas sprinzing

We are setting up a machine and need to fill dbs from a database, mostly with metric values which are basis for axis calculations. the sps requests the set of values (recipe) from a database and then puts them in a db. as everywhere, many paths lead to rome, so some of the single values may contain a NIL value (there's nothing in it, not zero/0). as far as the database mgnt sys is concerned, almost every one of those can handle this. but can the s7 db handle this concept? reson is: we do not want to make such special assumptions like: temperature shall be "value" unless "value" is not zero. if "value" is zero temp. conditioning is bypassed. any suggestions out there? thanx in advance thomas
 
D

D. C. Pittendrigh

Hi All I am not sure that I really understand the question, but if it boils down to "does S7 recognise 0 as a valid number", the answer is YES..... rather. Interestingly enough I suspect that your database may be dealing with ASCII translations of the numbers, in which case 0 is not 0 at all, in fact 30h if my recollections of the ASCII table are correct, and in this case, nothing, which seems to be what is troubling you, is curiously enough not nothing at all, but 20h. Got the idea? Incidentally Rome is in Italy............ Regards Donald Pittendrigh
 
M

Michael Griffin

At 10:37 23/03/01 -0500, thomas sprinzing wrote: <clip> >We are setting up a machine and need to fill dbs from a database, <clip> >so some of the single values may contain a NIL value (there's >nothing in it, not zero/0). <clip> >reson is: we do not want to make such special assumptions like: >temperature shall be "value" unless "value" is not zero. if "value" is >zero temp. conditioning is bypassed. >any suggestions out there? <clip> I don't see an alternative to either reserving an additional word as a valid/invalid flag for each data word, or reserving a special data value in each data word as a "NIL" value. The second method is likely to be the easiest, provided there is at least one data value which can reserved for this purpose. This reserved value should of course be outside of the range of normally expected data. Fairly often, the maximum possible positive or negative value in the data type is most convenient for this. If you are interpreting this "nil" value at a number of different places in your program, it may be convenient to write a function block to retrieve the data values from the data block and apply the "nil" test to them. That is, you would supply an index as an input parameter, and receive both the required value, and a flag which would tell you if this value is valid or 'nil'. This would allow you to centralise this operation, making for a more reliable program. ********************** Michael Griffin London, Ont. Canada [email protected] **********************
 
Top