Labview modbus code
The datalogger will act as a ModBusSlave device and respond to requests (funtions) from a ModBusMaster Here is a program example: This will set the datalogger up as a ModBusSlave device. ModBusSlave (ComME,-9600,1,ModBusVariable(),Variable())ĭevice Configuration Utility works great for configuring the RF416's and CR1000.Īssuming LabView supports ModBus RTU, you can use the ModBusSlave instruction in the datalogger program file. 'ModBusSlave ( ComPort, BaudRate, ModBusAddr, ModBusVariable, BooleanVariable) The ModBusSlave instruction sets up the datalogger as a ModBus slave device and configures the Modbus settings and com port: The active interface for the RF416 on the CR1000 should be Datalogger Modem Enable and the CS I/O ME Baud Rate should be set to match the BaudRate of the CR1000's CS I/O port which is defined in the ModBusSlave instruction of the CR1000 program file. The active interface for the RF416 on the PC should be RS-232. The RF416's should be in Transparent mode. For example, the RS-232 baud rate of the RF416 needs to match the RS-232 baud rate of the Modbus master (8-N-1). Each device is configured to match the configuration of the device it is attached to. ModBus RTU Master, NI LabView-(RS-232)- (RS-232)-RF416 - RF416-(CSI/O)-Modbus RTU Slave, CR1000Įach device in this application needs to be configured appropriately. I want to make the CR1000 as a Modbus slave and make my pc (running with NI LabView) as a Modbus server without going through LoggerNet btwn LabView and CR1000. 'Default Datalogger Battery Voltage measurement BattV My system is: one AM25T connects to CR1000
#Labview modbus code code#
I wonder is the code correct? Shall I use ComSDC7 or ComRS232 in the ModBusSlave line? Then connected the CR1000 w/ RF416 to the PC (Modbus server) to excute it.
#Labview modbus code manual#
I want to make the CR1000 as a Modbus slave and make my pc (running with NI LabView) as a Modbus server without going through LoggerNet btwn LabView and CR1000.įrom the CR1000's manual and CRBasic's help (Modbus slave example), I compiled and sent the following CRBasic code via LoggerNet (on different pc) to CR1000. I am trying to "just collect" data from a CR1000 to my PC (not sending data or writing data to CR1000).