extTagEnumerate (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

All

Firmware version:

1.00.00


This function is used to retrieve the name of the tags in a platform extension program or module.

 

 

Input:

path : STRING

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

 

index : INT

The index of the tag to get. (One based)

 

Output:

tag : STRING

The name 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

- No more tags.

 

Declaration:

FUNCTION extTagEnumerate : INT;
VAR_INPUT
  path : STRING;
  index : INT;
  tag   : 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;