Supported platforms: CODESYS 3.5
Function block is used
to define time triggered CAN message.
|
Input variable name |
Data type |
Default Value |
Description |
i_Enable |
BOOL |
FALSE |
Message is send only if this flag is set TRUE. |
i_Dlc |
BYTE |
0 |
Set true if AI is used in mA mode |
i_Data |
BOOL |
{0,0,0,0,0,0,0,0} |
Flag can be used to disable control of the mode according error state |
Output variable name |
Data type |
Default Value |
Description |
o_UsedCanChannel |
BYTE |
16#FF |
Configured channel (= input for method InitCobid) |
o_InitializedCobId |
COBID |
16#FFFFFFFF |
Configured COBID (= input for method InitCobid) |
o_UsedTimeInterval |
TIME |
T#0MS |
Configured time interval (= input for method InitCobid) |
o_Error |
EPEC_5000TYPES.SysErrorCodes |
FAILURE |
Output status |
Method is used to init channel, COB-ID and time interval for send message
Before sending is started, the i_Enable flag must be set for the function block.
Name |
Data type |
Range |
Default value |
Description |
i_CanChannel |
BYTE |
- |
16#FF |
Used CAN channel |
i_CobId |
DWORD |
- |
0 |
Used COBID. RMT and extended CAN messages can be defined with flags with (OR) EPEC_CANVXD.MASK_29BIT EPEC_CANVXD.MASK_REMOTE |
i_TimeInterval |
TIME |
- |
T#0ms |
Time interval for sending |
Name |
Data type |
Range |
Default value |
Description |
o_Error |
EPEC_5000TYPES.SysErrorCodes |
- |
FAILURE |
Execution status |
Method removes added CobID (method InitCobId) from sending list.
Name |
Data type |
Range |
Default value |
Description |
No inputs |
|
|
|
|
Name |
Data type |
Range |
Default value |
Description |
o_Error |
EPEC_5000TYPES.SysErrorCodes |
- |
FAILURE |
Execution status |
Definitions: |
|
timeTrgSending:CanApiTimeTriggeredMsg; canChannel:EPEC_CANL2.Channel; sendData:ARRAY [0..7] OF BYTE;
|
Init: |
|
canChannel.InitCAN(0,250,0); (* Init channel 0 for 250 kbit/s*) timeTrgSending.InitCobId(0,16#100,T#10MS); (* Init send mesages , 10ms interval *)
|
Code: |
|
timeTrgSending(i_Enable := TRUE, i_Dlc := 8, i_Data := myData); (* Update data and data length *)
|
Source file topic100345.htm
Last updated 21-Feb-2025