Campbell Scientific SDM-CAN Datalogger to CANbus Interface User Manual

Page 34

Advertising
background image

SDM-CAN Datalogger-to-CANbus Interface

except those where the datalogger can be made the master (i.e. where it
requests data from the remote devices when its needs the data).

In other applications one has to cater for the possibility that data might not be
available from the CAN network when the datalogger clock causes the
datalogger to run its program. This can happen even when the CAN data is
being transmitted at the same rate as the datalogger is running, simply because
the two system clocks drift relative to each other. The interrupt facility allows
you to ensure that data can be captured at the highest possible rate, but you still
have to use special programming and/or data analysis techniques to
synchronize the data with other measurements. The main problem is that the
interrupt function might run more time stamps to the faster measurements in
order to allow normal data analysis.

To enable the interrupt facility on the SDM-CAN you need to index (--) the
program on the number-of-bits parameter (10) of the particular P118
instruction that you want to cause the interrupt when data is received. The
following rules apply:

• The interrupt function only applies to data types which read data from

the CAN-Bus.

• You can mark more than one P118 instruction to generate an interrupt,

but you will then need to read data from all the possible data types
which are indexed, as one or more may contain a new value and all
new data must be read before the interrupt is cleared.

• With the CR10X and CR23X dataloggers you should ensure that all of

the P118 instructions which are marked to cause an interrupt are in the
same interrupt subroutine, normally number 98. Other dataloggers do
not currently support the interrupt subroutine mechanism, but can be
used in a similar mode by polling the digital input connected to the
SDM-CAN I/O port, and only actually reading the data when the port
is high.

As well as indexing parameter 10 of the instructions, you also have to enable
the interrupt function by changing an internal software ‘switch’ in the SDM-
CAN. This is done by calling P118 with data type 32, and setting digit ‘c’ to 1
or 2. (See above).

A switch value of 1 causes the interrupt function to operate in the following
way:

a) With no Interrupt pending the I/O port is pulled low with 100Kohms.

b) With an interrupt pending,

i.e. data has been captured,

the SDM-CAN will

first check that no other device is holding the port high and then pulse
high for 50 milliseconds. If the I/O terminal is held at +5V by another
peripheral it will wait until the I/O terminal goes low and has been low for
50 milliseconds before trying to drive it high to +5V again. The I/O line
has a drive impedance of 1Kohms.

This method of driving the I/O line allows multiple SDM-CANs and other CSL
products that support the I/O line to be wired in parallel. One consequence of
the above technique, though, is that there will be a gap of up to 50 milliseconds

26

Advertising