chriszhou
I didn't find anything about it in the documentation
Reply 0 0
thiagoralves
Good point, I forgot to update the documentation with that. But in any case, on the upload dialog, if you click on the I/O Config menu you will see the pinout list:
 
Screen Shot 2024-06-05 at 7.47.30 AM.png
 
These pins are in the sequential PLC addressing order. For example, pin 6 is %IX0.0 (first digital input), pin 7 is %IX0.1, pin 8 is %IX0.2...
Same goes for digital outputs (pin 14 is %QX0.0, pin 15 is %QX0.1...) analog inputs and analog outputs. You can change this list at will as well if you want to rearrange the pinouts on the Pico. Just remember to click on "Save Changes" before uploading. If you mess things up, click on "Restore Defaults" and the pinout will come back to the default values.
Reply 1 0
chriszhou
Good point, I forgot to update the documentation with that. But in any case, on the upload dialog, if you click on the I/O Config menu you will see the pinout list:
 
Screen Shot 2024-06-05 at 7.47.30 AM.png
 
These pins are in the sequential PLC addressing order. For example, pin 6 is %IX0.0 (first digital input), pin 7 is %IX0.1, pin 8 is %IX0.2...
Same goes for digital outputs (pin 14 is %QX0.0, pin 15 is %QX0.1...) analog inputs and analog outputs. You can change this list at will as well if you want to rearrange the pinouts on the Pico. Just remember to click on "Save Changes" before uploading. If you mess things up, click on "Restore Defaults" and the pinout will come back to the default values.
Is raspberry pi pico now ready to run as a PLC? Or as before, it can only be used as an IO slave device
Reply 0 0
thiagoralves
All devices in that list (from Arduino UNO to ESP32) can run standalone as a PLC, with Modbus, live monitoring, etc.
Reply 1 0
chriszhou
All devices in that list (from Arduino UNO to ESP32) can run standalone as a PLC, with Modbus, live monitoring, etc.
This is a remarkable and useful progress! Previously, I saw a document on the old OpenPLC website stating that MCU devices such as ESP8266 can only be used as slave devices.
Thank you very much for your answer. I see that the community is active
Reply 0 0
thiagoralves
This was true in 2020, 4 years ago. Make sure you're reading up to date information on the Autonomy website: https://autonomylogic.com . There are several old blog posts and fan-made websites that have information on OpenPLC that are inaccurate or just old. For some reason they are quite popular and Google put their results first... 😓
Reply 1 0
yonush
Good point, I forgot to update the documentation with that. But in any case, on the upload dialog, if you click on the I/O Config menu you will see the pinout list:
 
Screen Shot 2024-06-05 at 7.47.30 AM.png
 
These pins are in the sequential PLC addressing order. For example, pin 6 is %IX0.0 (first digital input), pin 7 is %IX0.1, pin 8 is %IX0.2...
Same goes for digital outputs (pin 14 is %QX0.0, pin 15 is %QX0.1...) analog inputs and analog outputs. You can change this list at will as well if you want to rearrange the pinouts on the Pico. Just remember to click on "Save Changes" before uploading. If you mess things up, click on "Restore Defaults" and the pinout will come back to the default values.
I created the original file for the Pico (editor\editor\arduino\src\hal\rp2040pico.cpp) as the previous one only worked for the Arduino nano connect. At the top of the file should give you the original pin to address mapping. I created this work for a Pico based PLC board for teaching purposes.
 
 
//OpenPLC HAL for Raspberry Pi Pico/Pico W with the RP2040
/******************PINOUT CONFIGURATION***********************
Digital In: 6, 7 ,8, 9, 10, 11, 12, 13 (%IX0.0 - %IX0.7)
Digital Out: 14, 15, 16, 17, 18, 19, 20, 21 (%QX0.0 - %QX0.7)
Analog In: A1, A2, A3 (26,27,28) (%IW0 - %IW2)
Analog Out: 4,5 (%QW0 - %QW1)
**************************************************************/
 
 
 
 
Reply 0 0
Reply