Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidDKo authored Oct 27, 2023
1 parent f6262d1 commit f2a711b
Showing 1 changed file with 122 additions and 1 deletion.
123 changes: 122 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,128 @@ Simatic.Ax.LAcycCom;

## Example

<please provide a working example>
PROGRAM MyProgram
VAR
Resourcemanager : OOPLAcycCom_ResourceManager;
WriteParameterSingle : LAcycCom_classWriteDriveSingleParams;
ReadParameterSingle : LAcycCom_classReadDriveSingleParams;
WriteParameter : LAcycCom_classWriteDriveParams;
ReadParameter : LAcycCom_classReadDriveParams;

diagnostic : LAcycCom_ooptypeDrivediagnostics;

RVALUEp304 : real;
RVALUEp305 : real;
RVALUEp310 : real;
FirstCycle : Bool := TRUE;
datasetitemread : LAcycCom_typeDriveDataset;
datasetitemwrite : LAcycCom_typeDriveDataset;
elements : int;
END_VAR

Resourcemanager.execute();

ReadParameter.execute();
ReadParameterSingle.execute();
WriteParameter.execute();
WriteParameterSingle.execute();

If FirstCycle Then
ReadParameter.Config(requestBuffer := Resourcemanager);
ReadParameterSingle.Config(requestBuffer := Resourcemanager);
WriteParameter.Config(requestBuffer := Resourcemanager);
WriteParameterSingle.Config(requestBuffer := Resourcemanager);
end_IF;

CASE ReadParameter.Status() OF
LAcycComstate_def#BUSY :
;

LAcycComstate_def#IDLE :
datasetitemread.parameterNumber := uint#304;
elements := ReadParameter.AddatasetItem(datasetItem := datasetitemread,
element_no := -1);

datasetitemread.parameterNumber := uint#305;
elements := ReadParameter.AddatasetItem(datasetItem := datasetitemread,
element_no := -1);

ReadParameter.Start(driveObjectId := uint#5,
hardwareId := word#269);

LAcycComstate_def#DONE :
datasetitemread := ReadParameter.ReaddatasetItem(element_no := 0);
RVALUEp304 := datasetitemread.value;
datasetitemread := ReadParameter.ReaddatasetItem(element_no := 1);
RVALUEp305 := datasetitemread.value;

LAcycComstate_def#ERROR :
diagnostic := ReadParameter.errordiagnostics();
END_CASE;

CASE ReadParameterSingle.Status() OF
LAcycComstate_def#BUSY :
;

LAcycComstate_def#IDLE :
ReadParameterSingle.Start( driveObjectId := uint#5,
hardwareId := word#269,
parameterNumber := uint#310,
index := uint#0);

LAcycComstate_def#DONE :
RVALUEp310 := ReadParameterSingle.GetValueREAL();

LAcycComstate_def#ERROR :
diagnostic := ReadParameterSingle.errordiagnostics();
END_CASE;

CASE WriteParameter.Status() OF
LAcycComstate_def#BUSY :
;

LAcycComstate_def#IDLE :

datasetitemwrite.parameterNumber := uint#2900;
datasetitemwrite.value := real#12.3;
elements := WriteParameter.AddatasetItem(datasetItem := datasetitemwrite,
element_no := -1);

datasetitemwrite.parameterNumber := uint#2901;
datasetitemwrite.value := real#45.6;
elements := WriteParameter.AddatasetItem(datasetItem := datasetitemwrite,
element_no := -1);

WriteParameter.Start(driveObjectId := uint#5,
hardwareId := word#269);

LAcycComstate_def#DONE :
;

LAcycComstate_def#ERROR :
diagnostic := WriteParameter.errordiagnostics();
END_CASE;

CASE WriteParameterSingle.Status() OF
LAcycComstate_def#BUSY :
;

LAcycComstate_def#IDLE :
WriteParameterSingle.Start( driveObjectId := uint#5,
hardwareId := word#269,
parameterNumber := uint#2930,
value := REAL#78.9,
index := uint#0);

LAcycComstate_def#DONE :
;

LAcycComstate_def#ERROR :
diagnostic := WriteParameterSingle.errordiagnostics();
END_CASE;

FirstCycle := False;
END_PROGRAM

## Contribution

Expand Down

0 comments on commit f2a711b

Please sign in to comment.