USERCANOPEN
Platform: |
OEM719, OEM729, OEM7700, OEM7720, PwrPak7, CPT7, CPT7700, SMART7 |
Use this command to enable a CAN port. The USERCANSTATUS log can be used to check the completion or status of the operation. An optional user defined Transaction ID can be provided to help synchronize requests with responses in the USERCANSTATUS log.
This command is primarily intended to be used by Lua applications that need to interact with external devices.
Opening a CAN port requires the port ID. There are up to 2 CAN buses available on OEM7 receivers, CAN1 and CAN2. The speed (i.e. bit rate) must also be specified.
For the CAN hardware to select certain messages on the bus, a set of hardware filters need to be associated with the port.
This command is rejected if the specified CAN port has already been opened. The CAN port can be opened by either a previous USERCANOPEN command or a CANCONFIG command.
Message ID: 2312
Syntax:
USERCANOPEN PortID BitRate ElementNum [HWFilters] [TransactionID]
Abbreviated ASCII Examples:
USERCANOPEN CAN1 250K 3 EXT 11111111 00000000 EXT 12222222 00000000 STD 333 00000000 123456
USERCANOPEN CAN2 100K 0 123457
Field |
Field Type |
ASCII Value |
Binary Value |
Description |
Format |
Binary Bytes |
Binary Offset |
---|---|---|---|---|---|---|---|
1 |
Command header |
– |
– |
USERCANOPEN header This field contains the command name for abbreviated ASCII or the message header for ASCII or Binary. |
– |
H |
0 |
2 |
PortID |
CAN1 |
1 |
The CAN port Identifier. |
Enum |
4 |
H |
CAN2 |
2 |
||||||
3 |
BitRate |
The CAN speed. |
Enum |
4 |
H+4 |
||
4 |
ElementNum |
0 - 16 |
Number of HWFilter Arrays |
Ulong |
4 |
H+8 |
|
5 |
HWFilters |
|
|
An array of class CANHwFilter with the following structure: { Only filters in use need to be provided, so the format for this section (for N elements) is: {eMessageType1 ulAcceptCode1 ulAcceptMask1 ... eMessageTypeN ulAcceptCodeN ulAcceptMaskN} If N = 0, this whole field is omitted. N is the number of elements in the array, which is specified in the ElementNum field. |
HWFilter Array |
12*N |
H+12 |
6 |
TransactionID |
|
|
An optional user provided ID for this transaction. Default = 0. This transaction ID will copied to the USERCANSTATUS log created for this operation. |
Ulong |
4 |
H+12+ |
Binary |
ASCII |
Description |
---|---|---|
0 |
10K |
10 Kbits/sec |
1 |
20K |
20 Kbits/sec |
2 |
50K |
50 Kbits/sec |
3 |
100K |
100 Kbits/sec |
4 |
125K |
125 Kbits/sec |
5 |
250K |
250 Kbits/sec |
6 |
500K |
500 Kbits/sec |
7 |
1M |
1 Mbits/sec |