SMART PLC 64-bit floating-point number to 32-bit floating-point number (Lreal_To_Real instruction)

Portal PLC supports 64-bit floating-point number Lreal type, and SMART PLC only supports 32-bit floating-point number REAL type. Some instrument communication data may be 64-bit floating-point number type. At this time, if it needs to be collected into smart PLC, type conversion is required of. (The premise is that the 32-bit floating-point number can be stored without overflow). For the splitting and merging of bit, byte and word elements in Portal PLC, please refer to the following article link:

Portal PLC Bit/Word/Byte Bit/Word/Byte Split and Merge , or some alarm interlock control, combined into one word to facilitate touch screen alarm recording, etc. Let’s look at the splitting and merging of various bits, bytes, and words. In the early days, everyone may use AT commands, but now they are rarely used. We Another implementation is given. BIT_TO_WORD, BIT_TO_DWORD need to pay attention to the problem of high and low bytes, and the others are basically the same, so I will not give examples here. .........._Botu’s bit https://rxxw-control.blog.csdn.net/article/details/121727057 First, look at the 32-bit floating-point number and 64-bit floating-point number in number

Guess you like

Origin blog.csdn.net/m0_46143730/article/details/132305346