rfSetPower (Function)

Top  Previous  Next

Architecture:

X32 / NX32L

Device support:

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

Firmware version:

2.20 / 1.51.00

rfSetPower will change the transmission power of the device.

 

As stated in RF Functions, many factors influence the range when communicating over the RF ISM frequency band. The most significant is the power of the transmission signal.

 

The RTCU is able to control the power in 6 levels - from 0 (no transmission) to 5 (full power). The environment has a great impact on the transmission range.

Also be aware that a lower transmission speed as set with rfOpen has a big impact on the transmission range.

 

A high power level may result in a dead zone around the transmitting device where the signal is too powerful for the AGC on the peer node to work reliably.

 

As a special case, a power level of 0 (zero) will disable the transmission completely. This may be used as a central "switch" to conveniently disable transmission.

 

Input:                

power : SINT ( 0 .. 5 ) ( default 5 )

Transmission power where "0" is no transmission, "1" minimum and "5" is maximum.

 

Returns: INT

0


- Ok.

- 1


- RF not open. Use rfOpen to open interface.

- 4


- RF not supported on device.

- 6


- Invalid parameter.

 

 

Declaration:

FUNCTION rfSetPower : INT;
VAR_INPUT
  power  : SINT := 5; // Transmission power, where '0' is no transmission, '1' minimum and '5' is maximum.
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM example;
VAR
  open     : BOOL;
END_VAR;
 
BEGIN
 open := (rfOpen(id := 1) = 0);
rfSetPower(power := 1); // close range transmission.
 ...
rfClose();
END;
END_PROGRAM;