1 setting up a network, 2 real-time data display – Campbell Scientific LoggerNet-SDK Software Development Kit User Manual

Page 24

Advertising
background image

Section 4. CsiCoraScript Control

4.3.1 Setting up a Network

Some of the commands that can be used when initially setting up a datalogger
network on the LoggerNet server include:

• add-device – used to add root ports, dataloggers, and telecommunication

devices to the network map.

• set-device-setting – used to change settings of specific devices in the

network map.

• delete-branch – used to remove a device and any children of a device from

the network map.

• list-devices – shows the devices in the network map

The following example shows the basic CoraScript commands used to set up a
CR10X connected directly to the LoggerNet server via RS232:

add-device com-port COM1 as-child “”;
add-device cr10x CR10X as-child “COM1”;

The following example shows basic CoraScript commands used to set up a
CR9000 connected to the LoggerNet server via Ethernet:

add-device tcp-com-port IPPort as-child “”;
set-device-setting IPPort 5 192.168.1.1:6781;
add-device cr9000 CR9000 as-child “IPPort”;

4.3.2 Real-Time Data Display

Some developers want to display data values as quickly as they change in the
datalogger. Each time a datalogger program executes, new values are written
as input locations. Collecting these input locations provides a snapshot of the
most recent values contained in the datalogger. The DataSource control of the
SDK can be used to set up an advisor that will watch the LoggerNet data cache
and display new or existing data values that are collected. CoraScript
commands are used to set up the collect areas of LoggerNet and to enable
scheduled collection of specific datalogger tables to automate the collection
process.

Please note that although the commands below will enable collection of input
locations from a datalogger, using input locations for real-time comparison of
values can be problematic. When input locations are collected, the collection is
merely a snapshot of the current values that exist in each location. If, for
example, the datalogger program has not completely executed, some of the
values collected may be new while other values may have not changed from
the previous program execution. Please keep this information in mind if input
locations are used in real-time data display or calculations. If correlating
values are necessary, a better approach writes values to Final Storage every
program execution and collects those values as quickly as possible.

4-2

Advertising