F_CreateDpv1ReadReqPkg
The F_CreateDpv1ReadReqPkg function generates a DPV1 telegram for a FB_Dpv1Read of one or more parameters of a drive or the controller unit of a Sinamics Profidrive (Profidrive Specification 3.1). As Profidrives use the Motorola format and IPCs the Intel format, the function automatically swaps the byte order in the DPV1 telegram of parameters with data types with more than one byte.
The function returns the actual length of the DPV1 telegram in bytes (max. 240 bytes).
FUNCTION F_CreateDpv1ReadReqPkg : USINT
Inputs
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
Name | Type | Description |
---|---|---|
pDpv1ReqData | ARRAY OF BYTE | Pointer to an array of 240 bytes containing the DPV1 read telegram. This telegram is created by the function. |
iNumOfParams | USINT | Number of parameters to be read (1 to 39). A further limitation is the telegram size of 240 bytes. |
iDriveID | USINT | The ID is 1 for the ControllerUnit, 2 for the drive object A, 3 for the drive object B of a double/triple drive. The drive ID is set in the starter software. 1..16 is possible. |
Inputs/outputs
VAR_IN_OUT
stDpv1Parameter : ARRAY [1..iMAX_DPV1_PARAMS] OF ST_Dpv1ParamAddrEx;(* list of parameters *)
END_VAR
Name | Type | Description |
---|---|---|
stDpv1Parameter | Array of 39 parameters to be added to the DPV1 read telegram. |
Requirements
Development environment |
Target platform |
IO hardware |
PLC libraries to be integrated (category group) |
---|---|---|---|
TwinCAT v3.1.0 |
PC or CX (x86) |
Beckhoff FC310x PCI, CX1500-M310, EL6731 |
Tc2_IoFunctions (IO) |