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.

working with modbus in a CR800Series station


arieu Apr 2, 2012 03:14 PM

Hi, we got a CR800Series weather station, everything installed and proved to work fine.
We want to connect by protocol modbus from the station directly.
the control technitions here, that we are working with, are asking for the adresses for the parameters of the station.
all the issue for me is new and im trying to solve something that sound chinees.

can someone help me find thouse adresses and how to program the logger net or something to work with modbus?

ariel


Sam Apr 5, 2012 03:45 AM

1st, Check out the help related to ModBusSlave() in CRBasic. There's lots of great information in there.

Your technicians are probably asking for which holding registers they should query for the data. When setting up a logger as a Modbus slave, an array needs to be declared to act as your holding registers. The first index of the array will be holding register 40001. Floating point variables (the default variable type in CRBasic) take two ModBus registers. Therefore, the first register corresponding to any array location X is holding register 40000+2X-1. For example, to retrieve array value number 3, you would ask for two registers starting with 40005.

Here's an example:

Public PTemp, batt_volt, I 'measurement variable

Public ModIn(3) 'make array for holding registers

BeginProg

'instruct logger to listen on ComRS232 for Modbus coms
ModBusSlave (ComRS232,9600,1,ModIn(),0)

Scan (1,Sec,0,0)

'make measurements
PanelTemp (PTemp,250)
Battery (Batt_volt)
I = I + 1

'put measurements into holding registers
ModIn(1) = Batt_volt 'registers 40001 & 40002
ModIn(2) = PTemp 'registers 40003 & 40004
ModIn(3) = ModResult 'registers 40005 & 40006

NextScan
EndProg

* Last updated by: Sam on 4/4/2012 @ 9:45 PM *

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