![OwnObjectScriptExtensionLogo](https://raw.githubusercontent.com/intersystems-dach/MTConnect-ObjectScript/master/resources/logo.png)
An InterSystems ObjectScript implementation, thats builds an ObjectScript Class based on a MTConnect probe file and adds data from a current file.
- Installation
- MTConnect.MSG.MTConnectRequest / Response
- MTConnect.BO.ClassBuilder
- MTConnect.MSG.CreateDataTypeRequest
- MTConnect.DataTypesBuilder
- MTConnect.BO.DataTypesBuilderOperation
- Example Production
- Bugs
- Release Notes
- Download the latest realease
- Extract the file
- In the InterSystems Management Portal navigate to
System Explorer > Classes
- Click on
Import
- Under Import from File or a Directory make sure to select Directory
- Enter the path to the MTConnect Folder under
src/cls/MTConnect
- Click on
Import
- Make sure you have the InterSystems Package Manager installed.
- Then run the following command in the InterSystems terminal:
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 datatypes
Log
: 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 whenDataType
is %String)AllowedNumericMaxValue
: The maximum value that is allowed. If left empty all values will be allowed. (only used whenDataType
is %Double or %Integer)AllowedNumericMinValue
: The minimum value that is allowed. If left empty all values will be allowed. (only used whenDataType
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 datatype
Tip: 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:
- In the InterSystems Management Portal navigate to
Interoperabilty > Configure > Production > Go
- Click on
Production Settings
- Navigate to
Actions > Open
- Choose
MTConnect > ExampleProduction > Production > Go
- Click on
Start
An example for how to use the DataTypesBuilder Operation to create MTConnect DataTypes.
- From the category dropdown menu choose
DataTypes
- Choose the
DataTypes Process
- Navigate to
Actions > Test
- From the Request Type dropdown menu choose
Ens.StringRequest
- Type in the
StringValue
field String to generate a String MTConnect DataType OR - Type in the
StringValue
field Double to generate a Double MTConnect DataType OR - Type in the
StringValue
field Inetger to generate a Integer MTConnect DataType
- Type in the
- Click on
Invoke Testing Service
- You can follow the Visual Trace to see how the DataType was created
- You will find the DataTypes under
MTConnect.ExampleProduction.DataTypes
An example for how to use the ClassBuilder Operation to create MTConnect Class from a MTConnect Probe and Current file.
- From the category dropdown menu choose
Class Builder
- Choose the
Class Builder Process
- Navigate to
Actions > Test
- From the Request Type dropdown menu choose
Ens.Request
- Click on
Invoke Testing Service
- You can follow the Visual Trace to see how the MTConnect Class was created
- You will find the MTConnect Class under
MTConnect.ExampleProduction.BuiltClasses
- The Operation will also generate MTConnect DataTypes based on the files. You can find them under
MTConnect.ExampleProduction.DataTypes
- no known bugs
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.