What is OPC GAMS?
OPC GAMS is a reference implementation to integrate OPC UA server with GAMS tool. It is a light weight tool to run GAMS models and access the model input/output data remotely. It can run on any workstation/server which supports java environment (for example, Linux or windows desktops etc). It was written Java using GAMS Java API and OPC UA Milo mavan project stack.
Why OPC GAMS? and what is it's purpose? what is the typical usecase?
Usually, while deploying complex GAMS models in production environment or run GAMS models that are deployed in a remote machine/cloud, REST API is often used to interface GAMS with its clients. In such cases, OPC GAMS is a nice alternate where it uses robust client server architecture facilitated by state-of-the-art industry standard OPC UA protocol. OPC UA clients can call GAMS models via OPC UA server by passing required inputs and retrive outputs of the models after their execution.
How to get it up and running?
- Clone this repository on to your local machine.
- Import it to Eclipse Project as a Mavan project.
- Edit the GAMS installation path(GAMS Java API jar file) in pom.xml
- Build it or Run it as Java Application.
How the whole project code is organized?
The java source code files are organized in 3 packages. Namely, opcPi, serverConfigurationClasses and connectorPlugins.
-
opcGAMSServer
package contains, all the OPC UA server setup classes, server namespaces, server configuration xml files. -
serverConfigurationClasses
package contains java classes representingserver_config.xml
file. Basically used to marshell and unmarshell the data present in the xml file. -
gAMSConnector
package contains java classes for interfacing the GAMS tool with OPC UA server. It contains GAMS Java API methods.
What are the basic flow of events?
When server is up and running, the requests from clients are handled by methods written in ServerNamespace class.
I would like to change the structure of server_config.xml and adopt the source code accordingly. How do I do it?
Add your changes to server_config.xsd schema file. Parse it to xjc.jar a (can be found in jdk bin folder). Overwrite the existing serverConfiguration Classes with the newly generated classes by xjc.jar.
I would like to run my own GAMS models, pass/retrive custom input/output variables. How do I modify the code?
- Copy the GAMS model files into /ECOWET folder.
- Edit the server_config.xml file to add input and output variables of GAMS models as OPC UA server nodes
- Add/Edit ModelConnector classes in gAMSConnector Package to interface GAMS models