owiButtonSetLED (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Firmware version:

1.00 / 1.00.00


The iButton reader is supplied with an LED that can easily be used to inform the user if the iButton placed in the reader is valid or not. Example: fast blinking = access, slow blinking = no access. The LED is controlled with the owiButtonEnableLED and owiButtonSetLed functions.

 

The owiButtonSetLED controls the state of the LED placed inside the iButton reader. Before the state can be controlled, owiButtonEnableLED must be set to "on".

 

 

Input:                

state : BOOL

The new state of the LED in the iButton reader.                

 

Returns:

None.

 

Declaration:

FUNCTION owiButtonSetLed;
VAR_INPUT
   state : BOOL;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
VAR
   iButtonID : STRING;
END_VAR;
 
PROGRAM test;
 
   // Enable use of I-Button Led
   owiButtonEnableLED( enable := ON );
BEGIN
   ...
   // Get I-Button ID
   iButtonID := owiButtonGetID();
   // Was a I-Button present?
   IF strLen(str:=iButtonID) = 12 THEN
      // Valid I-Button ID is 12 characters long (000008F5E179)
      // Turn I-Button LED on to show that I-Button ID has been read
      owiButtonSetLED( state := ON );
      ...
      // Turn I-Button LED off
      owiButtonSetLED( state := OFF );
   END_IF;
   ...
END;
 
END_PROGRAM;