Skip to content

Commit

Permalink
Correctnumber of possible parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidDKo committed Dec 7, 2023
1 parent f14c691 commit 80687a7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/Blocks/Drives/Baseclass.st
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ NAMESPACE Simatic.Ax.LAcycCom
statAllocatedIndex : Int := -1; // Allocated element index in the buffer DB
statCountOfElements : Int := 0; // Number of parameters in the dataset
statFirstParameterError : Int := -1; // Number of parameter at which the error occurred (-1: no parameter with error)
statDataRecordNo : DInt; // Used data record
statParameter : Array[0..LAcycComConstantsInt#LACYCCOM_WRITE_PARAMETERS_UPPER_LIM] of LAcycCom_TypestatstatParameter; // Parameter dataset
statDataRecordNo : DInt; // Used data record
statReqParameter : LAcycCom_TypestatstatReqParameter; // Request telegram
parameterAddress : Array[0..LAcycComConstantsInt#LACYCCOM_WRITE_PARAMETERS_UPPER_LIM] of LAcycCom_TypestatparameterAddress; // Parameter data in telegram
statReqParameterInit : LAcycCom_TypestatparameterAddress :=(attribute := byte#16#10, elementNo := byte#16#01, parameterNo := uint#0, index := uint#0);

statRespParameter : LAcycCom_TypestatRespParameter; // Response telegram
Expand Down Expand Up @@ -169,7 +167,7 @@ NAMESPACE Simatic.Ax.LAcycCom

// Clearing the sending buffer
statReqParameter.header := tempVoidHeader;
FOR tempLoopIndex := 0 TO LAcycComConstantsInt#LACYCCOM_WRITE_PARAMETERS_UPPER_LIM DO
FOR tempLoopIndex := 0 TO LAcycComConstantsInt#LACYCCOM_READ_PARAMETERS_UPPER_LIM DO
statReqParameter.parameterAddress[tempLoopIndex] := statReqParameterInit;
END_FOR;

Expand Down
4 changes: 3 additions & 1 deletion src/Blocks/Drives/classReadDriveParams.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ NAMESPACE Simatic.Ax.LAcycCom
var Private
statparameterCount : Int := -1;
dataset : Array[0..LAcycComConstantsInt#LACYCCOM_READ_PARAMETERS_UPPER_LIM] of LAcycCom_typeDriveDataset; // Dataset with all parameters to be read
end_VAR
statParameter : Array[0..LAcycComConstantsInt#LACYCCOM_READ_PARAMETERS_UPPER_LIM] of LAcycCom_TypestatstatParameter; // Parameter dataset
parameterAddress : Array[0..LAcycComConstantsInt#LACYCCOM_READ_PARAMETERS_UPPER_LIM] of LAcycCom_TypestatparameterAddress; // Parameter data in telegram
end_VAR


METHOD OVERRIDE BUSY
Expand Down
6 changes: 6 additions & 0 deletions src/Blocks/Drives/classReadDriveSingleParams.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ NAMESPACE Simatic.Ax.LAcycCom
var Private
statparameterNumber : UInt; // Number of the parameter
statindex : UInt; // Parameter index
statParameter : Array[0..READ_PARAMETERS_UPPER_LIM] of LAcycCom_TypestatstatParameter; // Parameter dataset
parameterAddress : Array[0..READ_PARAMETERS_UPPER_LIM] of LAcycCom_TypestatparameterAddress; // Parameter data in telegram
end_VAR

VAR CONSTANT
READ_PARAMETERS_UPPER_LIM : int := 0;
end_var

METHOD OVERRIDE BUSY
VAR_TEMP
Expand Down
4 changes: 3 additions & 1 deletion src/Blocks/Drives/classWriteDriveParams.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ NAMESPACE Simatic.Ax.LAcycCom
CLASS LAcycCom_classWriteDriveParams EXTENDS ReadWriteParameter
var Private
statparameterCount : Int := -1;
dataset : Array[0..LAcycComConstantsInt#LACYCCOM_READ_PARAMETERS_UPPER_LIM] of LAcycCom_typeDriveDataset; // Dataset with all parameters to be read
dataset : Array[0..LAcycComConstantsInt#LACYCCOM_WRITE_PARAMETERS_UPPER_LIM] of LAcycCom_typeDriveDataset; // Dataset with all parameters to be read
statReqWriteParameter : LAcycCom_TypestatReqWriteParameter; // Request telegram to change the parameter values
statReqReadParameter : LAcycCom_TypestatstatReqParameter; // Request telegram
statParameter : Array[0..LAcycComConstantsInt#LACYCCOM_WRITE_PARAMETERS_UPPER_LIM] of LAcycCom_TypestatstatParameter; // Parameter dataset
parameterAddress : Array[0..LAcycComConstantsInt#LACYCCOM_WRITE_PARAMETERS_UPPER_LIM] of LAcycCom_TypestatparameterAddress; // Parameter data in telegram
end_VAR

VAR CONSTANT
Expand Down
3 changes: 3 additions & 0 deletions src/Blocks/Drives/classWriteDriveSingleParams.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ NAMESPACE Simatic.Ax.LAcycCom
statParameterDWValue : DWORD;
statReqWriteParameter : LAcycCom_TypestatReqWriteParameter; // Request telegram to change the parameter values
statReqReadParameter : LAcycCom_TypestatstatReqParameter; // Request telegram
statParameter : Array[0..WRITE_PARAMETERS_UPPER_LIM] of LAcycCom_TypestatstatParameter; // Parameter dataset
parameterAddress : Array[0..WRITE_PARAMETERS_UPPER_LIM] of LAcycCom_TypestatparameterAddress; // Parameter data in telegram
end_VAR

VAR CONSTANT
LENGTH_WRITE_TELEGRAM_UPPER_LIM : Int := 227; // Maximum length of parameter information when using WRREC
WRITE_PARAMETERS_UPPER_LIM : int := 0;
end_var

METHOD OVERRIDE BUSY
Expand Down

0 comments on commit 80687a7

Please sign in to comment.