User Tools

Site Tools


simple_plc_simulation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
simple_plc_simulation [2020/07/20 01:38] – [MIStudio Example] wikiadminsimple_plc_simulation [2023/08/06 13:56] (current) – [MIX] wikiadmin
Line 12: Line 12:
  
 **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). **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).
 +
 +Note: be sure that the directory you use for the java.io.tmpdir setting exists on your harddrive before running the configuration.
  
 **vib.sharedplcsimulation** - this is mandatory and is set to "true" **vib.sharedplcsimulation** - this is mandatory and is set to "true"
Line 41: Line 43:
 {{:pasted:20200720-000806.png?240}} {{:pasted:20200720-000806.png?240}}
  
 +====Using ErgoTechConfiguration.properties for Device Simulation=====
 +
 +Using the parameters above, instead of editing the run script, you can add these parameters to ErgoTechConfiguration.properties. Add a section starting with a comment such as:
 +
 +<code>
 +#for simulating devices, remove if not simulating
 +java.io.tmpdir=C:/DeviceSim/GEMTool
 +OmronFins.simulate=true 
 +vib.sharedplcsimulation=true
 +</code>
 +
 +if the example above, the device server OmronFins would be simulated
  
 ====MIStudio Example==== ====MIStudio Example====
Line 60: Line 74:
 When you start MIStudio the simulator for a Modbus device called "ModbusTCP" will be set up to simulate. When you start MIStudio the simulator for a Modbus device called "ModbusTCP" will be set up to simulate.
  
-Note: You will not want to toggle MIStudio into "LIVE" mode to use the shared PLC simulation. Leave this at the "SIM" setting.+**Note: Do not toggle MIStudio into "LIVE" mode to use the shared PLC simulation. Leave this at the "SIM" setting.**
  
 To test the shared PLC simulation with the TransSECS Devices example above, start a new MIStudio project. In the Design Window add a SwingTextField and an Annunciator, copy both to the Diagram Window. In the Diagram Window, add a Modbus TCP Device Server and rename it to "ModbusTCP". Configure the ModbusTCP Server to use "localhost". Now add one Modbus 4X Int component to the Diagram Window, and select "ModbusTCP" for its device server and set the timebase to 1.0. Set the register address to 1 -- this is the register used for the "heartbeat" in the TransSECS Devices example.  To test the shared PLC simulation with the TransSECS Devices example above, start a new MIStudio project. In the Design Window add a SwingTextField and an Annunciator, copy both to the Diagram Window. In the Diagram Window, add a Modbus TCP Device Server and rename it to "ModbusTCP". Configure the ModbusTCP Server to use "localhost". Now add one Modbus 4X Int component to the Diagram Window, and select "ModbusTCP" for its device server and set the timebase to 1.0. Set the register address to 1 -- this is the register used for the "heartbeat" in the TransSECS Devices example. 
Line 69: Line 83:
 ====MIX==== ====MIX====
  
-MIX is set up in the same way as MIStudio. Edit the MIX.conf to add the three parameters as for the MIStudio example. +MIX is set up in the same way as MIStudio. Edit the MIX.conf to add the three parameters as for the MIStudio example taking care to add the java.additional parameters in numerical order. 
 + 
 +Alternatively, in the same way that ErgoTechConfiguration.properties is edited in the example above, mix.properties can be edited to add a section to define these properties instead of editing MIX.conf
  
simple_plc_simulation.1595223512.txt.gz · Last modified: by wikiadmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki