runningthegeneratedequipmentsimulator

The GEM Test Tool is an application included in TransSECS installations which can be used to run a tool on port 5010 Device ID 1. It is designed as a simple test tool to run against the sample TransSECS host projects or the SECS Tester. This application was developed using TransSECS and MIStudio and has a runtime license that expires at the end of each year. Please ask for a license renewal or link to update the software if your license has expired.

When you build an equipment (process tool) application in TransSECS, a tool simulator will also be generated. The simulator will be located in your project directory, in a ToolNameSimulator directory, where “ToolName” is the name of your tool project, for example, GEMToolSimulator.

To run the simulator use the ToolSimulator executable for your platform. The tool will start up listening for a host connection on the port and device id configured in your project.

Normally the tool simulator starts up running on the port and device id set up in the project. The configuration can be changed so that the tool runs on any port (including SECSI ports) and any device id. This configuration is in the Simulator.config file in the generated simulator directory.

To change the port or device id for the simulator, open the Simulator.config file in a text editor such as wordpad or notepad++. Find the section which has the application parameters, which looks like this as a default:

# Application parameters.  Add parameters as needed starting from 1
# To specify a port, uncomment out parameters .4 and .5 and change the port from 5010
# to use a tool characterization (json), uncomment out parameters 8 and 9 and change the name of the ToolName.json file
wrapper.app.parameter.1=com.ergotech.transsecs.secs.EquipmentSimulator
wrapper.app.parameter.2=deploy.TransferStations
wrapper.app.parameter.3=-g
#wrapper.app.parameter.4=-p
#wrapper.app.parameter.5=5010
#wrapper.app.parameter.6=-deviceid
#wrapper.app.parameter.7=1
#wrapper.app.parameter.8=-j
#wrapper.app.parameter.9=GEMTool.json

The wrapper.app.parameters must be uncommented by removing the # at the beginning of the line. The parameter numbers must be in order. In other words, if you want to change just the deviceid, uncomment the line wrapper.app.parameter.6 and wrapper.app.parameter.7 lines but renumber them to .4 and .5, or uncomment all the parameters .4,.5,.6, and .7.

The TransSECS Host software can go online with a process tool and “characterize” it - obtain existing VIDs, CEIDs, and RPTIDs. This “characterization” is encapsulated in a JSON file, with the name ToolName.json, where ToolName is the name of the host project. After characterization this file will be in the userfiles of the project.

For example when you build the GEMHost project from the TransSECS distribution, you will see a file

C:\Users\Public\ErgoTech\TransSECSDevices\Projects\GEMHost\GEMHostModel.json

In the project folder (or in the userfiles folder for MIStudio).

Any file generated by TransSECS GEM Host will work. This file describes the tool and so can be used as a basis to reproduce the behavior of the tool.

This JSON file can be loaded into a bare simulator. You can use the GEMTool example for this, or download the SimulatorTool from here (this is just the GEMTool example with CEIDs and the simulation specific VIDs removed).

Edit the ToolSimulator.conf file in the MIStudioSuite\TransSECS\resources\ToolSimulator folder

You will need to change the section in the .conf file that adds the parameters to point to your file. You can replace the whole section with this code, or download this configuration file and replace the existing file.

# Application parameters.  Add parameters as needed starting from 1
# To specify a port, uncomment out parameters .4 and .5 and change the port from 5010
wrapper.app.parameter.1=com.ergotech.transsecs.secs.EquipmentSimulator
wrapper.app.parameter.2=deploy.$toolname$
wrapper.app.parameter.3=-g
# The -j option allows you to very quickly build a tool simulator from you host project.
# See here, for more information https://www.ergotech.com/wiki/doku.php?id=runningthegeneratedequipmentsimulator
# Uncomment (remove the # that starts the line) this next line, and the wrapper.app.parameter.5 after providing a path to your host file.
#wrapper.app.parameter.4=-j
# Edit the next line to point to a JSON file generated by a TransSECS Host application
# Any GEM Host project that you build will have a file with the name of the host
# for example, GEMHost will have the file GEMHostModel.json in the TransSECS folder (or the UserFiles for MIStudio applications)
# You can Characterize the tool (https://ergotech.com/files/guides/TransSECSGEMHostToolCharacterizationGuide.pdf) to get
# all the information you need for your simulation.
#wrapper.app.parameter.5=\PATH\TO\JSON\FILE
#wrapper.app.parameter.6=-p
#wrapper.app.parameter.7=5010
#wrapper.app.parameter.8=-deviceid
#wrapper.app.parameter.9=1

Remove the # from the line:

wrapper.app.parameter.4=-j

Add the path to your JSON file:

You must replace the backslashes (\) with forward slashes (/) in the path name before using this in the .conf file. In the example above, this would then be

C:/Users/Public/ErgoTech/TransSECSDevices/Projects/GEMHost/GEMHostModel.json

wrapper.app.parameter.5=C:/Users/Public/ErgoTech/TransSECSDevices/Projects/GEMHost/GEMHostModel.json

Change the Device ID and Port in the file to match the values in your host. You can see what you've set in your host by clicking on the root of the tree.

Modify and uncomment the appropriate lines in the .conf file:

wrapper.app.parameter.6=-p
wrapper.app.parameter.7=5010
wrapper.app.parameter.8=-deviceid
wrapper.app.parameter.9=1

Be sure that the numbering is consecutive. That is, if you've made other changes, the numbers following the wrapper.app.parameter. must start a zero and increment without any missing numbers. Lines that start with a # don't count.

After making these changes, double-click the ToolSimulator executable:

The simulator should start and you should see your variables and events in the “VID” and “Send Event” dropdown.

Change your “Tool IP Addr” to be localhost (or the IP Address of the system on which you are running the simulator).

Build your host application, click the SIM/LIVE button and click on a message. You'll see it connect to the simulator:

Choose an event and press the “Send Event” button. If you have reports attached to the event, choose a VID, change the value, send the event again and you'll see the updated value.

To improve the simulator you will probably need to add some of the tool's host commands and other special messages such as those for recipe handling. Simply open the SimulatorTool project,add the messages and rebuild.

GEM requires that certain variables be available from the tool. The SimulatorTool (or the GEMTool) provide this set of variables. If these variable names are not in your JSON file you should leave them in the tool simulator, otherwise, they can be removed (It does no harm to leave them in the simulator - the variables from the JSON file will be used if available).

To use a pre-defined ToolName.json for the simulator, prepare a TransSECS tool project with any number of messages (such as host commands and/or recipe messages), and include only two VIDs (OnlineOfflineState and LocalRemoteState) if not already defined by these names in the JSON file. These two parameters are needed for the base simulator software to be able to enable online/remote.

To use the JSON file for the simulator, copy this file into the generated simulator directory and edit the Simulator.config file as described in the section above to expose the .8 and .9 properties (-j and the name of the JSON file).

  • runningthegeneratedequipmentsimulator.txt
  • Last modified: 2021/09/02 12:38
  • by wikiadmin