F_CreateDpv1WriteReqPkg : USINT
The function "F_CreateDpv1WriteReqPkg" creates a DPV1 telegram for a FB_Dpv1Write of one or multiple parameters of a drive or the controller unit of a Sinamics Profidrive (Profidrive specification 3.1). 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 write request *)
iNumOfParams : USINT; (* 1..39; else: reserved *)
iDriveId : USINT;
END_VAR
pDpv1ReqData: Pointer to an array of 240 bytes, which contains the DPV1 write request telegram. This telegram is being created in this function.
iNumOfParams: Number of parameters to be written (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 *)
stDpv1ValueHeaderEx : ARRAY [1..iMAX_DPV1_PARAMS] OF ST_Dpv1ValueHeaderEx; (* list of values *)
END_VAR
stDpv1Parameter: Array of 39 parameters, which must be added to the DPV1 write request telegram.
stDpv1ValueHeaderEx: Array of 39 parameter values, which must be added to the DPV1 write request telegram.