2. When the upper computer writes WORD to PLC, the numerical value should first include the time value in a certain time base. After writing into the data storage area of PLC, use WOR_W instruction under word logic to add its value to its time base, and then use MOVE instruction to write the obtained value into a variable of type S5TIME.
This is two types of conversion.
Specific operation, after you divide the results, you need to use TRUNC to transfer floating-point numbers->; Force;
dint->:TIME;
Then through the library function FC40 (library/standard library /IEC function block /FC40)
Time->; S5 # time.
You got it?