Supported platforms: CODESYS 3.5
|
Required:
|
|
Limitations:
|
The following example describes a time triggered CAN message that is triggered with 10 ms interval.
Definitions: |
|
canChannel:EPEC_CANL2.Channel; (*not required with MT code template*) timeTrgSending:EPEC_5050INT.CanApiTimeTriggeredMsg; sendData:ARRAY [0..7] OF BYTE;
|
Init: |
|
(*If using MultiTool Creator, CAN channel init is already included in code template*) canChannel.InitCAN(0,250,0); (* Init channel 0 for 250 kbit/s*)
timeTrgSending.InitCobId(0,16#100,T#10MS); (* Init sending 10ms interval , COB-ID 100h *)
|
Code: |
|
timeTrgSending(i_Enable := TRUE, i_Dlc := 8, i_Data := sendData); (* Enable sending and update data *)
|
Source file topic000991.htm
Last updated 21-Feb-2025