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.

CR800 Modbus help


SEMN Mar 1, 2013 07:28 PM

I have a CR800 deployed and would like to connect a 2150 area velocity sensor. Does anyone have programming using the Modbus protocol that I could use as a starting point?

I do not see the Modbus instruction in shortcut?

Thanks


Sam Mar 2, 2013 02:04 AM

Below is a program that Jacob Davis wrote that might be of help. You will need to contact CSI for a new OS though. One of the Modbus features (Modbus ASCII support) will not be officially released until OS 26

'CR800/1000 Series Datalogger
'Program to read ISCO2150 flow meter using Modbus ASCII support in ModbusMaster instruction
'date: Jan 11, 2013
'program author: Jacob

'Constants
Const ISCO2150port = Com1

'Declare Public Variables
Public ModuleName As String * 48
Public ReadingsActive As Long
Public Level,' LevelStatus As Long, LevelTime As String * 32
Public Velocity,' VelocityStatus As Long, VelocityTime As String * 32
Public Flow,' FlowStatus As Long, FlowTime As String * 32
Public Voltage,' VoltageStatus As Long, VoltageTime As String * 32
Public PTemp, LoggerBatt
Public ModbusResult As Long
Public ReadModuleName As Boolean 'Set to true to read name of ISCO module
Dim ISCOregister(138) As Long
Dim i As Long
Dim ModbusSource As Long = 1

'Define Data Tables
DataTable (Test,1,1000)
DataInterval (0,600,Sec,10)
Minimum (1,LoggerBatt,FP2,0,False)
Sample (1,PTemp,FP2)
EndTable


'Main Program
BeginProg
ReadModuleName = true
Scan (1,Sec,0,0)
PanelTemp (PTemp,250)
Battery (LoggerBatt)
'Enter other measurement instructions

CallTable Test
NextScan

SlowSequence
Scan (60,Sec,3,0)
'ISCO2150 measurement sequence
'Timing of Modbus retries is key for getting the sensor to switch to Modbus comms. Timeout must be between 300ms and 600ms

If ReadModuleName Then
ModBusMaster (ModbusResult,ISCO2150port,38400,2,3,ISCOregister(5),-5,12,20,40,12)
ModuleName = ""
MoveBytes (ModuleName,0,ISCOregister(5),0,38)
ReadModuleName = false
EndIf

'Set the flag to take a set of readings on demand
ModBusMaster (ModbusResult,ISCO2150port,38400,2,6,ModbusSource,25,1,20,40,10)

Delay (1,51,Sec) 'sensor takes up to 50 seconds for the measurement sequence
'Read take reading flag
ModBusMaster (ModbusResult,ISCO2150port,38400,2,3,ISCOregister(25),25,1,20,40,11)

'Check what readings are active
ModBusMaster (ModbusResult,ISCO2150port,38400,2,3,ReadingsActive,27,1,20,40,10)

'Level
ModBusMaster (ModbusResult,ISCO2150port,38400,2,3,Level,40,1,20,400,12)
'Velocity
ModBusMaster (ModbusResult,ISCO2150port,38400,2,3,Velocity,55,1,20,400,12)
'Flow
ModBusMaster (ModbusResult,ISCO2150port,38400,2,3,Flow,70,1,20,400,12)
'Voltage
ModBusMaster (ModbusResult,ISCO2150port,38400,2,3,Voltage,130,1,20,400,12)

NextScan

EndProg


SEMN Mar 7, 2013 03:08 PM

Thanks for the help. I want to clarify a couple of things.

Can I even get OS 26 at this time?

On the CR800, where do I wire in the transmit and receive wires?

Also, I want to hook up several(3) 2150's off of one CR800. Can I gang up wires into the same port much like SDI-12 instruments?

Thanks again,
Dave


Sam Mar 10, 2013 06:01 AM

You should be able to get an OS per-release candadite from your local CSI office upon request.

In the example provided, the transmit and receive wires go to Com1. Com1 is also labeled C1 and C2 and Tx and Rx.

To connect multiple devices, modify the program to use different com ports for each device or adapt for use with an RS485 peripheral like the MD485.

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