Supported platforms: CODESYS 2.3, CODESYS 3.5

 

JCD_ParamCheck (FUN)

Description

JCD_ParamCheck function is used to monitor parameters of JCD_Joystick and JCD_Pedal FBs.

If any of the parameters are outside of its range or there is a conflict between parameter values, the error output is activated.

 

i_AIType input is used to define the range of all parameters that have a hardware specific range. According to i_AIType value, the max voltage value of the used analog input is read from global G_AD_Scale array. This voltage value is also the maximum limit for i_MaxVoltage, i_MidVoltage and i_MinVoltage parameters. The minimum limit is always zero for these parameters.

 

The function checks that these voltage parameters are within the allowed range and that values are in consistent order: Maximum >= middle >= minimum. The maximum voltage value must not be equal to minimum (maximum > minimum).

 

The function also checks that the dead band, progression and error tolerance parameters are within range.

While i_Enable is false, the function returns without changing the output status.

 

Limitations

This function is primarily intended for JoystickCalibrationAndDiagnostic library's internal use.

 

Inputs

CODESYS 2.3CODESYS 2.3

Input variable name

Data type

Range

Description

i_Enable

BOOL

FALSE/TRUE

Enables parameter check

i_AIType

BYTE

0..G_ADScaleArrMax

Defines the Analog input type and range

i_MaxValue

UINT

hardware specific

Maximum calibration value of joystick or pedal.  Value is given in voltage with two decimals, e.g. 1000 = 10,00V, range depends on used hardware type.

i_MidValue

UINT

hardware specific

Middle calibration value of joystick or minimum calibration value of pedal.  Value is given in voltage with two decimals, e.g. 1000 = 10,00V, range depends on used hardware type.

i_MinValue

UINT

hardware specific

Minimum calibration value of joystick or pedal.  Value is given in voltage with two decimals, e.g. 1000 = 10,00V, range depends on used hardware type.

i_Deadband

BYTE

0..100%

Defines the dead band of joystick in center position, value given in percentage of max-mid or mid-min range.  

i_Progression_PosDir

SINT

-100..100

Positive direction’s progression curve factor

i_Progression_NegDir

SINT

-100..100

Negative direction’s progression curve factor

i_AIErrorTolerance

INT

-1, 0…250 or

-1, 0…500 depending on calibration type

Defines how many volts AI signal is allowed to be out of calibrated range. Value is given in voltage (250 = 2,50V) or percentage of supply voltage (500 = 50,0%), range depends on selected value type. With value -1, diagnostics is not used.

 

 

CODESYS 3.5CODESYS 3.5

Input variable name

Data type

Range

Description

i_Enable

BOOL

FALSE/TRUE

Enables parameter check

i_AIType

ADData

G_AIType struct

 

Defines the Analog input type and range

i_MaxValue

UINT

hardware specific

Maximum calibration value of joystick or pedal.  Value is given in voltage with two decimals, e.g. 1000 = 10,00V, range depends on used hardware type.

i_MidValue

UINT

hardware specific

Middle calibration value of joystick or minimum calibration value of pedal.  Value is given in voltage with two decimals, e.g. 1000 = 10,00V, range depends on used hardware type.

i_MinValue

UINT

hardware specific

Minimum calibration value of joystick or pedal.  Value is given in voltage with two decimals, e.g. 1000 = 10,00V, range depends on used hardware type.

i_Deadband

BYTE

0..100%

Defines the dead band of joystick in center position, value given in percentage of max-mid or mid-min range.  

i_Progression_PosDir

SINT

-100..100

Positive direction’s progression curve factor

i_Progression_NegDir

SINT

-100..100

Negative direction’s progression curve factor

i_AIErrorTolerance

INT

-1, 0…250 or

-1, 0…500 depending on calibration type

Defines how many volts AI signal is allowed to be out of calibrated range. Value is given in voltage (250 = 2,50V) or percentage of supply voltage (500 = 50,0%), range depends on selected value type. With value -1, diagnostics is not used.

 

 

Return value

Return value

Data type

Range

Description

 

BOOL

FALSE/TRUE

True is there is error in any of the parameters

 

See also

Source file Topic000368.htm

Last updated 21-Feb-2025