boardSysSwitchSet (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

NX-200, NX-400

Firmware version:

1.00.00


Set the state of a system switch.

The state of the system switch can be queried with the boardSysSwitchGet function.

 

The state is persistent and will be kept over reset.

 

 

Input:

id : DINT;

The id of the system switch to set.

_SSW_CAN_1_TERM

CAN Termination (NX-200 / NX-400)

_SSW_CAN_1_WR

CAN Write enable  (NX-400)

_SSW_CAN_2_TERM

CAN2 Termination  (NX-200)

_SSW_RS485_1_TERM

RS485_1 Termination (NX-200 / NX-400)

_SSW_RS485_2_TERM

RS485_2 Termination (NX-400)

 

state : SINT;

The state of the system switch.

1

On

0

Off

 

Returns: BOOL

1

Successful.

0

Not supported.

-1

The system switch do not exist

-2

Illegal state

 

Declaration:

FUNCTION boardSysSwitchSet : INT;
VAR_INPUT
  id    : DINT;
  state : SINT;
END_VAR;

 


Example:

INCLUDE rtcu.inc
PROGRAM example;
// Enable CAN write support
boardSysSwitchSet(id:=_SSW_CAN_1_WR, state:=1);
BEGIN
  . . .
END;
END_PROGRAM;