
186 Siemens Simatic S7 Driver Online Help
Read
Algorithm
Reads from an S5 Time register.
Bits 11 to 0 of the Raw_value are
then separated into three nibbles (4
bits) prior to converting the value to
BCD. Each nibble is examined for a
value greater than 9 (A-F hex). If a
hexadecimal value between A and F
is found, a range alarm is generated,
indicating the value is not within
BCD range. Otherwise, the BCD
value is converted to seconds using
the following algorithm:
Result = (BCD_value *
Time_Resolution)
Read
Algorithm
Variables
Raw_value – the value stored in the
field device’s register.
Time_Resolution – the value stored
in bits 13 and 12 of the register
converted as follows:
00 – yields a resolution of 0.01
01 – yields a resolution of 0.1
10 – yields a resolution of 1
11 – yields a resolution of 10
BCD_Value – bit 11 to 0 of the
Raw_value converted into a
3BCD value.
Result – the scaled value stored in
the database block.
Kommentare zu diesen Handbüchern