ST_DBParameter
TYPE ST_DBParameter :
STRUCT
sParameterName : STRING(59);
cbParameterValue : UDINT;
pParameterValue : UDINT;
eParameterDataType : E_DBColumnTypes;
eParameterType : E_DBParameterTypes;
END_STRUCT
END_TYPE
sParameterName : Contains the name of the parameter.
cbParameterValue : Contains the size of the used variable in bytes.
pParameterValue : Contains the pointer address of the used variable.
eParameterDataType : Gives the data type of the parameter.
pParameterValue : Gives the type of the parameter.
declaration sample
variable declaration
PROGRAM MAIN
VAR
paraList: ARRAY [0..2] OF ST_DBParameter;
p1: DINT := 3;
p2: LREAL;
p3: STRING;
END_VAR
PLC PROGRAM
paraList[0].sParameterName := 'p1';
paraList[0].eParameterDataType := eDBColumn_Integer;
paraList[0].eParameterType := eDBParameter_Input;
paraList[0].cbParameterValue := SIZEOF(p1);
paraList[0].pParameterValue := ADR(p1);
paraList[1].sParameterName := 'p2';
paraList[1].eParameterDataType := eDBColumn_Float;
paraList[1].eParameterType := eDBParameter_Output;
paraList[1].cbParameterValue := SIZEOF(p2);
paraList[1].pParameterValue := ADR(p1);
paraList[2].sParameterName := 'p3';
paraList[2].eParameterDataType := eDBColumn_NText;
paraList[2].eParameterType := eDBParameter_Output;
paraList[2].cbParameterValue := SIZEOF(p3);
paraList[2].pParameterValue := ADR(p3);
Requirements
Development environment | Target system type | PLC libraries to be linked |
---|---|---|
TwinCAT v2.10.0 | PC or CX (x86) | TcDatabase.Lib (from TcDatabaseSrv Version 1.0.13) |
TwinCAT v2.10.0 | CX (ARM) |