forked from simjunheng/Metro_emulator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finished the sensorsPLCSimu_readme.md file.
- Loading branch information
1 parent
eb30448
commit 4e1c87d
Showing
4 changed files
with
140 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,3 +63,114 @@ You can also check the excel file `ladderConnectionMap.xlsx` to see the mapping | |
|
||
|
||
|
||
##### Program module files list | ||
|
||
| Idx | Program File | Execution Env | Description | | ||
| ---- | ---------------------------------- | ------------- | ------------------------------------------------------------ | | ||
| 1 | signalPlcEmu/plcConfig.txt | | System config file. | | ||
| 2 | signalPlcEmu/plcSimGlobalSignal.py | python 3 | System needs global file, the system config file's contents will be saved in the global parameters. | | ||
| 3 | signalPlcEmu/plcSimulatorSignal.py | python 3 | Main PLC simulation program. | | ||
| | | | | | ||
|
||
Libraries required code base: https://github.com/LiuYuancheng/Metro_emulator/tree/main/src/lib | ||
|
||
|
||
|
||
------ | ||
|
||
### Program Setup | ||
|
||
###### Development Environment : python 3.7.4 | ||
|
||
###### Additional Lib/Software Need | ||
|
||
1. **pyModbusTCP** : https://github.com/sourceperl/pyModbusTCP | ||
|
||
``` | ||
pip install pyModbusTCP | ||
``` | ||
|
||
###### Hardware Needed : None | ||
|
||
###### Execution environment | ||
|
||
``` | ||
OS : ubuntu 20.04 server | ||
Display mode: | ||
- Display output: No | ||
VM Deploy Config: | ||
- NIC number: 2 | ||
- SSH: enable | ||
- NIC 1: IP address: 10.0.10.11, gateway: 10.0.10.1 | ||
- NIC 2: IP address: 192.168.100.11, gateway: 192.168.100.1 | ||
``` | ||
|
||
|
||
|
||
------ | ||
|
||
### Program Usage | ||
|
||
|
||
|
||
##### Edit Configuration File | ||
|
||
Open config file `plcConfig.txt` | ||
|
||
``` | ||
# This is the config file template for the module <monitorApp.py> | ||
# Setup the paramter with below format (every line follow <key>:<val> format, the | ||
# key can not be changed): | ||
# Set the master PLC's name | ||
PLC_NAME:PLC-01 | ||
# Define the ip addresses allowed to read PLC state: | ||
# json list fomat: ["masterIP", "slave1IP", ...] | ||
ALLOW_R_L:["127.0.0.1", "192.168.0.10"] | ||
# Define the ip addresses allowed to change PLC state: | ||
# json list fomat: ["masterIP", "slave1IP", ...] | ||
ALLOW_W_L:["127.0.0.1"] | ||
# Define Realworld emulator ip | ||
RW_IP:127.0.0.1 | ||
# Define Realworld emulator connection port | ||
RW_PORT:3001 | ||
# Define PLC clock interval | ||
CLK_INT:0.6 | ||
# Define modbus TCP host IP, use 0.0.0.0 or localhost | ||
MD_BUS_IP:localhost | ||
# Define modbus TCP host Port, normally use 502 | ||
MD_BUS_PORT:502 | ||
``` | ||
|
||
|
||
|
||
##### Program Execution | ||
|
||
After follow the instruction in the file `metroConfig.txt` to setup all the parameters, you can run the program: | ||
|
||
``` | ||
python plcSimulatorSignal.py | ||
``` | ||
|
||
or double click the file `runSignalPlcCtrlEmu_win.bat` | ||
|
||
|
||
|
||
------ | ||
|
||
#### Problem and Solution | ||
|
||
Refer to `doc/ProblemAndSolution.md` | ||
|
||
|
||
|
||
------ | ||
|
||
> last edit by LiuYuancheng ([email protected]) by 26/07/2023 if you have any problem, please send me a message. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Railway Sensor-Signal System Control PLC Simulator | ||
|
||
### Introduction | ||
|
||
**Please refer to the Railway Sensor-Signal System Control PLC Simulator Readme file in the document fold with the below section: ** | ||
|
||
- Introduction | ||
- Program design | ||
- Program Setup steps | ||
- Execute the program | ||
- Problem and solution | ||
|
||
**Click below link to jump to the readme file:** | ||
|
||
[ Railway Sensor-Signal System Control PLC Simulator Readme file ](../../doc/sensorsPLCSimu_readme.md) | ||
|
||
|
||
|
||
------ | ||
|
||
> last edit by LiuYuancheng ([email protected]) by 25/07/2023 if you have any problem, please send me a message. |