ApplyRecipeColumnPLCopen 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. - Apply the values of a column from a recipe file

Inputs

FILE : STRING    Path name of the recipe file (.RCP or .CSV) - must be a constant value!
COL : DINT      
Index of the column in the recipe (0 based)

 

Outputs

OK : BOOL        TRUE if OK - FALSE if parameters are invalid

Remarks

  • The 'FILE' input is a constant string expression specifying the path name of a valid .RCP or .CSV file. If no path is specified, the file is assumed to be located in the project folder. RCP files are created using an external recipe editor. CSV files can be created using EXCEL or NOTEPAD.
  • In CSV files, the first line must contain column headers, and is ignored during compiling. There is one variable per line. The first column contains the symbol of the variable. Other columns are values.
  • If a cell is empty, it is assumed to be the same value as the previous (left side) cell. If it is the first cell of a row, it is assumed to be null (0 or FALSE or empty string).
  • In FFLD language, the operation is executed only if the input rung (EN) is TRUE. The output rung is the result of the function.

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

ST Language

OK := ApplyRecipeColumn ('MyFile.rcp', COL);

FBD Language

FFLD Language

(* The function is executed only if ApplyRecipe 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.rcp'
ApplyRecipeColumn COL
STClosed"Structured text" A high-level language that is block structured and syntactically resembles Pascal                OK