
Packed for Docker support + initial :alias
 
    An InterSystems ObjectScript implementation, thats builds an ObjectScript Class based on a MTConnect probe file and adds data from a current file.
System Explorer > ClassesImportsrc/cls/MTConnectImport 
zpm "install mtconnect-objectscript"
probe: Holds the data from the probe file.probeFromFile: When enabled the probe property contains an absolute path to the probe file. When disabled the probe property contains the probe file as a string.current: Holds the data from the current file.currentToFile: When enabled the current property contains an absolute path to the current file. When disabled the current property contains the current file as a string.recievedLine(optional): Holds a received string. (Used for cleardata)className(will be set): The complete class name of the generated class.A Business Operation, that builts an ObjectScript class based on a MTConnect probe file. After the class is successfully generated, the operation inserts data from a MTConnect current file.
MTConnect.MSG.MTConnectRequest
MTConnect.MSG.MTConnectResponse
PackageName: The package where the class will be generated in.suffixClass: A suffix for the class name.Kind: ID or Name. Sets from which attributes the class will be build.ClearData: When enabled deletes all data, when a ***CL*** message is received.SuperClasses: Define comma seperated superclasses for the class.GenerateDataTypes: When enabled the MTConnect Datatypes will be generated automatically.DataTypesPackage: The package where the MTConnect datatypes exists or will be generated in.GenerateIsValid: When enabled generates a IsValid Method for the datatypesGenerateNormalize: When enabled generates a Normalize Method for the datatypesGenerateLogicalToDisplay: When enabled generates a LogicalToDisplay Method for the datatypesGenerateDisplayToLogical: When enabled generates a DisplayToLogical Method for the datatypesLog: When enabled all changes will be written to a log file.LogFile: An absolute path to the log file.Name: The name of the datatype.Unit: The unit to display the datatype with.DataType: The underlying ObjectScript type (Currently only works with %String, %Integer and %Double).AllowedStringValues: Comma separated list for the allowed values. If left empty all values will be allowed. (only used when DataType is %String)AllowedNumericMaxValue: The maximum value that is allowed. If left empty all values will be allowed. (only used when DataType is %Double or %Integer)AllowedNumericMinValue: The minimum value that is allowed. If left empty all values will be allowed. (only used when DataType is %Double or %Integer)Builds MTConnect Datatypes based on a MTConnect.MSG.CreateDataTypeRequest.
pRequest: The MTConnect.MSG.CreateDataTypeRequestpPackage: The package name to store the datatypes (Default is MTConnect.DataTypes)pGenerateIsValid: If enabled generates the IsValid method for the datatype (enabled by default)pGenerateNormalize: If enabled generates the Normalize method for the datatype (enabled by default)pGenerateDisplayToLogical: If enabled generates the DisplayToLogical method for the datatype (enabled by default)pGenerateLogicalToDisplay: If enabled generates the LogicalToDisplay method for the datatype (enabled by default)A Business Operation to build MTConnect Datatypes based on a MTConnect.MSG.CreateDataTypeRequest.
MTConnect.MSG.CreateDataTypeRequest
Package: The package name to store the datatypes (Default is MTConnect.DataTypes)IsValid: If enabled generates the IsValid method for the datatypeNormalize: If enabled generates the Normalize method for the datatypeDisplayToLogical: If enabled generates the DisplayToLogical method for the datatypeLogicalToDisplay: If enabled generates the LogicalToDisplay method for the datatypeTip: Hava a look at MTConnect.DataTypes for some default MTConnect DataTypes.
A simple Production to show the usage of the DataTypesBuilder Operation and the ClassBuilder Operation.
How to open and start the Production:
Interoperabilty > Configure > Production > GoProduction SettingsActions > OpenMTConnect > ExampleProduction > Production > GoStartAn example for how to use the DataTypesBuilder Operation to create MTConnect DataTypes.
DataTypesDataTypes ProcessActions > TestEns.StringRequest
StringValue field String to generate a String MTConnect DataTypeStringValue field Double to generate a Double MTConnect DataTypeStringValue field Inetger to generate a Integer MTConnect DataTypeInvoke Testing ServiceMTConnect.ExampleProduction.DataTypes
An example for how to use the ClassBuilder Operation to create MTConnect Class from a MTConnect Probe and Current file.
Class BuilderClass Builder ProcessActions > TestEns.RequestInvoke Testing ServiceMTConnect.ExampleProduction.BuiltClassesMTConnect.ExampleProduction.DataTypes
Make sure you have git and Docker desktop installed.
Clone/git pull the repo into any local directory
$ git clone https://github.com/intersystems-dach/MTConnect-ObjectScript.git   
Open the terminal in this directory and run:
$ docker-compose build
Run IRIS container with your project:
$ docker-compose up -d
Test from docker console
$ docker-compose exec iris1 iris session iris
USER>
or using WebTerminal
http://localhost:42773/terminal/
View on InterSystems Open Exchange.
View the related article on InterSystems Developer Community.
by Jannis S. & Philipp B.