Supported platforms: CODESYS 2.3

 

ISOBUS_TC_ConfigurePool (FUN)

Description

Function is used to configure TC object pool elements on-fly.

Configuration should be done when TC client's state is ISOBUS_TC_CLIENT_ST_APP_RE_CONFIG.

 

Following steps are performed:

 

i_LoadDDOPFromLabel can be used to skip object pool loading if matching label is found from TC.

 

Limitations

Function is intended to be used when TC client's state is ISOBUS_TC_CLIENT_ST_APP_RE_CONFIG.

 

Structure labels need to be unique for each variation of object pool structure.

 

Application can only disable elements, not add them.

TC object pool xml file needs to contain every element that application needs.

 

Application needs to check TC client metrics to check how many booms, sections and control channels TC server supports. Application re-configuration needs to adapt to the server limits if needed.

 

 

Inputs

Input variable name

Data type

Range

Description

i_pTcClient

POINTER TO ISOBUSTcClient

≠ 0

TC-client instance to configure

i_StructureLabel

ARRAY [1..7] OF BYTE

0..254 for each byte

Unique identifier for pool configuration

i_LocalizationLabel

ISOBUS_LanguageCmd

See ISOBUS.lib documentation

TC client localization label data is defined with language command data

i_LoadDDOPFromLabel

BOOL

TRUE/FALSE

If TRUE = skip object pool loading when matching label is found from TC

i_pElementsToDisable

POINTER TO WORD

≠ 0

(if i_ElementListCount > 0)

List of element numbers which are not loaded to TC, DET-0 (device) cannot be disabled

i_ElementListCount

WORD

N/A

Count of elements in i_pElementsToDisable list,

0 = enable all

Output

Data type

Description

ISOBUS_ErrorCodes

Returns ISOBUS_ERR_SUCCESS when configuration is success

Errors

Error code

Description

ISOBUS_ERR_NULL_POINTER

Error in function inputs

 

Example code

Following example is from application originally containing

 

Example shows how to disable elements to fullfill ISOBUS standard requirements.

After re-configuration, the object pool will contain 1 boom with 2 sections and 1 BIN element.

 

 

Object pool's structure is not described by this example.

 

Application could also have other variations of object pool configuration than standard minimum requirements and the "full" set.

 

Application also needs to adapt to the lowered section amount. For example, it has to re-adjust section widths and offsets to the DDI variables. It is not covered in this example.

 

 

Global constants:

 

 

G_TC_CONF_MIN: BYTE := 1;

G_TC_CONF_FULL: BYTE := 2;

 

 

Global definitions:

 

 

G_TC_CurrentConfig: BYTE := G_TC_CONF_FULL;

 

(*Array containing objects to disable*)

G_TC_DisabledElementsMin: ARRAY[1..16] OF WORD :=

G_ISOBUS_CAN2_DDI_ID_DET_B2_3,

G_ISOBUS_CAN2_DDI_ID_DET_B1_S3_13,

G_ISOBUS_CAN2_DDI_ID_DET_B1_S4_14,

G_ISOBUS_CAN2_DDI_ID_DET_B1_S5_15,

G_ISOBUS_CAN2_DDI_ID_DET_B1_S6_16,

G_ISOBUS_CAN2_DDI_ID_DET_B1_S7_17,

G_ISOBUS_CAN2_DDI_ID_DET_B1_S8_18,

G_ISOBUS_CAN2_DDI_ID_DET_B2_S1_41,

G_ISOBUS_CAN2_DDI_ID_DET_B2_S2_42,

G_ISOBUS_CAN2_DDI_ID_DET_B2_S3_43,

G_ISOBUS_CAN2_DDI_ID_DET_B2_S4_44,

G_ISOBUS_CAN2_DDI_ID_DET_B2_S5_45,

G_ISOBUS_CAN2_DDI_ID_DET_B2_S6_46,

G_ISOBUS_CAN2_DDI_ID_DET_B2_S7_47,

G_ISOBUS_CAN2_DDI_ID_DET_B2_S8_48,

G_ISOBUS_CAN2_DDI_ID_DET_B2_BIN1_60;

 

 

(*Note that structure label data is application specific*)

(*Example structure label:

- Byte 1-3 version,

- Byte 4 amount of booms,

- Byte 5 amount of sections,

- Byte 6 amount of rate controls*)

G_TC_StructureLabelMin: ARRAY[1..7] OF BYTE := 1,0,0,1,2,1,0;

G_TC_StructureLabelFull: ARRAY[1..7] OF BYTE := 1,0,0,2,16,2,0;

 

G_TC_LocalizationLabel:ISOBUS_LanguageCmd;

 

 

 

Code:

 

IF G_ISOBUS_CAN2_Data.pTcClient^.o_EcuStatus.State = ISOBUS_TC_CLIENT_ST_APP_RE_CONFIG THEN

 

(*Application supports only english

Selected unit system settings could be checked from language command received from VT

Units are not changed in this application*)

G_TC_LocalizationLabel.LanguageCode := 'en';

 

(*Check if full configuration is supported,

For conformance testing, application only has "Minimum" and "Full" configurations,

but application could also have other variations*)

 

IF G_ISOBUS_CAN2_Data.pTcClient^.o_TcStatus.TcMetrics.NbrOfBooms < 2 OR

G_ISOBUS_CAN2_Data.pTcClient^.o_TcStatus.TcMetrics.NbrOfSections < 16 OR

G_ISOBUS_CAN2_Data.pTcClient^.o_TcStatus.TcMetrics.NbrOfCtrlChannels < 2

THEN

G_TC_CurrentConfig := G_TC_CONF_MIN;

ELSE

G_TC_CurrentConfig := G_TC_CONF_FULL;

END_IF

 

(*Set TC configuration*)

CASE G_TC_CurrentConfig OF

 

(*Revert to ISOBUS standard minimum requirements*)

G_TC_CONF_MIN:

 

ISOBUS_TC_ConfigurePool(

i_pTcClient:=G_ISOBUS_CAN2_Data.pTcClient,

i_StructureLabel:=G_TC_StructureLabelMin,

i_LocalizationLabel := G_TC_LocalizationLabel,

i_LoadDDOPFromLabel := TRUE,

i_pElementsToDisable:=ADR(G_TC_DisabledElementsMin),

i_ElementListCount:=16

);

 

(*Default settings*)

G_TC_CONF_FULL:

 

ISOBUS_TC_ConfigurePool(

i_pTcClient:=G_ISOBUS_CAN2_Data.pTcClient,

i_StructureLabel:=G_TC_StructureLabelFull,

i_LocalizationLabel := G_TC_LocalizationLabel,

i_LoadDDOPFromLabel := TRUE,

i_pElementsToDisable:=0,

i_ElementListCount:=0

);

END_CASE

 

END_IF

 

 

Source file topic100563.htm

Last updated 13-Jun-2024