background image

NL120 Ethernet Module 

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.  The socket opened by this instruction 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) 
 
    GetVariables (Result1,Socket,-1,2,0000,50,"Public","BattVolt",BattVolt_Remote,1) 
    SendVariables (Result2,Socket,-1,2,0000,50,"Public","PTemp",PTemp_Base,1) 
 
    CallTable(Test) 
   
  NextScan 
 
EndProg 

 

6.2  HTTP Web Server 

Typing the datalogger’s IP address into a web browser will bring up its home 

page as shown in FIGURE 

6-1

.  This default home page provides links to the 

current record in all tables, including data tables, the Status table and the Public 

table.  Clicking on a Newest Record link will bring up the latest record for that 

table.  It will be automatically refreshed every 10 seconds.  Links are also 

provided to the last 24 records in each data table.  Clicking on a Last 24 

Records link will bring up the last 24 records for that table.  The Last 24 

Содержание NL120

Страница 1: ...INSTRUCTION MANUAL NL120 Ethernet Module Revision 4 15 C o p y r i g h t 2 0 0 6 2 0 1 5 C a m p b e l l S c i e n t i f i c I n c...

Страница 2: ......

Страница 3: ...ucts to CSI CSI will return such Products by surface carrier prepaid within the continental United States of America To all other locations CSI will return such Products best way CIP port of entry per...

Страница 4: ...g container Campbell Scientific s shipping address is CAMPBELL SCIENTIFIC INC RMA _____ 815 West 1800 North Logan Utah 84321 1784 For all returns the customer must fill out a Statement of Product Clea...

Страница 5: ...ore beginning work Wear a hardhat and eye protection and take other appropriate safety precautions while working on or around tripods and towers Do not climb tripods or towers at any time and prohibit...

Страница 6: ......

Страница 7: ...cifications 4 6 TCP IP Functionality 5 6 1 Communicating over TCP IP 6 6 1 1 Data Callback 6 6 1 2 Datalogger to Datalogger Communication 7 6 2 HTTP Web Server 7 6 3 FTP 8 6 3 1 FTP Server 8 6 3 1 1 S...

Страница 8: ......

Страница 9: ...n explains how to quickly begin using an NL120 for straightforward Ethernet communications Section 6 describes in detail the TCP IP functionality of the NL120 2 Cautionary Statements The NL120 is rugg...

Страница 10: ...nd of the Ethernet cable to the 28033 and connect another Ethernet cable to the other end of the 28033 Restore power to the datalogger FIGURE 4 1 NL120 attached to a CR1000 4 2 Communicating via Ether...

Страница 11: ...Step 2 LoggerNet Setup The next step is to run LoggerNet and configure it to connect to the datalogger via the Ethernet port a In LoggerNet s Setup Screen press Add Root and choose IPPort Input the d...

Страница 12: ...h datalogger s peripheral port Typical Current Drain 20 mA Note To save power the IPNetPower instruction can be used to turn off power to the NL120 See the CRBasic help for an example of using the IPN...

Страница 13: ...or 10BaseT networks using CAT5 cable is 100 meters Segment length is the length of cable between the NL device and the Ethernet repeater hub switch or router it is connected to Ethernet Speed 10Base T...

Страница 14: ...to the LoggerNet Server already exists The LoggerNet Server is assumed to be at the default PakBus Address 4094 If not a socket to LoggerNet is opened using the TCPOpen instruction The SendVariables...

Страница 15: ...m 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...

Страница 16: ...elp FileOpen and FileWrite can be used to create HTML pages but this requires first writing the file to the datalogger s USR drive It is less convenient and the page will be only as current as it is w...

Страница 17: ...NL120 Ethernet Module FIGURE 6 2 FTP root directory FIGURE 6 3 FTP USR directory 9...

Страница 18: ...Physical Setup p 2 and 4 2 Communicating via Ethernet p 2 Step 1 only b Open a Windows Explorer window Enter ftp username password nnn nnn nnn nnn where nnn nnn nnn nnn is the IP address of the datalo...

Страница 19: ...TCP socket An example of this instruction is shown below The first parameter in TCPOpen is the IP address to open a socket to means to listen on this port rather than connect The second parameter is t...

Страница 20: ...d the datalogger can be set up as a TCP ModBus Master or Slave device For information on configuring the datalogger as a TCP ModBus Master or Slave see the ModBus section of the datalogger manual 6 8...

Страница 21: ......

Страница 22: ...m br Campbell Scientific Canada Corp CSC 14532 131 Avenue NW Edmonton AB T5L 4X4 CANADA www campbellsci ca dataloggers campbellsci ca Campbell Scientific Centro Caribe S A CSCC 300 N Cementerio Edific...

Отзывы: