PAJ27
Hi
 
I created a test file and uploaded it to the Pico W - it works as expected.
 
I then select to Debug, by enabling Modbus RTU, interface to Serial 1, Slave ID to 1 - with that same file after a build attempt it comes back and it says "Connection Error" - Could not verify with target: Opening COM20: File not found.
 
I tried each of Serial Interfaces within the Modbus RTU, but the same error
 
It's been a while since I last use the Pico W with v4 - had the same issues then
 
Why ?
Reply 0 0
thiagoralves
Make sure your Pico is truly connected to COM20 on your computer and that it is not being used by any other program on your computer
Reply 0 0
PAJ27
Yes it is Truly connected, its the only COM port available, no other Com's it occuring.
 
I also get the same error with Modbus TCP
 
I'm using Win11
Reply 0 0
PAJ27
I do get get back a different message with the TCP configuration
Reply 0 0
thiagoralves
What is the configuration of your device on the device configuration screen?
Reply 0 0
PAJ27
Further investigation
  1. Ok - just cancelled the DHCP, manually configured it, also changed the scan to 1ms - I and can now use the Modbus RTU and also Modbus TCP.
 
  1. I then, changed the scan time back to 10mS - closed down OPENPlc, powered down the Pico W, also removing the usb connection.
 
  1. Started everything up, noting that the Communication Port was blank and refreshing does nothing, except displaying the "STOP Traffic sign" - regardless of that I was able to upload the revised program with 10mS scan, could use RTU debug, but not TCP
 
  1. Again changed the scan to 1mS.
 
Upload the revision (1mS) and I can use both Modbus communication protocols.
 
Does that help ?
Reply 0 0
thiagoralves
With DHCP you need to know what is the IP your board is getting, and that get be tricky. Static IP is usually easier to setup.
 
As for changing ms for your program, I have no idea. It all depends on what your program does, which I don’t know.
Reply 0 0
PAJ27
With DHCP you need to know what is the IP your board is getting, and that get be tricky. Static IP is usually easier to setup.
 
As for changing ms for your program, I have no idea. It all depends on what your program does, which I don’t know.
Uhm, my point is - in order to get the Modbus to work consistently - the scan time needed to be 1mS for both - FYI the only changes made to the PLC code, was the scan times - between the instances stated
 
The program was this
 
latch.png
Reply 0 0
thiagoralves
The thing about changing scan cycle time is that it can effectively starve comms depending on what your program does. If you can share your full project I can try taking a look later to see what could be going on there.
Reply 0 0
PAJ27
Yeap - I get that.
 
Here is the Project
Reply 0 0
PAJ27
Any news on this ?
Reply 0 0
FutureHorizon
1ms seems very fast. It might be difficult to get that working great.
Have you tried setting your gateway to 0.0.0.0 or ping the device?
Reply 0 0
Reply