7 Application Instructions API 50-99 The capture will be performed in the following rule: S+0 S+0 Hi-byte Lo-byte Hi-byte Lo-byte S+1 S+1 Hi-byte Lo-byte Hi-byte Lo-byte S+2 S+2 n = k3 n = k3 D+0 D+0 S+3 S+3 D+1 D+1 S+4 S+4 D+2 D+3 D+2 D+3 S+5 S+6 S+5 S+6 S+7 S+7 K18: Convert data string to floating point value Explanations: The system converts n words (lower 8 bits) of the source data string (decimal point is not included) to floating point value and stores the converted value in the destination device. Points to note: 1. Operand n sets the number of total digits for the converted floating value. Max 8 digits are applicable and the value over n digit will be omitted.
For example, n = K6, data string “123.45678” will be converted to “123.456”. 2. When there are characters other than numbers 1~9 or the decimal point in the source data string, the character before the decimal point will be regarded as 0, and the value after the decimal point will be regarded as the ETX. 3. If the source data string contains no decimal point, the converted value will be displayed by an n -digit floating point value automatically. The conversion will be performed in the following rule: S+0 S+0 Hi-byte Lo-byte Hi-byte Lo-byte S+1 S+1 S+2 S+2 S+3 S+3 32-bit Floating value D+0 D+1 32-bit Floating value D+0 D+1 123.456 123.456 S+4 S+4 S+5 S+6 S+5 S+6 S+7 S+7 K19:
Convert floating point value to data string Explanations: The system converts the floating point value in the source device S to data string with specified length n (decimal point is not included). DVP-PLC APPLICATION MANUAL 7-68 ‘a’ ‘b’ ‘c’ ‘A’ ‘B’ ‘C’ ‘D’ 0x00 ‘a’ ‘b’ ‘c’ 0x00 ‘1’ ‘2’ ‘3’ ‘.’ ‘4’ ‘5’ ‘6’ 0x00