boardSysSwitchGet (Function)

Top  Previous  Next

Architecture:

NX32L

Firmware version:

1.00.00


Query the state of a system switch.

 

A system switch is a software controlled switch, which is an alternative to hardware a jumper. The state of the switch is persistent.

 

The state of the system switch can be changed with the boardSysSwitchSet function.

 

Note: This function is supported on NX-200 and NX-400.

 

Input:

id : DINT;

The id of the system switch to query.

_SSW_CAN_1_TERM

CAN Termination

_SSW_CAN_1_WR

CAN Write enable

_SSW_CAN_2_TERM

CAN2 Termination

_SSW_CAN_2_WR

CAN2 Write enable

_SSW_RS485_1_TERM

RS485_1 Termination

_SSW_RS485_2_TERM

RS485_2 Termination

 

Output:

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

 

Declaration:

FUNCTION boardSysSwitchGet : INT;
VAR_INPUT
   id    : DINT;
   state : ACCESS SINT;
END_VAR;

 


Example:

INCLUDE rtcu.inc
PROGRAM example;
VAR
   state : SINT;
END_VAR;
// Check CAN write support
boardSysSwitchGet(id:=_SSW_CAN_1_WRstate:=state);
IF state = 1 THEN
   DebugMsg(message := "CAN write is supported");
ELSE
   DebugMsg(message := "CAN write is not supported");
END_IF;
BEGIN
   . . .
END;
END_PROGRAM;