A2C-SG2-M12
WWW.LILLIESYSTEMS.COM
33 of 44
13
Setting up Periodic Messages
The strain gauge amplifier can be configured to send periodic CAN messages at a user specified time interval for each message.
The messages that can be sent periodically are:
Current measurements from both channels; Command: 0x0A
Get configurable channel measurements; Command: 0x0B (sub commands 0x00, 0x01, 0x02)
Get system mode (can be used as a heartbeat); Command: 0xC0
A maximum of 4 periodic messages can be setup at the same time – 4 tasks. Each message can be sent with an interval ranging
from 2ms (500 messages per second) up to 65535ms.
The CAN message that controls the periodic messages starts with the command byte (byte 0) which must be 0x52 followed by the
subcommand (byte 1) which represents the message number. The message number is currently limited to a value of 1-4. Byte 2 is
the state of the period message which can be 0x00 for Off or 0x01 for On. Byte 3 is the value of the command (0x0A, 0x0B, 0xC0)
and Byte 4 is the value of the subcommand. The bytes 5 & 6 are the periodic interval. This is sent as an unsigned 16bit integer with a
value between 2 and 65535.
To turn Off a periodic message byte 2 must be set to 0x00.
Note that when a periodic message is turned off, the command,
sub-command and period values will not be updated and the values sent will be ignored.
If the data rate is set to a high value, data might not be ready to send. Please see 9.1.3.
13.1.1
Command: Set Periodic Messages
Command
Sub Command
Data[0]
Data[1]
Data[2]
Data[3]
Data[4]
Data[5]
0x52
MsgNbr
State
Cmd
SubCmd
TimeMSB
TimeLSB
DLC = 0x07 (values above 0x07 are also valid, but Data bytes are not used)
MsgNbr:
Message number currently 1-4
State:
0x01 for ON, 0x00 for OFF
Cmd:
Command number
SubCmd:
Sub-command number
TimeMSB:
MSB of time period [0x00 – 0xFF]
TimeLSB:
LSB of time period [0x02 – 0xFF]
Example 1
Set periodic message number 1 to send heart beat every second
Byte 0
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Byte 6
Byte 7
0x52
0x01(periodic
message 1)
0x01 (turn
on)
0xC0
(command)
N/A
0x03
0xE8
DLC = 0x07
An interval of 1 second is 1000ms = 0x03E8. MSB is sent first, then LSB.
Example 2
Set periodic message number 2 to send RMS values for all channels at a rate of 100 times per second
Byte 0
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Byte 6
Byte 7
0x52
0x02
(periodic
message 2)
0x01 (turn
on)
0x0A
(command)
0x05 (sub
command -
RMS values)
0x00 (interval
MSB)
0x0A(interval
LSB = 10ms)
DLC = 0x07
An interval of 100 times per second is a message every 10ms = 0x000A. MSB is sent first, then LSB.
Example 3
Set periodic message number 3 to Off – stop sending this periodic message
Byte 0
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Byte 6
Byte 7
0x52
0x03
0x00 (off)
0x0C
0x02
0x00
0x0A
DLC = 0x07
If the above is sent, then bytes 3 to 6 will be discarded and not be changed in the sensor. To change these bytes, byte 2 must be set
to 0x01.