![RoboteQ CANBus Series User'S Reference Manual Download Page 24](http://html1.mh-extra.com/html/roboteq/canbus-series/canbus-series_users-reference-manual_1471291024.webp)
RoboCAN Networking
24
CANBus Networking Manual
V2.0 July 8, 2019
cc is the Query code, eg _V
ch is the channel number. Put 1 for queries that do not normally require a channel number
tt is the scan rate in ms
bb is the buffer location
The scan rate can be up to 255ms. Setting a scan rate of 0 stops the automatic sending
from this node.
Unless otherwise specified, the buffer can store up to 32 values.
The arrival of a new value is checked with the function
IsScannedCANReady(aa)
Where
aa is the location in the scan buffer.
The function returns a Boolean true/false value
The new value is then read with the function
ReadScannedCANValue(aa)
Where
aa is the location in the scan buffer.
The function returns an integer value. If no new value was received since the previous
read, the old value will be read.
The following example shows the use of the Scan functions
‘ Initiate scan of counter every 10ms from node 4 and store to
buffer location 0
ScanCANValue(4, _C, 1, 10, 0)
‘ initiate scan of voltage every 100ms from node 4 and store to
buffer location 1
ScanCANValue(5, _V, 1, 100, 1)
top:
wait(10) ‘ Executer loop every 10 ms
‘ check if scanned volts arrived
if(IsScannedCANReady(1))
‘ read and print volts
Volts = ReadScannedCANValue(1)
print (Volts,”\r”)
end if
‘ No need to check if counter is ready since scan rate = loop cy-
cle
Counter = ReadScannedCANValue(0)
print (Counter,”\r”)
goto top ‘ Loop continuously