Hello,
I am very new using CR800.
I do need to setup time and date of CR800 every other month (just for to synchronize CR800 to the time of electricity meter)by using RS232 port and Modbus protocol. How can I do it?
Osman
Osman,
In order to set the CR800 clock to values from a ModBus slave you will need to be able to send multiple values (write both holding registers and coils).
The following example program sets the CR800 up as a ModBus slave with address zero and sets up holding registers 40,000 - 40,005 up to hold year, month, day, hours, minutes, and seconds. Coil #1 (address 0) is used as a flag that triggers the CR800 to use the ClockSet instruction.
Public MBRegs(6)
Public MBCoils(8) As Boolean
Public ClockVals(7)
BeginProg
ModBusSlave (COMRS232,9600,0,MBRegs(),MBCoils(),0)
Scan (1,Sec,0,0)
Move (ClockVals(1),6,MBRegs(1),6) 'Move Modbus registers 1 (40,000) - 6 (40,005) into Clock_Value array 1-6
If MBCoils(1) = TRUE Then
ClockSet (ClockVals(1)) 'Set the datalogger's internal clock to the values from the Modbus master
MBCoils(1) = FALSE
EndIf
NextScan
EndProg