From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I read ModBus counter holding registers in Lookout 5

We are using Lookout v5 with Zetron M1700 and M1716 RTUs. The M1700 is Modbus1 and the M1716 is Modbus2.
We need to be able to count the number of times a digital input is turned on and off over a period of time.
We are using digital input #9 on the M1716 RTU. According to the Zetron literature, the counter holding registers for digital input #9 are 42091-42093 for the value and 42094-42096 for the period.
I tried to calculate the the value stored in the registers by using this formula which was suggested by Zetron in an expression:

(((Modbus2.42093*10000)+Modbus2.42092)*10000)+Modbus2.42091

However, this always returns zero.

I read through your example on reading the BCD registers and doing calculation
s on them but it hasn't helped me with my problem.

Is there some command I need to use or a special type of an object I need to use to read the counter holding registers?

I know we are communicating with Modbus2 properly because I can see when the digital input is on or off.

Any help is greatly appreciated.
0 Kudos
Message 1 of 3
(2,927 Views)


Hi,

Is it possible to share or point us to the Zetron literature explaining this calculation?

If you just read the registers 42091-42093 individually from Modbus2, what do you get?

Alternatively, you can maybe count the digital line directly in Lookout. For this, you would create a Counter object and specify the digital input as the "Count=" input. Not sure if this is a feasible option for you.

Again, if you can share the Zetron documentation, I can take a look at it to see why it may not be working.

Regards,

Khalid

0 Kudos
Message 2 of 3
(2,927 Views)
Thanks for your reply.

When we read the registers individually, they always returned zero.

We did find the answer to our problem by talking to Zetron tech support. The version of firmware on our Zetron controllers is a very early release of the Modbus software. Reading the registers was not fully supported in that version. The jury is still out whether Zetron will upgrade our "buggy" firmware for free or not.

It turns out that I was reading the registers correctly in Lookout.
0 Kudos
Message 3 of 3
(2,927 Views)