VLIDPLCopen motion icon

FunctionClosedA function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. - Get the identifier of an embedded list of variables

Inputs

FILE : STRING    Path name of the .TXT list file - must be a constant value!

Outputs

ID : DINT        ID of the list - to be passed to other blocks

Remarks

Some blocks have arguments that refer to a list of variables. For all these blocks, the "list" argument is materialized by a numerical identifier. This function enables you to get the identifier of a list of variables.

Embedded lists of variables are simple ".TXT" text files with one variable name per line (note that you can only declare global variable).

Lists must contain single variables only. Items of arrays and structures must be specified one by one. The length of the list is not limited by the system.


  • List files are read at compiling time and are embedded into the downloaded application code. This implies that a modification performed in the list file after downloading will not be taken into account by the application.

ST Language

ID := VLID ('MyFile.txt');

FBD Language

FFLD Language

(* The function is executed only if EN is TRUE *)

IL Language

Op1: LDClosed"Ladder diagram" Ladder logic is a method of drawing electrical logic schematics. It is now a very popular graphical language for programming Programmable Logic Controllers (PLCs). It was originally invented to describe logic made from relays. The name is based on the observation that programs in this language resemble ladders, with two vertical "rails" and a series of horizontal "rungs" between them   'MyFile.txt'
VLID COL
ST   ID