PLCopen Motion Control LastIdx : This parameter is used to indicate the index of the last table row defined by the read operation. Axis : Here, the address of a variable of type Axis_Ref_BkPlcMc [ } 67] should be transferred. Behaviour of the function block A rising edge at Execute causes the function block to examine the transferred parameters. A number of problems can be detected and reported during this process: If LowIdx is negative, the system responds with Error and ErrorID =dwTcHydErrCdTblEntryCount. If pTable =0, the system responds with Error and ErrorID =dwTcHydErrCdTblEntryCount.
f LowIdx and HighIdx describe a table with fewer than five rows, the system responds with Error and ErrorID =dwTcHydErrCdTblEntryCount. If these checks were performed without problems, the read operation is started. Busy is TRUE for the duration of the operation. This can lead to some further problems, which are indicated by various error codes. Successful reading of the file is indicated with Done . A falling edge at Execute clears all the pending output signals. If Execute is set to FALSE while the operation is still active, the initiated operation continues unaffected. The signals at the end of the operation ( Error , ErrorID, Done ) apply for one cycle.
If a FileName is specified, it must be complete (including the drive letter and the path, if applicable, always including the file type), since it is used by function block without any further modification or amendment. If no FileName is specified, the function block uses the path and the file name, which were specified through the MC_AxUtiStandardInit_BkPlcMc [ } 182] function block. File type TBL is used here, to distinguish from the parameter file with file type DAT. NOTE! The file contents cannot be read or modified with an ASCII editor. 4.4.5.5 MC_AxTableFromAsciFile_BkPlcMc (from V3.0) The function block reads the contents of a table from a text file. VAR_INPUT Execute:
BOOL:=FALSE; pTable: POINTER TO LREAL:=0; LowIdx: INT:=0; HighIdx: INT:=0; FileName: STRING(255):=''; END_VAR VAR_INOUT Axis: Axis_Ref_BkPlcMc; END_VAR VAR_OUTPUT Busy: BOOL; Done: BOOL; Error: BOOL; ErrorID: UDINT; LastIdx: INT:=0; END_VAR Execute : A rising edge at this input starts the read process. pTable : This parameter is used to transfer the address of an ARRAY[nFirstIdx..nLastIdx.1..2]. PLC Library Hydraulics 166 Version: 1.4