07.01.2015 Views

CR200/CR200X Series Dataloggers - Campbell Scientific

CR200/CR200X Series Dataloggers - Campbell Scientific

CR200/CR200X Series Dataloggers - 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 15. Alternate Telecoms Resource Library<br />

Table 20. CRBASIC Ports, Flags, Variables and Modbus Registers<br />

<strong>CR200</strong>(X) Feature<br />

Example CRBASIC<br />

Declaration<br />

Equivalent Example<br />

Modbus Register<br />

Control Port (Port) Public Port(8) 00001 to 00009<br />

Flag Public Flag(17) 00001 to 00018<br />

Boolean Variable Public ArrayB(56) as Boolean 00001 to 00057<br />

Variable Public ArrayV(20)* 40001 to 40041* or<br />

30001 to 30041*<br />

*Because of byte number differences, each <strong>CR200</strong>(X) domain variable translates to two Modbus domain input / holding<br />

registers.<br />

15.1.3.2 CRBASIC Instructions - Modbus<br />

Complete descriptions and options of commands are available in CRBASIC<br />

Editor Help.<br />

ModbusMaster ()<br />

Sets up a <strong>CR200</strong>(X) as a Modbus master to send or retrieve data from a Modbus<br />

slave.<br />

Syntax<br />

ModbusMaster (ResultCode, ComPort, BaudRate,<br />

ModbusAddr, Function, Variable, Start, Length,<br />

Tries, TimeOut)<br />

ModbusSlave ()<br />

Sets up a <strong>CR200</strong>(X) as a Modbus slave device.<br />

Syntax<br />

ModbusSlave (ComPort, BaudRate, ModbusAddr,<br />

DataVariable, BooleanVariable)<br />

15.1.3.3 Addressing (ModbusAddr)<br />

Modbus devices have a unique address in each network. Addresses range from 1<br />

to 247. Address 0 is reserved for universal broadcasts. When using the NL100,<br />

use the same number as the Modbus and PakBus® address.<br />

15.1.3.4 Supported Function Codes (Function)<br />

Modbus protocol has many function codes. <strong>CR200</strong>(X) commands support the<br />

following.<br />

• 01 Read Coil Status<br />

• 02 Read Input Status<br />

• 03 Read Holding Registers<br />

• 04 Read Input Registers<br />

141

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

Saved successfully!

Ooh no, something went wrong!