Supported platforms: CODESYS 2.3

 

How to use AUX Functions

This guide describes how to use ISOBUS AUX-N Functions (Auxiliary Function Type 2) in implement application.

 

The ISOBUS Auxiliary control is defined in the ISO 11783-6 Annex J.

 

It is recommended to have knowledge on how to build basic ISOBUS VT project before adding AUX-N Functions. See also Using ISOBUS.

 

 

Requirements for AUX-N:

  • SDK 4.1 or later

  • MultiTool 6.9 or newer, or MultiTool Creator

  • Python and code template components from SDK 4.1 or later

  • CODESYS 2.3 common libraries:

    • ISOBUS.lib 1.2.1

    • ISOBUS_VT.lib 1.4.9

    • J1939.lib 1.3.5

    • AddressClaiming.lib 1.1.1

  • VT version 3 or higher is required for AUX-N device support

See also ISOBUS Conformance Guide

 

ISOBUS AUX-N and AUX-O are not compatible with each other.

Only AUX-N compatible devices are supported.

 

AUX Function assignment is always done in the primary terminal (VT1), even if UI is loaded to the secondary terminal.

 

 

General information

Auxiliary control (AUX) allows the operator to control specific functions independent of the VT interface,

as long as the Auxiliary Inputs and Auxiliary Functions maintain the connection between them and the VT.

 

Auxiliary Inputs (keys, switches, dials, knobs, sliders), provided by one or more Working Sets (or the VT),

are active at all times after being assigned to an Auxiliary Function―independent of active visible Data Mask and visible Soft Key Mask of the VT.

These inputs are assigned to Auxiliary Functions (i.e. raise/lower, start/stop, set position) and are also provided by one or more Working Sets (or the VT).

The operator can assign the inputs to the functions using a proprietary auxiliary assignment screen provided by the VT.

Once an Auxiliary Input has been assigned to an Auxiliary Function by the VT, the operator is then able to control the function independent of the active Working Set on the VT.

 

For more information, see ISO 11783-6 Annex J.

 

Epec ISOBUS VT library implements the AUX-N Function handling which:

See also ISOBUS_AUX_FunctionHandler (FB)

 

Preferred assignments will be stored in the ECU's nonvolatile memory and loaded to the VT after the client is connected.

This allows automatic function assignment, for example, when the system is restarted.

 

Application requirements

The AUX Function Handler is automatically added to the code template when AUX-N is selected in use.

 

The following is required by the application to use AUX-N Functions:

 

Example implementation is described below.

 

Adding AUX-N Functions

AUX-N Functions are added to the VT object pool using ISO-Designer.

AUX-Function object is added for each functionality that is implemented by application.

 

  1. Open ISO-Designer project

  2. Check that VT Level 3 (VT version 3) is selected

  3. Add AUX-Function object

  4. Define the AUX Function properties

  5. Design the AUX Function Designator symbol

 

Object pool has a list of AUX Function 2 objects.

For example:

 

AUX Function has following properties:

 

AUX Function designator symbol needs to be defined in ISO-Designer.

For example:

 

The symbol is shown for example in VT AUX assignment screen.

 

It is recommended to use static AUX symbols (no dynamic adjustment or variables).

AUX assignment is always done in primary terminal (VT1), even if UI is loaded to secondary terminal. The code template handlers for e.g. output variables support only updating values to the terminal used for UI.

 

Defining OD variables for preferred assignments

Each AUX Function object has preferred assignment which needs to be saved.

Preferred assignment consists of:

  1. Function object ID (WORD)

  2. Input object ID (WORD)

  3. Model identification (WORD)

  4. Input name (ARRAY [0...7] OF BYTE)

 

For the application logic boolean flag is also saved to OD for each AUX Function.

This is used to know if preferred assignment has been saved.

 

1. Define OD index 2200h, index type SingleVariables, data type WORD.

 

 

2. Define OD index 2201h, index type SingleVariables, data type WORD.

 

 

3. Define OD index 2202h, index type SingleVariables, data type WORD.

 

 

4. Define OD index 2203h, index type SingleVariables, data type BOOL.

 

 

5. Define OD index 2204h...22XXh, index type ArrayOf [0..7], data type BYTE.

 

 

AUX-N code template

The code template for AUX-N is updated in the same way than with ISOBUS VT using Edit > Macros > Import MultiTool and Import ISOBUS.

 

The AUX Function Handler is automatically added to code template and executed.

 

For AUX-N, there is new ISOBUS VT > ISOBUS CANx > IsobusVTAuxiliaryControl Global Variable List generated.

The Global variable list includes:

 

Initializing VT preferred instance and wait delay

Application shall set the VT preferred instance and wait delay. See example in How to set VT preferred instance and move to another VT.

If secondary VT is the preferred instance, the VT client will wait for the primary VT for preferred wait delay (when AUX Functions are in use)

If primary VT is not found, the UI will be loaded to secondary VT but the AUX Functions are not usable in this case

 

In multi-VT environment the wait delay should be long enough to allow both primary and secondary VT to bootup if the secondary VT is the preferred terminal.

 

Initializing address claim server monitoring time

Set 500ms monitoring time delay for address claim server.

This is related to conformance tests performed when AUX Functions are in use.

 

Delay is used to detect if address claim device has disappeared from ISOBUS when new address claim request is sent and previously present device does not respond anymore.

 

ISOBUS_CAN2_IsobusVtInitUserCode:

 

 

(*Set ACL monitoring time to detect if ACL device (e.g. VT) stops responding to ACL requests*)

G_ACL_CAN2_MonitoringTime := T#500ms;

 

Initializing preferred assignments

Application needs to read the saved preferred assignments from OD variables and initialize the structs in the AUX Function configuration array.

 

The following example checks if the preferred assignment has been saved to OD.

If the preferred assignment is saved, then the values are updated to the AUX Function configuration array.

Application also needs to set LoadPreferredAssignment flag to TRUE on those AUX Functions which will be loaded as preferred assignments to VT.

 

Example for two AUX Functions. This needs to be done for each AUX Function.

This code is executed in the next step when the preferred assignment loading is done.

 

ISOBUS_CAN2_IsobusVtUpdateUserCode > auxInitializePreferred:

 

(*AUX-N T0-1 function parameters*)

IF PAR_AUX_T0_1_PreferredSaved THEN

   (*Set load flag TRUE when valid saved assignment exists*)

   G_ISOBUS_CAN2_AUX_Functions[1].LoadPreferredAssignment:=TRUE;

   G_ISOBUS_CAN2_AUX_Functions[1].PreferredAssignment.AUXFunctionObjectID := PAR_AUX_T0_1_FunctionObjectID;

   G_ISOBUS_CAN2_AUX_Functions[1].PreferredAssignment.AUXInputObjectID := PAR_AUX_T0_1_InputObjectID;

   G_ISOBUS_CAN2_AUX_Functions[1].PreferredAssignment.ModelIdentification := PAR_AUX_T0_1_ModelIdentification;

   G_ISOBUS_CAN2_AUX_Functions[1].PreferredAssignment.AUXInputName := PAR_AUX_T0_1_InputName;

END_IF

 

(*AUX-N T0-2 function parameters*)

IF PAR_AUX_T0_2_PreferredSaved THEN

   (*Set load flag TRUE when valid saved assignment exists*)

   G_ISOBUS_CAN2_AUX_Functions[2].LoadPreferredAssignment:=TRUE;

   G_ISOBUS_CAN2_AUX_Functions[2].PreferredAssignment.AUXFunctionObjectID := PAR_AUX_T0_2_FunctionObjectID;

   G_ISOBUS_CAN2_AUX_Functions[2].PreferredAssignment.AUXInputObjectID := PAR_AUX_T0_2_InputObjectID;

   G_ISOBUS_CAN2_AUX_Functions[2].PreferredAssignment.ModelIdentification := PAR_AUX_T0_2_ModelIdentification;

   G_ISOBUS_CAN2_AUX_Functions[2].PreferredAssignment.AUXInputName := PAR_AUX_T0_2_InputName;

END_IF

 

Loading preferred assignments

The preferred assignments needs to be loaded to the VT before manual assignment can be done.

This can be done automatically, for example, after VT client has connected to the server.

Application UI can also implement manual loading of preferred assignments if necessary.

 

The preferred assignment also needs to be loaded again if preferred input is detected after initial loading has been done.

Library provides output o_PreferredInputDetected for re-triggering preferred assignments.

 

If all LoadPreferredAssignment flags are FALSE, then the library will load the preferred assignment list as empty.

 

The following is an example code for automatically triggering preferred assignment loading:

once after VT object pool has been loaded

if preferred input is detected

 

Definitions:

 

preferredInitialized: BOOL;

timeout:TIME := T#10s;

loadonerror:BOOL := FALSE;

(*Load empty preferred assignments if correct AUX Input device is not found on bus*)

loadontimeout:BOOL := TRUE;

 

ISOBUS_CAN2_IsobusVtUpdateUserCode:

 

(*Load preferred AUX Function mappings (automatically when VT is connected)*)

IF G_ISOBUS_CAN2_Data.pVtClient <> DWORD#0 THEN

   IF G_ISOBUS_CAN2_Data.pVtClient^.o_VtStatus.ObjectPoolReady THEN

      IF NOT preferredInitialized OR G_ISOBUS_CAN2_AUX_FunctionHandler.o_PreferredInputDetected THEN

         preferredInitialized:=TRUE;

         auxInitializePreferred(); (*Load preferred assignments from OD*)

         preferredresult := ISOBUS_AUX_LoadPreferred(

            i_pAUXFunctionHandler := ADR(G_ISOBUS_CAN2_AUX_FunctionHandler),

            i_LoadEmptyAssignmentsOnError := loadonerror,

            i_LoadEmptyAssignmentsOnTimeout := loadontimeout,

            i_Timeout := timeout

         );

      END_IF

   ELSE

      preferredInitialized := FALSE;

   END_IF

END_IF

 

Saving preferred assignments

When AUX Function assignment is done, VT will indicate if the assignment should be saved as a preferred assignment.

AUX Function Handler will set the SavePreferredAssignment TRUE when the application needs to save the preferred assignment.

 

The following example is for saving two AUX Functions. Each AUX Function has an individual save flag which is checked.

 

Definitions:

 

saveRequired: BOOL := FALSE;

save_timestamp : TIME;

 

ISOBUS_CAN2_IsobusVtUpdateUserCode > auxSavePreferred:

 

(*AUX-N T0-1 function parameters*)

IF G_ISOBUS_CAN2_AUX_Functions[1].SavePreferredAssignment THEN

   saveRequired := TRUE;

   G_ISOBUS_CAN2_AUX_Functions[1].SavePreferredAssignment:=FALSE; (*reset library flag when data is saved*)

   PAR_AUX_T0_1_FunctionObjectID := G_ISOBUS_CAN2_AUX_Functions[1].PreferredAssignment.AUXFunctionObjectID;

   PAR_AUX_T0_1_InputObjectID := G_ISOBUS_CAN2_AUX_Functions[1].PreferredAssignment.AUXInputObjectID;

   PAR_AUX_T0_1_ModelIdentification := G_ISOBUS_CAN2_AUX_Functions[1].PreferredAssignment.ModelIdentification;

   PAR_AUX_T0_1_InputName := G_ISOBUS_CAN2_AUX_Functions[1].PreferredAssignment.AUXInputName;

   PAR_AUX_T0_1_PreferredSaved := TRUE; (*Set parameter flag TRUE when valid assignment has been saved*)

END_IF

 

(*AUX-N T0-2 function parameters*)

IF G_ISOBUS_CAN2_AUX_Functions[2].SavePreferredAssignment THEN

   saveRequired := TRUE;

   G_ISOBUS_CAN2_AUX_Functions[2].SavePreferredAssignment:=FALSE; (*reset library flag when data is saved*)

   PAR_AUX_T0_2_FunctionObjectID := G_ISOBUS_CAN2_AUX_Functions[2].PreferredAssignment.AUXFunctionObjectID;

   PAR_AUX_T0_2_InputObjectID := G_ISOBUS_CAN2_AUX_Functions[2].PreferredAssignment.AUXInputObjectID;

   PAR_AUX_T0_2_ModelIdentification := G_ISOBUS_CAN2_AUX_Functions[2].PreferredAssignment.ModelIdentification;

   PAR_AUX_T0_2_InputName := G_ISOBUS_CAN2_AUX_Functions[2].PreferredAssignment.AUXInputName;

   PAR_AUX_T0_2_PreferredSaved := TRUE; (*Set parameter flag to TRUE when valid assignment has been saved*)

END_IF

 

The following example executes the save action and triggers the OD saving.

ISOBUS_CAN2_IsobusVtUpdateUserCode:

 

(*Update AUX preferred assignments to OD variables*)

auxSavePreferred();

 

(*Save OD variables to NVRAM*)

IF saveRequired AND (TIME()-save_timestamp) > T#1s THEN

   saveRequired := FALSE;

   SaveODAll();

   save_timestamp := TIME();

END_IF

 

 

Resetting preferred assignments

Application can optionally implement preferred assignment parameter resetting.

 

The following example resets the AUX Function configuration array's preferred assignments to default values.

The save flags are also reset in OD variables.

 

Definitions:

 

defaultAuxAssignment: ISOBUS_AUX_FunctionAssignment; (*variable with struct default settings*)

G_ResetPreferred:BOOL := FALSE;

 

ISOBUS_CAN2_IsobusVtUpdateUserCode > auxResetPreferred:

 

FOR i := 1 TO G_ISOBUS_CAN2_AUX_FunctionCount DO

   G_ISOBUS_CAN2_AUX_Functions[i].LoadPreferredAssignment := FALSE;

   G_ISOBUS_CAN2_AUX_Functions[i].PreferredAssignment := defaultAuxAssignment;

END_FOR

 

(*Invalidate AUX save flags so current OD data is not used*)

PAR_AUX_T0_1_PreferredSaved := FALSE;

PAR_AUX_T0_2_PreferredSaved := FALSE;

 

saveRequired:=TRUE;

 

The following example executes the reset and triggers the OD saving.

ISOBUS_CAN2_IsobusVtUpdateUserCode:

 

(*Reset save flags for AUX functions and preferred assignments of handler data*)

IF G_ResetPreferred THEN

   G_ResetPreferred := FALSE;

   auxResetPreferred();

END_IF

 

(*Save OD variables to NVRAM*)

IF saveRequired AND (TIME()-save_timestamp) > T#1s THEN

   saveRequired := FALSE;

   SaveODAll();

   save_timestamp := TIME();

END_IF

 

 

Using AUX-N Functions

Each of the AUX Functions hasa global variable containing an Enable flag and scaled values / states specific to the function type.

 

The global variable is G_ISOBUS_CAN<X>_AUX_<AUX_Function_Name> where X is the ISOBUS CAN number.

The variable's type is ISOBUS_AUX_FunctionDataType<X> where X is the function type number.

Structs are defined in ISOBUS VT library.

 

Application shall check that AUX Function's Enable flag is TRUE before using the functions.

The enable is FALSE e.g. when AUX Function is not assigned or if AUX Input timeout is detected.

 

ISO 11783-6 Annex J:

The Auxiliary Function design should consider the initial state of an Auxiliary Input when an Auxiliary Assignment Type 2 command is received. The state of the operator control might not be in sync with the state of the function to be controlled. The Auxiliary Function has the responsibility for resolving this conflict in a manner appropriate for the specific Auxiliary Function.

 

EXAMPLE An Auxiliary Function controlling the parking brake is being assigned to an Auxiliary Input. The Auxiliary Function identifies that the Input signal is communicating the disengage state. As the Auxiliary Function did not first detect an Auxiliary Input signal to engage the park brake, it can require interaction with the operator (e.g. via an Alarm Mask or by requiring the operator to cycle the Auxiliary Input to the engage state)

prior to the Auxiliary Function acting on the signal to disengage the park brake.

 

Code:

 

(*Type 0 - 1 OFF/ON*)

IF G_ISOBUS_CAN2_AUX_AuxFunction2_T0_1_29000.Enable THEN

   IF G_ISOBUS_CAN2_AUX_AuxFunction2_T0_1_29000.On THEN

      ; (*Input is in ON state*)

   ELSIF G_ISOBUS_CAN2_AUX_AuxFunction2_T0_1_29000.Off THEN

      ; (*Input is in OFF state*)

   END_IF

ELSE

   ; (*Function is not assigned or timeout was detected*)

END_IF

 

See also

 

 

Source file topic100736.htm

Last updated 13-Jun-2024