mateus3
I'm trying to use open plc (windows version) to control three slaves running the esp8266 firmware. I managed to get them working separately, but when the second device connects to the network, one of them stops updating the analog output. I tried using another esp8266 and an esp32 with a modified version of the firmware, but the problem is the same.
The device that keeps working is always the first one added to open plc, and if it is disconnected the next starts working imediately.
I also installed the open plc in another computer and compiled another code in the editor but the same thing happened.
Quote 0 0
thiagoralves
Last time I checked it was working with multiple esp devices. Can you please send your configuration screen for each esp and the dashboard logs when OpenPLC is running please?
Quote 0 0
thiagoralves
Also, is this happening only on the analog output? Are the other inputs/outputs working fine? Can you share your ladder logic program as well?
Quote 0 0
mateus3
open plc.png 
Quote 0 0
mateus3
All the inputs are correct in serial monitor. I will check digital output.
Quote 0 0
mateus3
esp1.png  esp2.png 
Quote 0 0
mateus3
OpenPLC Runtime starting...
Interactive Server: Listening on port 43628
Device 1 is disconnected. Attempting to reconnect...
Warning: Persistent Storage file not found
Connected to MB device 1
Device 2 is disconnected. Attempting to reconnect...
Connected to MB device 2
Issued start_modbus() command to start on port: 502
Server: Listening on port 502
Server: waiting for new client...
Issued start_dnp3() command to start on port: 20000
Issued start_enip() command to start on port: 44818
Server: Listening on port 44818
Server: waiting for new client...
Issued stop_pstorage() command

Only device 1 is working now.
Quote 0 0
thiagoralves
From your program it is hard to know if the problem is in the analog input or analog output. Instead of wiring the AI on the AO, wire a constant variable of 32768 (just write 32768 in the expression field of the variable) to the AO which is exactly 50% power out. Do that for both outputs and check if they are active at the same time. Also, test the outputs on both slave devices at the same time, by creating an oscillator for each pin or something like that (there are examples of oscillators in this forum. Just use the search button).

From the dashboard logs, it seems that both slave devices are connected and working fine
Quote 0 0
mateus3
With the constant variables as inputs, both the LEDs turn on. Device 1 imediately, and device 2 some seconds later. Using the oscilator with only one device connected, it flashes at random times (7-10 seconds). If device 2 is connected, LED 1 flashes every 1 second, as it should do. LED 2 doesn't light.
Quote 0 0
thiagoralves
It looks like there is some weird latency on your network. Are you getting error messages about slave devices being disconnected on the dashboard after a few minutes?
Quote 0 0
mateus3
The delay was caused by the attempts to communicate with disconnected device. If I remove device 2 from the list the first works faster.
Quote 0 0
thiagoralves
But is the device really being disconnected? Can you see messages on the logs about the device being disconnected? I don’t see it in the logs you sent first
Quote 0 0
thiagoralves
Also, try increasing the polling rate of the slave devices on Settings to see if it improves something. Maybe your router or firewall is blocking some of those packets to control the network latency. Try something like 500ms for polling rate
Quote 0 0
mateus3
No. Device 2 is connected, but doesn't update the value of the outputs. When I disconected the cable of device 1, the second started to work, with a delay, because the program was trying to find device 1.
Quote 0 0
mateus3
Also, try increasing the polling rate of the slave devices on Settings to see if it improves something. Maybe your router or firewall is blocking some of those packets to control the network latency. Try something like 500ms for polling rate


Thanks. It worked with 2 devices with the oscillator program. I'll try add the third.
Quote 0 0