ApplyRecipeColumn

PLCopen motion icon

 Function - Apply the values of a column from a recipe file.

Inputs

Input

Data Type

Range

Unit

Default

Description

FILE

STRING

 

 

 

Path name of the recipe file (.CSV or .RCP).

Must be a constant value.

COL

DINT

 

 

 

Index of the column in the recipe (0 (zero) based).

Outputs

Output

Data Type

Range

Unit

Description

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 .CSV or .RCP file.
    • If no path is specified, the file is assumed to be located in the project folder.
    • CSV files are created using Excel or Notepad.
    • RCP files are created using an external recipe editor.
  • 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).

  • 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.

FBD Language Example

FFLD Language Example

  • In the FFLD Language, the operation is executed only if the input rung (EN) is TRUE.
    • The output rung is the result of the function.
    • The function is executed only if ApplyRecipe is TRUE.

IL Language Example

Op1: LD               
'MyFile.rcp'
ApplyRecipeColumn COL
ST                OK

ST Language Example

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