The Festo_Motion.lib library
22
Inputs and outputs
The following table contains a list of inputs and outputs that the function block xxx_PRM_MULTI has to
parameterise a motor controller.
Input/output Type Description
Execute BOOL Start transfer
0->1: A rising edge starts transfer of a parameter
SizeOfParam USINT Size of the parameter field (array) designated for transfer
AdrOfParam POINTER_TO_BYTE Address of the parameter field (array) designated for
transfer
DATA_REF VAR_IN_OUT FPC data structure
Data structure provided by FB ..._PRM_INIT
Done BOOL Transfer status
= 0: Transfer has not been initiated
= 1: Transfer has been initiated
The result of the read operation is available in the
parameter field array in Value.
ParamNr USINT Number of the parameter currently being transferred
Err BOOL Error
= 0: No error during parameter transfer
= 1: Error during parameter transfer
ErrStr STRING(80) Outputs an error message as a string
RETVAL UINT Current status of the FB instance
When using several instances of the FB, the current internal
status of the relevant FB is output.
Example of a parameter field (array)
MultiParam : ARRAY [1..5] OF FHPP_PRM_DESCRIPTION :=
(PNU:=404, SUBINDEX:=2, ACCESS:= 1, LENGTH:= 4, VALUE:=100),
(PNU:=404, SUBINDEX:=3, ACCESS:= 1, LENGTH:= 4, VALUE:=200),
(PNU:=404, SUBINDEX:=4, ACCESS:= 0, LENGTH:= 4, VALUE:=300),
(PNU:=404, SUBINDEX:=5, ACCESS:= 1, LENGTH:= 4, VALUE:=400),
(PNU:=404, SUBINDEX:=6, ACCESS:= 0, LENGTH:= 4, VALUE:=500);
Composition of the structure FHPP_PRM_DESCRIPTION
TYPE FHPP_PRM_DESCRIPTION :
STRUCT
PNU : UINT ; (* parameter number of the specified parameter *)
SUBINDEX : USINT; (* subindex of the specified parameter *)
ACCESS : USINT; (* 0 = read parameter / 1 = write parameter *)
LENGTH : USINT; (* parameter length in number of bytes *)
(* (always 4 for CMM... controllers, otherwise see
*)
(* FB xxx_PRM_Single input datatype WR) *)
VALUE : DINT ; (* result read out or value written *)
(* with these blocks: *)
(* MTR_DCI_PRM_MULTI, SFC_DC_PRM_MULTI, *)
(* SFC_LAC_PRM_MULTI, SFC_LACI_PRM_MULTI *)
(* the position factor must be taken into
consideration. *)
END_STRUCT
ENT_TYPE