Skip to content

Commit

Permalink
align and casing
Browse files Browse the repository at this point in the history
  • Loading branch information
ThKindler committed Jan 19, 2024
1 parent 4d26e7c commit fb0107e
Show file tree
Hide file tree
Showing 14 changed files with 579 additions and 599 deletions.
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ PROGRAM MyProgram
WriteParameter : LAcycCom_classWriteDriveParams;
ReadParameter : LAcycCom_classReadDriveParams;
diagnostic : LAcycCom_ooptypeDrivediagnostics;
RVALUEp304 : real;
RVALUEp305 : real;
RVALUEp310 : real;
FirstCycle : Bool := TRUE;
RVALUEp304 : REAL;
RVALUEp305 : REAL;
RVALUEp310 : REAL;
FirstCycle : BOOL := TRUE;
datasetitemread : LAcycCom_typeDriveDataset;
datasetitemwrite : LAcycCom_typeDriveDataset;
elements : int;
elements : INT;
END_VAR
Resourcemanager.execute();
Expand All @@ -68,16 +68,16 @@ PROGRAM MyProgram
;
LAcycComstateDef#IDLE :
datasetitemread.parameterNumber := uint#304;
datasetitemread.parameterNumber := UINT#304;
elements := ReadParameter.AddatasetItem(datasetItem := datasetitemread,
element_no := -1);
datasetitemread.parameterNumber := uint#305;
datasetitemread.parameterNumber := UINT#305;
elements := ReadParameter.AddatasetItem(datasetItem := datasetitemread,
element_no := -1);
ReadParameter.Start(driveObjectId := uint#5,
hardwareId := word#269);
ReadParameter.Start(driveObjectId := UINT#5,
hardwareId := WORD#269);
LAcycComstateDef#DONE :
datasetitemread := ReadParameter.ReaddatasetItem(element_no := 0);
Expand All @@ -94,10 +94,10 @@ PROGRAM MyProgram
;
LAcycComstateDef#IDLE :
ReadParameterSingle.Start( driveObjectId := uint#5,
hardwareId := word#269,
parameterNumber := uint#310,
index := uint#0);
ReadParameterSingle.Start( driveObjectId := UINT#5,
hardwareId := WORD#269,
parameterNumber := UINT#310,
index := UINT#0);
LAcycComstateDef#DONE :
RVALUEp310 := ReadParameterSingle.GetValueREAL();
Expand All @@ -112,18 +112,18 @@ PROGRAM MyProgram
LAcycComstateDef#IDLE :
datasetitemwrite.parameterNumber := uint#2900;
datasetitemwrite.Rvalue := real#12.3;
datasetitemwrite.parameterNumber := UINT#2900;
datasetitemwrite.Rvalue := REAL#12.3;
elements := WriteParameter.AddatasetItem(datasetItem := datasetitemwrite,
element_no := -1);
datasetitemwrite.parameterNumber := uint#2901;
datasetitemwrite.Rvalue := real#45.6;
datasetitemwrite.parameterNumber := UINT#2901;
datasetitemwrite.Rvalue := REAL#45.6;
elements := WriteParameter.AddatasetItem(datasetItem := datasetitemwrite,
element_no := -1);
WriteParameter.Start(driveObjectId := uint#5,
hardwareId := word#269);
WriteParameter.Start(driveObjectId := UINT#5,
hardwareId := WORD#269);
LAcycComstateDef#DONE :
;
Expand All @@ -137,11 +137,11 @@ PROGRAM MyProgram
;
LAcycComstateDef#IDLE :
WriteParameterSingle.Start( driveObjectId := uint#5,
hardwareId := word#269,
parameterNumber := uint#2930,
WriteParameterSingle.Start( driveObjectId := UINT#5,
hardwareId := WORD#269,
parameterNumber := UINT#2930,
value := REAL#78.9,
index := uint#0);
index := UINT#0);
LAcycComstateDef#DONE :
;
Expand Down
180 changes: 90 additions & 90 deletions src/Blocks/Drives/Baseclass.st

Large diffs are not rendered by default.

166 changes: 83 additions & 83 deletions src/Blocks/Drives/classReadDriveParams.st

Large diffs are not rendered by default.

120 changes: 60 additions & 60 deletions src/Blocks/Drives/classReadDriveSingleParams.st

Large diffs are not rendered by default.

212 changes: 106 additions & 106 deletions src/Blocks/Drives/classWriteDriveParams.st

Large diffs are not rendered by default.

210 changes: 105 additions & 105 deletions src/Blocks/Drives/classWriteDriveSingleParams.st

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Blocks/Resource Management/IResourceManager.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ NAMESPACE Simatic.Ax.LAcycCom

INTERFACE IResourcemanager

METHOD Allocate : Int //AllocatedIndex
METHOD Allocate : INT //AllocatedIndex
VAR_INPUT
hardwareId : HW_IO; // Hardware identifier of the hardware module
END_VAR
Expand Down
8 changes: 4 additions & 4 deletions src/Blocks/Resource Management/OOPResourcemanager.st
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ NAMESPACE Simatic.Ax.LAcycCom
tempQueueElementPrevious : INT; // Queue element before current element
tempQueueElementNext : INT; // Queue element after current element
tempRetVal : INT; // Return value of system functions
tempByte : BYTE; // Temporary byte variable for slice command
tempByte : BYTE; // Temporary BYTE variable for slice command
tempStationInUse : BOOL; // Station is already processing with acyclic communication
END_VAR
//Check if FB is been disabled
Expand Down Expand Up @@ -108,7 +108,7 @@ NAMESPACE Simatic.Ax.LAcycCom
END_FOR;
REPEAT
// Set maximum number of resources from I&M Data
instGetIMData(LADDR := word#50, IM_TYPE := UINT#0, DATA := statIM0Data);
instGetIMData(LADDR := WORD#50, IM_TYPE := UINT#0, DATA := statIM0Data);
UNTIL (instGetIMData.DONE) OR (instGetIMData.ERROR) END_REPEAT;
IF instGetIMData.DONE THEN
IF (statIM0Data.Order_ID[6] = '2') THEN
Expand Down Expand Up @@ -259,7 +259,7 @@ NAMESPACE Simatic.Ax.LAcycCom
requestBuffer.elements[tempQueueElementNext].queueElementPrevious := tempQueueElementPrevious;
requestBuffer.elements[tempQueueElementPrevious].queueElementNext := tempQueueElementNext;
END_IF;
requestBuffer.elements[tempActBufferIndex].state := Byte#16#00;
requestBuffer.elements[tempActBufferIndex].state := BYTE#16#00;
requestBuffer.elements[tempActBufferIndex].hardwareId := HW_IO#default;
requestBuffer.elements[tempActBufferIndex].queueElementPrevious := -1;
requestBuffer.elements[tempActBufferIndex].queueElementNext := -1;
Expand Down Expand Up @@ -445,7 +445,7 @@ NAMESPACE Simatic.Ax.LAcycCom
IF (requestBuffer.header.lockBuffer = FALSE) AND (requestBuffer.header.nextFreeElement >= 0) AND (requestBuffer.header.nextFreeElement <= LAcycComConstantsInt#LACYCCOM_BUFFER_ELEMENTS_UPPER_LIM) THEN
requestBuffer.header.lockBuffer := TRUE;
Allocate := requestBuffer.header.nextFreeElement;
requestBuffer.elements[Allocate].state := byte#16#00;
requestBuffer.elements[Allocate].state := BYTE#16#00;
requestBuffer.elements[Allocate].state.%X0 := TRUE;
requestBuffer.elements[Allocate].hardwareId := hardwareId;
requestBuffer.elements[Allocate].queueElementNext := -1;
Expand Down
32 changes: 16 additions & 16 deletions src/Blocks/systemfunctions.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ using system.DateTime;

NAMESPACE Simatic.Ax.LAcycCom
TYPE typeGEOADDR : STRUCT
HWTYPE : Uint;
AREA : Uint;
IOSYSTEM: Uint;
STATION : Uint;
SLOT : Uint;
SUBSLOT : Uint;
HWTYPE : UINT;
AREA : UINT;
IOSYSTEM: UINT;
STATION : UINT;
SLOT : UINT;
SUBSLOT : UINT;
END_STRUCT;
END_TYPE

TYPE TypeSoftware_Revision : STRUCT
Functional : Int := 3;
Functional : INT := 3;
END_STRUCT;
END_TYPE

Expand All @@ -26,14 +26,14 @@ NAMESPACE Simatic.Ax.LAcycCom
FUNCTION_BLOCK Get_IM_Data
VAR_INPUT
LADDR :HW_IO;
IM_TYPE :UInt;
IM_TYPE :UINT;
end_VAR

VAR_OUTPUT
DONE :Bool;
BUSY :Bool;
ERROR :Bool;
STATUS :Word;
DONE :BOOL;
BUSY :BOOL;
ERROR :BOOL;
STATUS :WORD;
end_var
VAR_IN_OUT
DATA : Typedata;
Expand All @@ -42,20 +42,20 @@ NAMESPACE Simatic.Ax.LAcycCom
DONE := True;
BUSY := false;
ERROR := False;
STATUS := word#0;
STATUS := WORD#0;

END_FUNCTION_BLOCK

FUNCTION LOG2GEO : int
FUNCTION LOG2GEO : INT
VAR_INPUT
LADDR : HW_IO;
END_VAR
VAR_OUTPUT
GEOADDR : typeGEOADDR;
end_var

GEOADDR.IOSYSTEM := uint#1;
GEOADDR.STATION := uint#1;
GEOADDR.IOSYSTEM := UINT#1;
GEOADDR.STATION := UINT#1;

LOG2GEO :=0;
END_FUNCTION
Expand Down
20 changes: 0 additions & 20 deletions src/DummyClass.st

This file was deleted.

2 changes: 1 addition & 1 deletion src/Tags/Tags.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ NAMESPACE Simatic.Ax.LAcycCom
);
END_TYPE

type LAcycComConstantsByte : byte (
type LAcycComConstantsByte : BYTE (
LACYCCOM_NO_COMMAND := BYTE#16#00,
LACYCCOM_READ_COMMAND := BYTE#16#01,
LACYCCOM_WRITE_COMMAND := BYTE#16#02
Expand Down
48 changes: 24 additions & 24 deletions src/Types/DriveTypes.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,52 @@ NAMESPACE Simatic.Ax.LAcycCom
TYPE LAcycCom_typeDriveDataset

: STRUCT
parameterNumber : UInt := uint#0; // Number of the parameter
index : UInt := uint#0; // Parameter index
Rvalue : Real := real#0.0; // Parameter value
DWvalue : DWord := DWORD#16#0000_0000; // Parameter value
errorValue : Byte := byte#2#11111111; // Error number (16#FF: no error; else: see error list)
parameterNumber : UINT := UINT#0; // Number of the parameter
index : UINT := UINT#0; // Parameter index
Rvalue : REAL := REAL#0.0; // Parameter value
DWvalue : DWORD := DWORD#16#0000_0000; // Parameter value
errorValue : BYTE := BYTE#2#11111111; // Error number (16#FF: no error; else: see error list)
END_STRUCT;

END_TYPE
(*
TYPE LAcycCom_typeDriveDiagnostics

: STRUCT
status : Word := word#16#0000; // Status identifier when error occurred
subfunctionStatus : Word := word#16#0000; // Block status or error information
stateNumber : SInt := sint#0; // State of the FB when error occurred
driveObjectId : USInt := usint#0; // Identification number of the drive object
hardwareId : HW_IO := HW_IO#default; // Hardware identifier of the hardware module
parameterCount : Int := 0; // Total amount of parameters
firstParameterError : Int := -1; // Number of parameter at which the error occurred (-1: no parameter with error)
errorValue : Byte := byte#2#11111111; // Error number (16#FF: no error; else: see error list)
status : WORD := WORD#16#0000; // Status identifier when error occurred
subfunctionStatus : WORD := WORD#16#0000; // Block status or error information
stateNumber : SINT := SINT#0; // State of the FB when error occurred
driveObjectId : USINT := USINT#0; // Identification number of the drive object
hardwareId : HW_IO := HW_IO#default; // Hardware identifier of the hardware module
parameterCount : INT := 0; // Total amount of parameters
firstParameterError : INT := -1; // Number of parameter at which the error occurred (-1: no parameter with error)
errorValue : BYTE := BYTE#2#11111111; // Error number (16#FF: no error; else: see error list)
END_STRUCT;
END_TYPE
*)

TYPE LAcycCom_ooptypeDriveDiagnostics

: STRUCT
status : Word := word#16#0000; // Status identifier when error occurred
subfunctionStatus : Word := word#16#0000; // Block status or error information
stateNumber : LAcycCom_ReadWriteStatus; // State of the FB when error occurred
driveObjectId : USInt := usint#0; // Identification number of the drive object
hardwareId : HW_IO := HW_IO#default; // Hardware identifier of the hardware module
parameterCount : Int := 0; // Total amount of parameters
firstParameterError : Int := -1; // Number of parameter at which the error occurred (-1: no parameter with error)
errorValue : Byte := byte#2#11111111; // Error number (16#FF: no error; else: see error list)
status : WORD := WORD#16#0000; // Status identifier when error occurred
subfunctionStatus : WORD := WORD#16#0000; // Block status or error information
stateNumber : LAcycCom_ReadWriteStatus; // State of the FB when error occurred
driveObjectId : USINT := USINT#0; // Identification number of the drive object
hardwareId : HW_IO := HW_IO#default; // Hardware identifier of the hardware module
parameterCount : INT := 0; // Total amount of parameters
firstParameterError : INT := -1; // Number of parameter at which the error occurred (-1: no parameter with error)
errorValue : BYTE := BYTE#2#11111111; // Error number (16#FF: no error; else: see error list)
END_STRUCT;

END_TYPE

(*
TYPE LAcycCom_typeDriveMessages
: STRUCT
code : Array[0..typeconstantsint#LACYCCOM_MESSAGES_UPPER_LIM] of UInt;
info : Array[0..typeconstantsint#LACYCCOM_MESSAGES_UPPER_LIM] of UDInt;
code : Array[0..typeconstantsint#LACYCCOM_MESSAGES_UPPER_LIM] of UINT;
info : Array[0..typeconstantsint#LACYCCOM_MESSAGES_UPPER_LIM] of UDInt;
comeDateAndTime : Array[0..typeconstantsint#LACYCCOM_MESSAGES_UPPER_LIM] of LDATE_AND_TIME;
Mtype : Array[0..typeconstantsint#LACYCCOM_MESSAGES_UPPER_LIM] of SInt;
Mtype : Array[0..typeconstantsint#LACYCCOM_MESSAGES_UPPER_LIM] of SINT;
END_STRUCT;

END_TYPE
Expand Down
Loading

0 comments on commit fb0107e

Please sign in to comment.