extTagRead (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

All

Firmware version:

1.00.00


This function is used to read the value of a tag in a platform extension program or module.

 

 

Input:

path : STRING

The full path to the program or module, as shown in the Platform Extension dialog.

 

tag : STRING

The name of the tag.

 

Output:

text : STRING

The value of the tag.

 

Returns: INT

1

- Success.

0

- Not available.

-1

- Invalid path. Make sure that the path is correct and that the drive is open.

-2

- Invalid program or module.

-3

- The tag is not found.

 

Declaration:

FUNCTION extTagRead : INT;
VAR_INPUT
  path : STRING;
  tag   : STRING;
  text : ACCESS STRING;
END_VAR;

Example:

 

 

INCLUDE rtcu.inc
 
FUNCTION ShowTag;
VAR_INPUT
  path     : STRING;
END_VAR;
VAR
  tag      : STRING;
  text     : STRING;
  i, rc    : INT;
END_VAR;
 
  i := 0;
 
  DebugMsg(message := "Extension:     " + path);
  REPEAT
    // Setup
    i := i + 1;
 
    // Get tag
    rc := extTagEnumerate(path := path, index := i, tag := tag);
    IF rc > 0 THEN
        DebugMsg(message := "Tag:");
        DebugMsg(message := tag);
        rc := extTagRead(path := path, tag := tag, text := text);
        IF rc > 0 THEN
          DebugMsg(message := "Text:");
          DebugMsg(message := text);
        ELSE
          DebugFmt(message := "extReadTag=\1", v1 := rc);
        END_IF;
    ELSE
        DebugFmt(message := "extTagEnumerate=\1", v1 := rc);
    END_IF;
  UNTIL rc < 1
  END_REPEAT;
  DebugMsg(message := "--------------------------------------------------");
 
END_FUNCTION;
 
PROGRAM test;
 
  // Initialize
  fsMediaOpen(media := 1);
 
  // Show all the tags from the extension
  ShowTag(path := "B:\SYSTEM\EXT\SERVER.RPX");
 
 
END_PROGRAM;