tejonbiker
Hi guys, I have worked with OpenPLC for very small projects in the past, today I am building some slave modbus tcp simulator to test some alarms and signals on a GUI.
 
I am building the slave with OpenPLC Runtime on Debian 11 x64

I defined a the holding registers as follow to transfer water level (real value) in the other PLC:
 
Level_h  %MW0
Level_l   %MW1
 
The GUI received and convert it without problems. 

Now with the OpenPLC enviroment I have a little problem, I know the runtime have holding registers area with defined Real vars (%MD0 – %MD1023, Memory Area: 2048 – 4095), but due to my initial definition of holding registers in the other PLC I need to define the holding registers in the range:
 
Level_h  %QW0     
Level_l   %QW1

I can select Real type for %QW0 but the Runtime shows an error of data type.

The questions is: How I can split Real var into two WORD vars?, (split/read the highers 16 bits later put in a word var, later split/read the lowers 16 bits later put in another Word var).

I have searched in the forums and only appear a response related to cast real to dword (only cast integer part of the real).

Thanks in advance. 
Reply 0 0
Reply