04.01.2015 Views

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Section 8. Operation<br />

'Object group 30, variation 2 is used to return analog data when the <strong>CR1000</strong><br />

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

'reserved parameter and is currently always set to zero. Number of events is<br />

'only used for event data.<br />

DNPVariable(IArray,4,32,2,3,&B00000000,0,10)<br />

DNPVariable(BArray,2,1,1,0,&B00000000,0,0)<br />

DNPVariable(BArray,2,2,1,1,&B00000000,0,1)<br />

Scan(1,Sec,1,0)<br />

'Wind Speed & Direction Sensor measurements WS_ms and WindDir:<br />

PulseCount(WindSpd,1,1,1,3000,2,0)<br />

IArray(1) = WindSpd * 100<br />

BrHalf(WindDir,1,mV2500,3,1,1,2500,True,0,_60Hz,355,0)<br />

If WindDir>=360 Then WindDir=0<br />

IArray(2) = WindDir * 100<br />

'Default Datalogger Battery Voltage measurement Batt_Volt:<br />

Battery(Batt_Volt)<br />

IArray(3) = Batt_Volt * 100<br />

'Wiring Panel Temperature measurement PTemp_C:<br />

PanelTemp(PTemp_C,_60Hz)<br />

IArray(1) =PTemp_C<br />

PortGet(Barray(1),5)<br />

'Update DNP arrays and send unsolicited requests to DNP Master address 3<br />

DNPUpdate(2,3)<br />

NextScan<br />

EndProg<br />

8.6.2 Modbus<br />

8.6.2.1 Overview<br />

Modbus is a widely used SCADA communication protocol that facilitates<br />

exchange of information and data between computers / HMI software, instruments<br />

(RTUs) and Modbus-compatible sensors. The <strong>CR1000</strong> communicates via Modbus<br />

over RS-232, RS-485, and TCP.<br />

Modbus systems consist of a master (PC), RTU / PLC slaves, field instruments<br />

(sensors), and the communications-network hardware. The communications port,<br />

baud rate, data bits, stop bits, and parity are set in the Modbus driver of the master<br />

and / or the slaves. The Modbus standard has two communications modes, RTU<br />

and ASCII. However, <strong>CR1000</strong>s communicate in RTU mode exclusively.<br />

Field instruments can be queried by the <strong>CR1000</strong>. Because Modbus has a set<br />

command structure, programming the <strong>CR1000</strong> to get data from field instruments<br />

is much simpler than from serial sensors. Because Modbus uses a common bus<br />

and addresses each node, field instruments are effectively multiplexed to a<br />

<strong>CR1000</strong> without additional hardware.<br />

A <strong>CR1000</strong> goes into sleep mode after 40 seconds of communications inactivity.<br />

Once asleep, two packets are required before the <strong>CR1000</strong> will respond. The first<br />

packet awakens the <strong>CR1000</strong>; the second packet is received as data. <strong>CR1000</strong>s,<br />

through DevConfig or the Status table (see the appendix Status Table and Settings<br />

(p. 527) ) can be set to keep communications ports open and awake, but at higher<br />

power usage.<br />

367

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!