Campbell Scientific NL121 NL121 Ethernet Module - Page 18

Datalogger-to-Datalogger Communication

Page 18 highlights

NL121 Ethernet Module BeginProg Scan (5,Sec,6,0) PanelTemp (PanelTemperature,250) Battery (BatteryVoltage) If not Route(4094) then Socket = TCPOpen ("192.168.7.231",6785,0) SendVariables (Result1,Socket,-1,4094,0000,100,"Public","Callback",dummy1,1) CallTable CLBK1 NextScan EndProg 6.1.2 Datalogger-to-Datalogger Communication Communication between dataloggers is possible over TCP/IP. In order to do this, a socket must be opened between the two dataloggers. This is done using the TCPOpen() instruction or using the PakBus/TPC Client setting. Note that only one datalogger should be set up to open the connection. The socket opened by the TCPOpen() instruction or the PakBus/TPC Client setting is then used by the instructions performing datalogger-to-datalogger communication. The example program below gets the battery voltage from a remote datalogger and sends its panel temperature to the remote datalogger. The remote datalogger is at IP address 192.168.7.125 and port 6785 is used for communication between the dataloggers. The remote datalogger must have its battery voltage stored in a public variable, BattVolt. It must also have a Public variable declared, PTemp_Base. This will be used to store the panel temperature of the base datalogger. PROGRAM 'CR1000 'DL-to-Dl_Comms_1.cr1 'Send this program to CR1000 #1 'Remote CR1000 #2 has PBA = 2, IP addr = 192.168.7.125, and port 6785 Public BattVolt,, BattVolt_Remote Public PTemp Public Result1, Result2 Dim Socket as LONG DataTable (Test,1,-1) DataInterval (0,12,Sec,10) Minimum (1,BattVolt,FP2,0,False) EndTable BeginProg Scan(2,Sec,0,0) Socket = TCPOpen("192.168.7.125",6785,0) BatteryVoltage(BattVolt) PanelTemp(PTemp,250) 10

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26

NL121 Ethernet Module
BeginProg
Scan (5,Sec,6,0)
PanelTemp (PanelTemperature,250)
Battery (BatteryVoltage)
If not Route(4094) then Socket = TCPOpen ("192.168.7.231",6785,0)
SendVariables (Result1,Socket,-1,4094,0000,100,"Public","Callback",dummy1,1)
CallTable CLBK1
NextScan
EndProg
6.1.2 Datalogger-to-Datalogger Communication
Communication between dataloggers is possible over TCP/IP.
In order to do
this, a socket must be opened between the two dataloggers.
This is done using
the
TCPOpen()
instruction or using the
PakBus/TPC Client
setting.
Note
that only one datalogger should be set up to open the connection. The socket
opened by the
TCPOpen()
instruction or the
PakBus/TPC Client
setting is
then used by the instructions performing datalogger-to-datalogger
communication.
The example program below gets the battery voltage from a remote datalogger
and sends its panel temperature to the remote datalogger.
The remote
datalogger is at IP address 192.168.7.125 and port 6785 is used for
communication between the dataloggers.
The remote datalogger must have its
battery voltage stored in a public variable,
BattVolt
.
It must also have a Public
variable declared,
PTemp_Base
.
This will be used to store the panel
temperature of the base datalogger.
PROGRAM
'CR1000
'DL-to-Dl_Comms_1.cr1
'Send this program to CR1000 #1
'Remote CR1000 #2 has PBA = 2, IP addr = 192.168.7.125, and port 6785
Public BattVolt,, BattVolt_Remote
Public PTemp
Public Result1, Result2
Dim Socket as LONG
DataTable (Test,1,-1)
DataInterval (0,12,Sec,10)
Minimum (1,BattVolt,FP2,0,False)
EndTable
BeginProg
Scan(2,Sec,0,0)
Socket = TCPOpen(“192.168.7.125”,6785,0)
BatteryVoltage(BattVolt)
PanelTemp(PTemp,250)
10