F_CreateDpv1ReadReqPkgPNET : USINT
The function "F_CreateDpv1ReadReqPkgPNET" creates a DPV1 telegram for a FB_Dpv1Read of one or multiple parameters of a drive or the controller unit of a Sinamics Profidrive (Profidrive specification 3.1) via Profinet. Since the profidrive uses the Motorola format and the IPC uses the Intel format, the function automatically swaps the bytes in the DPV1 telegram of parameters with data types bigger than one byte.
The function returns the current length of the DPV1 telegram in bytes (max. 240 bytes).
VAR_INPUT
VAR_INPUT
pDpv1ReqData : POINTER TO ARRAY [1..iMAX_DPV1_SIZE] OF BYTE; (* DPV1 read request *)
iNumOfParams : USINT; (* 1..39; else: reserved *)
iDriveId : USINT;
END_VAR
pDpv1ReqData: Pointer to an array of 240 bytes, which contains the DPV1 read request telegram. This telegram is being created in this function.
iNumOfParams: Number of parameters to be read (1 to 39). Another limitation is the telegram size to 240 bytes.
iDriveID: The drive ID is 1 for the Controller Unit, 2 for the A drive, 3 for the B drive of double/triple drive. Drive ID is set in the Starter software. 1..16 is possible.
VAR_IN_OUT
VAR_IN_OUT
stDpv1Parameter : ARRAY [1..iMAX_DPV1_PARAMS] OF ST_Dpv1ParamAddrEx; (* list of parameters *)
END_VAR
stDpv1Parameter: Array of 39 parameters, which have to be added to the DPV1 read request telegram.
Requirements
Development environment | Target platform | IO hardware | PLC libraries to include |
---|---|---|---|
TwinCAT v2.11.0, Build > 1553 TwinCAT v2.11.0 R2, Build > 2024 | PC (i386)
| Beckhoff EL6632 | TcIoFunctions.Lib ( Standard.Lib; TcBase.Lib; TcSystem.Lib; TcUtilities.Lib linked automatically ) |