Campbell Hausfeld SDM-CAN Manual Do Utilizador

Página de 74
SDM-CAN CAN-Bus Interface User Guide 
Time to execute block mode for a CR5000 in milliseconds with default bus speed 
is approximately = 2.12 + 0.27 * n bytes of data. 
This timing is only for the block mode instruction and any other instructions 
within the scan will reduce the maximum possible scan rate. 
4.2  Datalogger Instruction 
The SDM-CAN is controlled by an instruction called CANBUS. Please check that 
your datalogger’s operating system includes this instruction. You may also require 
an update to your CRBASIC editor to get the full help screens. Contact Campbell 
Scientific if you need advice about upgrading your operating system. 
The CANBUS instruction takes the form: 
CANBUS(CANDATA(),ADDRESS,TIMEQUANTA,TSEG1,TSEG2,ID, 
DATATYPE,STARTBIT,NUMBITS,NUMVALS,MULT,OFFSET) 
 
where: 
CANDATA is a variable or array which either holds data to be transmitted or will 
hold data that is to be read from the CAN-Bus. 
ADDRESS is the SDM address of the SDM-CAN in question. 
TQUANTA, TSEG1 and TSEG2 have the same function as in P118 above
ID is the CAN ID, where the ID is entered as a single decimal equivalent. 
Entering the number as a negative value signifies it is an 11 bit ID, otherwise it is 
a 29-bit ID. 
Due to current system constraints the ID parameter must be entered 
directly into the CanBus instruction. 
NOTE 
DATATYPE is the same as in P118. 
STARTBIT is the same as in P118, except you enter a negative number instead of 
‘indexing’ the number to signify lefthand referencing. 
NUMBITS is the same, and again a negative number is equivalent to indexing the 
value to enable an interrupt. 
NUMVALS, MULT and OFFSET all have the same function
4-2