Writing additional drive process values to the device
In the following example, safety status word 1 is added to the drive safety card as PI 16 and the data is read:
VAR
// Initialisation of the parameter array for PI data source
_astParam : ARRAY[1..1] OF ST_ParamArray :=
//PI data - Data sources
[
(uiIndex:=8368, usiSubIndex:=3, uiElementSize:=4, uiNumberOfElements:=16,
eRequestService:=E_ParamReadWrite.WriteNVAndRAM, astParamData:=
//PI1: Status word 1 - Standard mapping, dont change
[(uiIndex:=8370 ,usiSubIndex:=1 ,eFormat:=E_BitOffset.Bit01_Low),
//PI2: Status word 2 - Standard mapping, dont change
(uiIndex:=8371 ,usiSubIndex:=1 ,eFormat:=E_BitOffset.Bit01_Low),
//PI3: Actual position in user units - modulo- Standard mapping, dont change
(uiIndex:=8364 ,usiSubIndex:=27 ,eFormat:=E_BitOffset.Bit01_Low),
//PI4: Actual position in user units - modulo- Standard mapping, dont change
(uiIndex:=8364 ,usiSubIndex:=27 ,eFormat:=E_BitOffset.Bit02_High),
//PI5: Control mode process value /Filtered actual speed in user units
(uiIndex:=8364 ,usiSubIndex:=48 ,eFormat:=E_BitOffset.Bit01_Low),
//PI6: Control mode process value /Filtered actual speed in user units
(uiIndex:=8364 ,usiSubIndex:=48 ,eFormat:=E_BitOffset.Bit02_High),
//PI7: Actual torque in communication units- Standard mapping, dont change
(uiIndex:=8364 ,usiSubIndex:=95 ,eFormat:=E_BitOffset.Bit01_Low),
//PI8: reserved - Standard mapping, dont change
(uiIndex:=0 ,usiSubIndex:=0),
//PI9: reserved - Standard mapping, dont change
(uiIndex:=0 ,usiSubIndex:=0),
//PI10: reserved- Standard mapping, dont change
(uiIndex:=0 ,usiSubIndex:=0),
//PI11: Control mode process value /I-component speed controller in user units
(uiIndex:=8364 ,usiSubIndex:=80 ,eFormat:=E_BitOffset.Bit01_Low),
//PI12: Control mode process value /I-component speed controller in user unit
(uiIndex:=8364 ,usiSubIndex:=80 ,eFormat:=E_BitOffset.Bit02_High),
//PI13: Default: TouchProbe 1 /trigger counter
(uiIndex:=8352 ,usiSubIndex:=14 ,eFormat:=E_BitOffset.Bit01_Low),
//PI14: Default: TouchProbe 1 /detected value
(uiIndex:=8352 ,usiSubIndex:=3 ,eFormat:=E_BitOffset.Bit01_Low),
//PI15: Default: TouchProbe 1 /detected value
(uiIndex:=8352 ,usiSubIndex:=3 ,eFormat:=E_BitOffset.Bit02_High),
//PI16: CS..A - Safety card F-status word 1
(uiIndex:=8703 ,usiSubIndex:=2)])];
_ReadWriteInitialParameterArray : MC_SEW_ReadWriteInitialParameterArray;
_ReadDriveProcessData : MC_SEW_ReadDriveProcessData;
// Value of the PI16 CS..A - Safety card F-status word 1
_uiFStatusWord1 : WORD;
END_VAR
// Initial configuration - Add safety status word 1 to PI16
_ReadWriteInitialParameterArray(Axis:= Axis1,Execute:= TRUE,Parameter:= _astParam);
// Read the PI16, value is available at the variable _uiFStatusWord1
_ReadDriveProcessData( Axis:=Axis1,Enable:=_ReadWriteInitialParameterArray.Done,PdNumber:= 16,Value=>_uiFStatusWord1);