Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Modbus tcp client example code


JhnRqlm Feb 24, 2025 07:31 PM

Hi everyone,

I have a CR310 that queries data from an Axis camera using Modbus TCP. Could you provide examples of a CRBasic program to achieve this using the ModbusClient() function?

Here is the list of addresses/registers I'm working wirh:

The input registers are read with the function 4.

Water level (float 32 bits) : 0-1

Water level error code (int 16 bits):2 (See code meanings.)

Water level code (int 16 bits) : 3 (See code meanings.)

External water level (float 32 bits):4-5

External water level error code (int 16 bits) : 6 (See code meanings.)

External water level code (int 16 bits) :7 (See code meanings.)

Flow water level (float 32 bits) : 8-9

Flow water level error code (int 16 bits) :10 (See code meanings.)

Surface Velocity Mean (float 32 bits) :11-12

Surface Velocity Max (float 32 bits) :13-14

Wet area (float 32 bits):15-16

Computed water flow (float 32 bits) :17-18

extrapolated percentage (float 32 bits) :19-20

streamflow extrapolated percentage (float 32 bits):21-22

Water flow from rating curve (float 32 bits) : 23-24

Any help or example code would be greatly appreciated. Thanks in advance!

Log in or register to post/reply in the forum.