DataGram (Act as PakBus Server)

The DataGram instruction is used to initialize a SerialServer/DataGram/ClosedPakBus PakBus® is a proprietary communication protocol developed by Campbell Scientific to facilitate communications between Campbell Scientific devices. Similar in concept to IP (Internet Protocol), PakBus is a packet-switched network protocol with routing capabilities. A registered trademark of Campbell Scientific, Inc. application in the datalogger when a program is compiled.

Syntax

DataGram ( ComPort, BaudRate, PakBusAddr, DestAppID, SrcAppID )

Remarks

The DataGram instruction enables the datalogger to act as a PakBus serial server, routing non-PakBus messages in a PakBus Network over a specified port using the PakBus Datagram Protocol. The PakBus Datagram Protocol extends PakBus communication for general application use, including sending commands to mixed array dataloggers or ClosedModbus Communication protocol published by Modicon in 1979 for use in programmable logic controllers (PLCs). devices.

A PakBus datagram consists of a PakBus header (which includes an address for the destination PakBus device), a Destination Application Identifier (DestAppID), a Source Application Identifier (SrcAppID), and the body of the message. The PakBus header is used to route the datagram to the specified PakBus device. This device may be running one or more applications that use the datagram protocol. The DestAppID is used to route the datagram to the appropriate application within the PakBus device. The SrcAppID registers the datalogger in the network so that datagrams can be passed back to it using the PakBus Datagram Protocol.

In networks using the DataGram instruction to communicate with a non-PakBus datalogger, extra response time may be needed in the software setup to allow for the time needed to transfer packets.

Parameters

ComPort (Communications Port)

The communications port that will be used by the instruction. Right-click to display a list. Options vary depending on the instruction.

Alphanumeric Description
ComUSB USB port of the datalogger
ComRS232 RS232 port of the datalogger
Com1 Datalogger control terminals 1 (TX) & 2 (RX)
ComRF Integrated RF communication

Type: Constant. For all instructions except SerialOpen, this parameter can also be a variable.

For the DataGram instruction, a variable can be used in the ComPort parameter for use with functions that return a communication port. If communication occurs using ClosedTCP/IP Transmission Control Protocol / Internet Protocol., enter the variable for the socket returned by TCPOpen.

BaudRate (Data Transmit Rate)

The rate, in bps, at which data is transmitted. The options are 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200. Selecting one of these options fixes the baud rate at that rate of communication.

NOTE: This datalogger does not support autobaud mode.

NOTE: If a serial port is opened, it must be closed before changing the port baud rate.

Right-click this parameter to display a list.

Type: Constant. In SerialOpen, BaudRate can be a variable.

PakBusAddr (PakBus Address)

The ClosedPakbus PakBus® is a proprietary communication protocol developed by Campbell Scientific to facilitate communications between Campbell Scientific devices. Similar in concept to IP (Internet Protocol), PakBus is a packet-switched network protocol with routing capabilities. A registered trademark of Campbell Scientific, Inc. address of the device that will be contacted as a result of this instruction. Each PakBus device in the network must have a unique address.

If PakBus encryption is enabled in the datalogger, by default the datalogger will encrypt the communications sent using PakBus communication. To disable encryption for one or more Pakbus addresses, use the EncryptExempt instruction. This is useful if a remote device does not support encryption (such as a CR200 or an AVW200).

Type: Integer between 1 and 4094

NOTE: By default, Campbell Scientific software uses the following PakBus addresses: LoggerNet 4094, VisualWeather 4094, PC400 4093, PC200W 4092, PConnect/PConnectCE 4091, RTDAQ 4090, Device Configuration Utility 4089. 4095 is a broadcast address that can be used in a limited number of instructions.

DestAppID (Destination Device ID)

An application ID number that the user assigns to the destination device. The number can be any value from 0 to 65535.

NOTE: Application IDs 0 through 999 are reserved for common applications (for instance, 502 is reserved for ClosedModbus Communication protocol published by Modicon in 1979 for use in programmable logic controllers (PLCs). protocol). Therefore, a user application ID should be in the range of 1000 to 65535.

Type: Integer

SrcAppID (Source Device ID)

An application ID number that the user assigns to the source device, which will be used to identify the application in the ClosedPakBus PakBus® is a proprietary communication protocol developed by Campbell Scientific to facilitate communications between Campbell Scientific devices. Similar in concept to IP (Internet Protocol), PakBus is a packet-switched network protocol with routing capabilities. A registered trademark of Campbell Scientific, Inc. network. The number can be any value from 0 to 65535.

NOTE: Application IDs 0 through 999 are reserved for common applications (for instance, 502 is reserved for ClosedModbus Communication protocol published by Modicon in 1979 for use in programmable logic controllers (PLCs). protocol). Therefore, a user application ID should be in the range of 1000 to 65535.

Type: Integer