1 general principles, Programming cr10x, cr7 and cr23x, Dataloggers to use the sdm-can – Campbell Scientific SDM-CAN Datalogger to CANbus Interface User Manual

Page 20: General principles

Advertising
background image

SDM-CAN Datalogger-to-CANbus Interface

3. Programming CR10X, CR7 and CR23X

Dataloggers to use the SDM-CAN

This section describes the programming methods used for the above
dataloggers to configure and use the SDM-CAN Interface. This section also
covers general principles and techniques which are relevant to the other
dataloggers.

3.1 General Principles

The SDM-CAN interface is controlled by instructions that the user enters in the
datalogger program. For the dataloggers covered by this section the Program
Instruction is number P118. Full details of the instruction are given below. This
sub-section has been written to introduce the parameters of Instruction P118
and how they allow you to control the different operations of the SDM-CAN.

The initial function is to configure the SDM-CAN interface when the
datalogger program is compiled. At this stage, the datalogger analyses the P118
parameters used by the program and sends the relevant commands to the SDM-
CAN to configure it to perform appropriate tasks.

The most common configuration task, at compile time, is to set up the SDM-
CAN to instruct it to filter out only the data frames of interest from all data
‘passing on the bus’.

The other configuration task done at this point is to specify the speed at which
the CAN-Bus is to operate. It is important to ensure the parameters which
define the speed are set correctly and all instructions have the same values
entered for these parameters otherwise either no data will be received, or you
risk corrupting data on the bus, if the SDM-CAN is enabled for transmission.

The next common function is to read data back from the SDM-CAN, to
decode it, and to store it in input locations once the program is running. A
single entry of P118 in the program can both configure the SDM-CAN during
program compilation and also cause data to be read back from the SDM-CAN
when that instruction is executed during normal program execution.

Similarly there is also a function which is used to send simple data from the
datalogger input locations onto the CAN-Bus via the SDM-CAN. Again a
single call of P118 can both configure and then transmit the data when the
program is running.

A more complicated version of this function is also possible where multiple
P118 instructions are used to build a transmit data frame within the SDM-
CAN, made up of a series of fixed or variable data values from input locations.
A subsequent P118 is used to instruct the SDM-CAN to transmit the frame
either immediately or in a response to a remote frame request from another
device.

Finally there are some special functions normally achieved by a single a call of
P118. One such function is used to change internal ‘switches’ within the SDM-
CAN which control its mode of operation, e.g. power mode, response to failed
transmissions etc. Similar functions also allow you to read back the settings of
these ‘switches’ into input locations and also to read and/or reset the number of

12

Advertising