Skip to content

Commit b5df5a0

Browse files
committed
feat: sync simulator evolution to v1.9.0 with multilingual UX and releases
Publish the latest local Modbus Process Simulator state with UI/runtime improvements, new localized help resources, README refresh, and standalone release artifacts for v1.7.2-v1.9.0. Made-with: Cursor
1 parent 0d49060 commit b5df5a0

54 files changed

Lines changed: 265362 additions & 262423 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
1-
from modbuspal.main import ModbusPal
2-
from modbuspal.main import ModbusConst
1+
# Desativa todos os escravos (executar sob demanda no Script Manager).
32

4-
# Try each possible Modbus slave addresses
5-
for addr in range(ModbusConst.FIRST_MODBUS_SLAVE, ModbusConst.LAST_MODBUS_SLAVE+1):
6-
7-
# Get the modbus slave object corresponding to this address
8-
slave = ModbusPal.getModbusSlave(addr);
9-
10-
# Verify that there actually IS a modbus slave with this address
11-
if not(slave is None):
12-
13-
# Disable the slave:
14-
slave.setEnabled(False);
15-
3+
for slave in ModbusPal.getModbusSlaves():
4+
if slave is not None:
5+
slave.setEnabled(False)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Desativa todos os escravos Modbus do projeto corrente.
2+
3+
for slave in ModbusPal.getModbusSlaves():
4+
if slave is not None:
5+
slave.setEnabled(False)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ativa todos os escravos Modbus do projeto corrente.
2+
3+
for slave in ModbusPal.getModbusSlaves():
4+
if slave is not None:
5+
slave.setEnabled(True)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Inicia todas as automacoes do projeto (Jython no simulador).
2+
# A variavel ModbusPal e injetada pelo ScriptRunner, nao usar import ModbusPal.
3+
4+
for automation in ModbusPal.getAutomations():
5+
automation.start()
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Simula alteracao operacional de turno: sobe setpoints de carga/producao.
2+
3+
for slave in ModbusPal.getModbusSlaves():
4+
if slave is None:
5+
continue
6+
7+
name = slave.getName()
8+
regs = slave.getHoldingRegisters()
9+
10+
if name == "SubestacaoEletrica":
11+
regs.setValue(6, 980) # SP_LoadLimit
12+
elif name == "CentrifugaLinhaA":
13+
regs.setValue(1, 5650) # SP_RPM
14+
elif name == "DigestorPolpa":
15+
regs.setValue(5, 78) # SP_Level
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Avalia alarmes de processo com base em PVs e SPs.
2+
3+
for slave in ModbusPal.getModbusSlaves():
4+
if slave is None:
5+
continue
6+
7+
name = slave.getName()
8+
regs = slave.getHoldingRegisters()
9+
coils = slave.getCoils()
10+
inputs = slave.getDiscreteInputs()
11+
12+
if name == "SubestacaoEletrica":
13+
pv_voltage = regs.getValue(0)
14+
sp_voltage = regs.getValue(1)
15+
pv_load = regs.getValue(5)
16+
sp_load = regs.getValue(6)
17+
18+
high_v = 1 if pv_voltage > (sp_voltage + 12) else 0
19+
low_v = 1 if pv_voltage < (sp_voltage - 12) else 0
20+
overload = 1 if pv_load > sp_load else 0
21+
alarm_active = 1 if (high_v or low_v or overload) else 0
22+
23+
coils.setValue(2, high_v)
24+
coils.setValue(3, low_v)
25+
coils.setValue(4, overload)
26+
inputs.setValue(1, alarm_active)
27+
28+
elif name == "CentrifugaLinhaA":
29+
pv_vib = regs.getValue(2)
30+
sp_vib = regs.getValue(3)
31+
pv_temp = regs.getValue(4)
32+
sp_temp = regs.getValue(5)
33+
rpm = regs.getValue(0)
34+
sp_rpm = regs.getValue(1)
35+
36+
vib_alarm = 1 if pv_vib > sp_vib else 0
37+
temp_alarm = 1 if pv_temp > sp_temp else 0
38+
rpm_alarm = 1 if abs(rpm - sp_rpm) > 250 else 0
39+
alarm_active = 1 if (vib_alarm or temp_alarm or rpm_alarm) else 0
40+
41+
coils.setValue(2, vib_alarm)
42+
coils.setValue(3, temp_alarm)
43+
inputs.setValue(1, alarm_active)
44+
45+
elif name == "DigestorPolpa":
46+
pv_temp = regs.getValue(0)
47+
sp_temp = regs.getValue(1)
48+
pv_press = regs.getValue(2)
49+
sp_press = regs.getValue(3)
50+
pv_level = regs.getValue(4)
51+
sp_level = regs.getValue(5)
52+
53+
temp_alarm = 1 if abs(pv_temp - sp_temp) > 8 else 0
54+
press_alarm = 1 if abs(pv_press - sp_press) > 2 else 0
55+
level_alarm = 1 if abs(pv_level - sp_level) > 12 else 0
56+
alarm_active = 1 if (temp_alarm or press_alarm or level_alarm) else 0
57+
58+
coils.setValue(2, temp_alarm)
59+
coils.setValue(3, press_alarm)
60+
inputs.setValue(1, alarm_active)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Restaura setpoints operacionais padrao da planta didatica.
2+
3+
for slave in ModbusPal.getModbusSlaves():
4+
if slave is None:
5+
continue
6+
7+
name = slave.getName()
8+
regs = slave.getHoldingRegisters()
9+
coils = slave.getCoils()
10+
11+
if name == "SubestacaoEletrica":
12+
regs.setValue(1, 400) # SP_Voltage
13+
regs.setValue(6, 900) # SP_LoadLimit
14+
coils.setValue(0, 1) # Comando liga alimentacao
15+
coils.setValue(2, 0)
16+
coils.setValue(3, 0)
17+
coils.setValue(4, 0)
18+
19+
elif name == "CentrifugaLinhaA":
20+
regs.setValue(1, 5500) # SP_RPM
21+
regs.setValue(3, 25) # SP_VibrationMax
22+
regs.setValue(5, 95) # SP_TemperatureMax
23+
coils.setValue(0, 1) # Motor enable
24+
coils.setValue(1, 0) # ESD reset
25+
coils.setValue(2, 0)
26+
coils.setValue(3, 0)
27+
28+
elif name == "DigestorPolpa":
29+
regs.setValue(1, 172) # SP_Temperature
30+
regs.setValue(3, 8) # SP_Pressure
31+
regs.setValue(5, 70) # SP_Level
32+
coils.setValue(0, 1) # Feed pump enable
33+
coils.setValue(1, 1) # Steam valve enable
34+
coils.setValue(2, 0)
35+
coils.setValue(3, 0)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Inicia todas as automacoes configuradas no projeto carregado.
2+
3+
for automation in ModbusPal.getAutomations():
4+
automation.start()
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
from modbuspal.main import ModbusPal
1+
# Variavel ModbusPal = projeto atual (injetada pelo ScriptRunner).
2+
# Nao usar: from modbuspal.main import ModbusPal
23

3-
# Get the list of all automations in the project
4-
list = ModbusPal.getAutomations();
5-
6-
# Start every automation in the list
7-
for automation in list:
8-
automation.start();
4+
for automation in ModbusPal.getAutomations():
5+
automation.start()

0 commit comments

Comments
 (0)