I have a SNAP PAC R1 controller running a strategy that includes two scaled inputs from a SNAP-AIMA-i module in channel 3 on the rack. In the PAC Control strategy, the inputs are scaled such that 4 mA = 0 and 20 mA = 100.
I need to leave the PAC Control strategy alone, but I would like to read the unscaled mA from the two inputs on this module. I checked the Modbus TCP Protocol Guide and saw that the a SNAP 2-Ch Analog Input in the third channel on a rack uses registers 25 and 26 (first input) and 27 and 28 (second input).
I’'m running a CODESYS program on a Groov EPIC PR1 on the same subnet. I have configured a Modbus TCP Master Device on the EPIC and added the R1 as a Modbus TCP Slave Device. I set up the Modbus channel on the slave device as follows:
- Access Type: Read Input Registers (Function 4)
- READ Register Offset: 0x0019
- READ Register Length: 4
I’m connecting to the R1 and getting values into the WORD variables in CODESYS, but I’m having trouble making sense of the data I’m getting.
First, should these registers contain the raw mA or will the contain the scaled/EU value? If they contain the scaled value, is there a way to get the raw mA?
Second, how can I combine the two words into a single float value?