rfbcSetConfig (Function)

Top  Previous  Next

Architecture:

X32

Device support:

AX9 pro, CX1 pro/pro-c/warp/warp-c, SX1, AX9 turbo, NX-900, LX5

Firmware version:

2.60 / 1.51.00


This function will set the current configuration used when communication with other devices through the RFBC protocol. To fetch the current configuration, use rfbcGetConfig.

Configuration is persistent between rfbcClose and rfbcOpen but not through a device reset.

 

When the interface is first opened, it will have a default configuration based on the serial number of the device until this is changed by the function.

Note: if a parameter is not given, previously set values will be reverted to default.

 

 

Input:

id : DINT (0..16777215, default: 0)

The unique ID used when communicating with other devices.

If the ID is set to zero, the unique ID will be generated based on the serial number of the device.

 

serialNumber : STRING (fixed length of 10)

Serial number used when processing pairing requests. If this is empty, the serial number of the device will be used when auto-generating.

 

pairMode : SINT (0/1, default: 0)

This defines how incoming pairing requests are handled.

'0'

-

Rejects all.

'1''

-

Accepts all.

 

acknowledge : BOOL (default : TRUE)

If true, then a confirmation is sent back when a message addressed to the RTCU is received.

 

 

Returns: INT

0

-

Successful.

-1

-

Interface is not open (see rfbcOpen).

-4

-

RF communication is not available.

-6

-

Error in parameter.

 

Declaration:

FUNCTION rfbcSetConfig : INT;
VAR_INPUT
  id             : DINT   := 0; //    Auto generate from serial number
  serialNumber   : STRING := ""; //   Auto generate from serial number
  pairMode       : SINT   := 0; //    reject requests
  acknowledge    : BOOL   := TRUE; // send acknowledges
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM example;
rfbcOpen();
rfbcSetConfig(pairmode := 1);
BEGIN
 ...
END;
END_PROGRAM;