User Tools

Site Tools


simple_plc_simulation

This is an old revision of the document!


Simple PLC Simulation

Introduction

PLCs can be “simulated” in MIStudio, MIX and TransSECS Devices deployments so that the software may be tested if the PLC is not present.

Setup

There are three parameters that used to set up this simulation, one of which is optional (can be left set to its default value), the java tmp directory (see below), where the simulator files are written. These parameters are added to the command line which runs the application, either the MIStudio.conf, MIX.conf, run.bat or run.sh for TransSECS deployments. Examples of these deployments and configurations will be shown below.

These three parameters are:

java.io.tmpdir - this can be left at its default, which is the system's tmp (temp) directory and is OS dependent. Optionally, if set to a different location for the simulation files then several ErgoTech applications may share the same “simulation” in a controlled manner (see examples below under Examples).

vib.sharedplcsimulation - this is mandatory and is set to “true”

XXXXXXXX.simulate - this is mandatory and XXXXXXXX is the name of the device server to simulate, and is set to “true”

TransSECS Devices Example

This example uses the ModbusPLCTool project to simulate the Modbus PLC. After building the deployment to the ModbusPLCToolDeployment directory, the run.bat or run.sh file can be modified to set up the simulation.

The name of the device server is “ModbusTCP”. For the purpose of sharing registers between this application and an MIStudio project (example below), we will use a directory called “C:/PLCShare”.

The run.bat file will be edited in Notepad++ or another text editor. The line that says:

java deploy.ModbusPLCTool.EquipmentController

will be changed to add the three parameters to establish PLC simulation, as follows:

java -Djava.io.tmpdir=C:\PLCShare -DModbusTCP.simulate=true  -Dvib.sharedplcsimulation=true  deploy.ModbusPLCTool.EquipmentController

When run.bat is used to start the application, you will see a few files generated in C:/PLCShare (the number of files depends on the register types used for the device server).

Example

-Djava.io.tmpdir=F:\SPMsrl\PLCShare -Dvib.sharedplcsimulation=true -DOmronFins.simulate=true deploy.WB50101.EquipmentController

simple_plc_simulation.1595221764.txt.gz · Last modified: by wikiadmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki