7 Application Instructions API 50-99 Points to note: 1. Operand n sets the number of total digits for the floating point value to be converted. Max 8 digits are applicable and the value over n digit will be omitted. For example, n = K6, floating value F123.45678 will be converted to data string “123.456”. 2. When the digits of source value are more than the specified n digits, only the n digits from the left will be converted. For example, source value F123456.78 with n =K4 will be converted as data string "1234”. 3. If the source value is a decimal value without integers, e.g. 0.1234, the converted data string will be “.1234” where the first digit is the decimal point.
The conversion will be performed in the following rule: Hi-byte Lo-byte Hi-byte Lo-byte D+0 D+1 D+0 D+1 D+2 D+2 32-bit Floating value S+0 S+1 32-bit Floating value S+0 S+1 123.45678 123.45678 n = k6 n = k6 D+3 D+3 D+4 D+4 D+5 D+5 D+6 D+7 D+6 D+7 Program Example 1: K2, K4 1. When M0 = ON, transform 16-bit data in D0, D1 into ASCII data in the following order: H byte - L byte - H byte - Low byte, and store the results in D10 ~ D17. M0 DTM DTM 2. Value of source devices D0, D1: 3. When the 1 st DTM instruction executes (m=K2), ELC transforms the 16-bit data (Hi-byte, Lo-byte) into 8-bit data and move to registers D2~D5. 4.
When the 2 nd DTM instruction executes (m=K4), ELC transforms the 8-bit HEX data into ASCII data and move to registers D10~D17. DVP-PLC APPLICATION MANUAL 7-69 ‘1’ ‘2’ ‘3’ ‘.’ ‘4’ ‘5’ ‘6’ 0x00 D0 D2 K2 K2 D2 D10 K4 K4 Register D0 D1 Value H1234 H5678 Register D2 D3 D4 D5 Value H12 H34 H56 H78 Register D10 D11 D12 D13 D14 D15 D16 D17 Value H0031 H0032 H0033 H0034 H0035 H0036 H0037 H0038