Section 3. Programming CR10X, CR7 and CR23X
Transmit a previously built data frame on to the CAN-Bus (type 25):
When parameter 08 is set to 25, P118 will cause the datalogger to tell the SDM-
CAN to transmit a previously ‘built’ data frame which is stored in the memory
buffer for this packet ID (see data types 7..18 above).
The length of the data frame transmitted is determined by parameter 10. If
number of bits is less than a complete number of full bytes (1-8) then the number
of bytes sent will be rounded up and all unused bits will be set to zero.
The data start bit position will normally be set to one so the data frame starts at the
beginning of the memory buffer. However, you can enter a value greater than one
to allow part of the buffer to be transmitted, which can simplify some binary
masking operations.
The memory buffer is left unchanged after transmission.
Set-up previously built data frame as a Remote Frame Response (type 26):
When parameter 08 is set to 26, P118 will configure the SDM-CAN to use a
previously ‘built’ data frame as remote frame response for packets of the specified
ID. The length and start positions are specified as for data type 25.
Read error counters (type 27):
This will return 4 values, in successive input locations starting at the location set
by parameter 12, which show certain errors the SDM-CAN has recorded. The
errors are written in the following order: transmit, receive, overrun and watchdog
counts. Each is a count from 0 to 255.
The transmit, receive and overrun counters are measures of the errors on the CAN-
Bus network as defined by the CAN standards. If the transmit counter reaches 255
then the CAN device goes into a ‘bus-off’ state, where it effectively disconnects
itself from the network.
If the SDM-CAN switches to the ‘bus-off’ state, any further reads of the error
counters will show the transmit counter fixed at 127. The counters then need to be
reset to enable further use of the SDM-CAN (see data type 28, below). If this
situation occurs on a regular basis, firstly check the datalogger program (P118
parameters). If these are correct, check the structure and design of the network.
The watchdog counter only increments (and is automatically reset) when the
SDM-CAN ‘crashes’ either due to an internal software error or a hardware fault.
Please contact Campbell Scientific for further advice.
Read and reset the error counters (type 28):
This functions in exactly the same way as type 27 except that after reading the
error counters they are reset to zero. This will also re-enable the SDM-CAN
interface to the CAN-Bus if it has automatically entered the ‘bus-off’ state.
When the counters are reset, the CAN controller chip enters a special state and
waits until it sees a period equal to 11 successive bits of inactivity on the CAN-
Bus before it returns to the normal ‘on-line’ state. Therefore this function should
not be called too frequently otherwise data may be lost.
3-9