ns=2;s=DEPRAG Smart/Local/FileAndDirectoryAccess/Excel/ReadCellsFromRow
The command reads the values of cells of a row with specified start and end column index of the specified Excel worksheet in a specified path.
In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:
VAR
bExcelReadCellsFromRow : BOOL;
OutputDataReadCellsFromRow : ST_StringOutputData;
hrExcelReadCellsFromRow : HRESULT;
fbExcel : FB_Excel;
END_VAR
hrExcelReadCellsFromRow := fbExcel.ReadCellsFromRow(
bExecute := bExcelReadCellsFromRow,
ConnectionHandle := depragSmartConnection.ConnectionHandle,
sFileFullPath := 'C:\Test\TestFile.xlsx',
sWorksheetName := 'Testsheet',
nRowNumber := 1,
nStartColumnNumber := 2,
nEndColumnNumber := 5,
Separator := ',',
OutputData => OutputDataReadCellsFromRow);
IF hrExcelReadCellsFromRow <> S_FALSE THEN
bExcelReadCellsFromRow := FALSE;
END_IF
For examples and explanations regarding the calls of nodes via Siemens TIA Portal please refer to the sub-menu "Siemens TIA Portal" in section "Getting Started".