beautypg.com

2 modbus, 1 overview, Figure 106: configuration and wiring of pakbus lan – Campbell Scientific CR800 and CR850 Measurement and Control Systems User Manual

Page 350

background image

Section 8. Operation

350 

 

 

'Object group 30, variation 2 is used to return analog data when the CR800

'is polled. Flag is set to an empty 8 bit number(all zeros), DNPEvent is a

'reserved parameter and is currently always set to zero. Number of events is

'only used for event data.

DNPVariable

(IArray,4,32,2,3,&B00000000,0,10)

DNPVariable

(BArray,2,1,1,0,&B00000000,0,0)

DNPVariable

(BArray,2,2,1,1,&B00000000,0,1)

Scan

(1,Sec,1,0)

'Wind Speed & Direction Sensor measurements WS_ms and WindDir:

PulseCount

(WindSpd,1,1,1,3000,2,0)

IArray(1) = WindSpd * 100

BrHalf

(WindDir,1,mV2500,3,1,1,2500,True,0,_60Hz,355,0)

If WindDir>=360 Then WindDir=0

IArray(2) = WindDir * 100

'Default Datalogger Battery Voltage measurement Batt_Volt:

Battery

(Batt_Volt)

IArray(3) = Batt_Volt * 100

'Wiring Panel Temperature measurement PTemp_C:

PanelTemp

(PTemp_C,_60Hz)

IArray(1) =PTemp_C

PortGet

(Barray(1),5)

'Update DNP arrays and send unsolicited requests to DNP Master address 3

DNPUpdate

(2,3)

NextScan

EndProg

 

8.6.2 Modbus

8.6.2.1 Overview

Modbus is a widely used SCADA communication protocol that facilitates
exchange of information and data between computers / HMI software, instruments
(RTUs) and Modbus-compatible sensors. The CR800 communicates via Modbus
over RS-232, RS-485, and TCP.

Modbus systems consist of a master (PC), RTU / PLC slaves, field instruments
(sensors), and the communications-network hardware. The communications port,
baud rate, data bits, stop bits, and parity are set in the Modbus driver of the master
and / or the slaves. The Modbus standard has two communications modes, RTU
and ASCII. However, CR800s communicate in RTU mode exclusively.

Field instruments can be queried by the CR800. Because Modbus has a set
command structure, programming the CR800 to get data from field instruments is
much simpler than from serial sensors. Because Modbus uses a common bus and
addresses each node, field instruments are effectively multiplexed to a CR800
without additional hardware.

A CR800 goes into sleep mode after 40 seconds of communications inactivity.
Once asleep, two packets are required before the CR800 will respond. The first
packet awakens the CR800; the second packet is received as data. CR800s,
through DevConfig or the Status table (see the appendix Status Table and Settings

(p. 505)

) can be set to keep communications ports open and awake, but at higher

power usage.