jaintapauljp
I am new to OpenPLC. I am using two raspberry PI4s - each connected to a set of sensors and actuators. Two of the PI-2 receives signals from each other via network connection. See the following psm python code
 
 
client = ModbusClient(ip, port=502)
client.connect()
while True:
client.read_coil(6, True)


My questions are ,

1. How the PIs communicate with the sensors and actuators? Are they modbus protocols too?

2. Does two of the ctrl logics for PI-1 and PI-2 run parallelly or sequentially?

3. In the above scenario, does the PIs communicate with each other in a sequential manner?
 
Reply 0 0
thiagoralves
1. PLCs in general don’t communicate with sensors and actuators. They just read signals (voltage, current) and generate signals (voltage, current). Specifically on the Pi, that comes from the GPIO pins, which are all digital only - which means you can only read or generate true/false signals meaning something is either ON or OFF.
 
2. Since they are on completely separate devices, the logic run in parallel.
 
3. No. PSM runs on a separate thread which is not tied to the PLC scan cycle timings. Besides, your PSM code is not very wise. You shouldn’t stuck it in an infinite loop like that. If you just want to read / write coils from each other you should use the slave device feature instead. Add one Pi as a slave device of the other
Reply 1 0
Reply