Fortiphyd / GRFICSv2

Version 2 of the Graphical Realism Framework for Industrial Control Simulation (GRFICS)
GNU General Public License v3.0
394 stars 72 forks source link

Usage of variables HMI_* in OpenPLC #10

Open Thus0 opened 3 years ago

Thus0 commented 3 years ago

Hi,

first of all, thanks for the great work ! I've managed to run GRFICSv2 with docker containers and I've used OpenPLCv3 instead of OpenPLCv2 as the web interface is nicer. The chemical plan seems to work : I can see the values on ScadaBR which match what I see on the Simulation. I can also change directly OpenPLC holding registers with modbus command to change the pressure_sp.

I have a question : what's the purpose of the variables hmi_* registers at %MWxx as ScadaBR seems to read %IWxx variables ?

https://github.com/Fortiphyd/GRFICSv2/blob/master/workstation_vm/simplified_te.st#L377

   hmi_pressure AT %MW20 : INT;
    hmi_level AT %MW21 : INT;
    hmi_f1_valve_pos AT %MW22 : INT;
    hmi_f1_flow AT %MW23 : INT;
    hmi_f2_valve_pos AT %MW24 : INT;
    hmi_f2_flow AT %MW25 : INT;
    hmi_purge_valve_pos AT %MW26 : INT;
    hmi_purge_flow AT %MW27 : INT;
    hmi_product_valve_pos AT %MW28 : INT;
    hmi_product_flow AT %MW29 : INT;
    scan_count AT %MW30 : UINT := 0;
Thus0 commented 3 years ago

In fact, Aflow/feed2 is about 640 kMol/h (on my simulation HMI) but it's limited to 500 kMol/h (on ScadaBR HMI) because of this scaling (divide by 500) https://github.com/Fortiphyd/GRFICSv2/blob/22d7b050cc4ec8fd5057db0dffa298e5995d6135/simulation_vm/simulation/remote_io/modbus/feed2.py#L57

So I've divided by 700 in feed2.py and modified the multiplier (0,0106813153276875) on ScadaBR of Aflow so I can see the real value on the HMI instead of 500 kMol/h MicrosoftTeams-image (2)

I think I need to update the scale also in the PLC program but I don't know what I need to change... I've seen some "flow_max=500" https://github.com/Fortiphyd/GRFICSv2/blob/22d7b050cc4ec8fd5057db0dffa298e5995d6135/workstation_vm/simplified_te.st#L183

Could you provide some help or update the scaling ? @djformby @sam-bryce