Supported platforms: CODESYS 2.3, CODESYS 3.5

 

ACL_DeviceToPGN (FB) (C2.3)

DeviceToPGN (FB) (C3.5)

 

Description

The function block’s purpose is to link address claiming device(s) to J1939 PGN.

 

PGN’s source and destination addresses are automatically maintained according to address claiming.

PGN can be linked to own address claiming device and/or system device.

 

For Tx PGN own device means source address and system device destination address. For Rx PGN addresses are reversed.

Tx PGN's cycle time is automatically reset to zero and restored to default cycle depending on address claiming state.

 

Limitations

If application uses J1939 PGN triggers to manually send the Tx PGN, the application needs to check the address claiming states of the linked address claiming devices (e.g. check the function block's outputs).

 

The function block only resets the cycle time automatically. Tx PGN should not be sent when address claiming is not OK. The OK states can be reset on-fly during address changes.

 

Inputs

CODESYS 2.3CODESYS 2.3

Input variable name

Data type

Description

i_Enable

BOOL

Enable operation

i_pAddressClaimServer

POINTER TO ACL_AddressClaimServer

Pointer to ACL server to search from

i_pOwnDevice

POINTER TO ACL_Device

Pointer to ACL own device to use with PGN,

null pointer if not used

i_pSearchConditions

POINTER TO ACL_SearchConditions

Pointer to system device search conditions,

null pointer if not used

i_pJ1939

POINTER TO J1939

Pointer to J1939 instance which PGN is added to

i_pPGN

POINTER TO J1939_PGN

Pointer to PGN data structure

i_RxPGN

BOOL

TRUE = Rx PGN, FALSE = Tx PGN

 

 

CODESYS 3.5CODESYS 3.5

Input variable name

Data type

Description

i_Enable

BOOL

Enable operation

i_pAddressClaimServer

POINTER TO AddressClaimServer

Pointer to ACL server to search from

i_pOwnDevice

POINTER TO Device

Pointer to ACL own device to use with PGN,

null pointer if not used

i_pSearchConditions

POINTER TO SearchConditions

Pointer to system device search conditions,

null pointer if not used

i_pJ1939

POINTER TO EPEC_J1939.J1939

Pointer to J1939 instance which PGN is added to

i_pPGN

POINTER TO EPEC_J1939.J1939_PGN

Pointer to PGN data structure

i_RxPGN

BOOL

TRUE = Rx PGN, FALSE = Tx PGN

 

 

 

Outputs

CODESYS 2.3CODESYS 2.3

Output variable name

Data type

Description

o_State

ACL_DeviceToPGNState

State of the internal sequence

o_OwnDeviceOK

BOOL

Own device's address claiming OK, or not in use

o_SystemDeviceFound

BOOL

System device found from address claiming

o_SystemDeviceOK

BOOL

System device address claiming OK, or not in use

o_Errors

ACL_DeviceToPGNErrors

Active error

 

 

CODESYS 3.5CODESYS 3.5

Output variable name

Data type

Description

o_State

DeviceToPGNState

State of the internal sequence

o_OwnDeviceOK

BOOL

Own device's address claiming OK, or not in use

o_SystemDeviceFound

BOOL

System device found from address claiming

o_SystemDeviceOK

BOOL

System device address claiming OK, or not in use

o_Errors

DeviceToPGNErrors

Active error

 

 

 

Example code

Code and function block instances for J1939 PGNs are generated automatically by MultiTool Creator.

 

See also

 

 

Source file topic1003067.htm

Last updated 13-Jun-2024