How Can We Help?
How to use an ACE PLC as digital and analog inputs/outputs with a RaspBerry PI or Arduino?
ACE PLCs can be connected to a RaspBerry PI or Arduino via their USB ports
ACE controllers are mainly used in the industrial field on small industrial machines.
However, in view of its performance, ease of use and price, it is often used for other applications with Raspberry or Arduino.
Raspberry Pi Modbus Master on USB host port |
Arduino Modbus Master on USB host Shield port |
Link | ACE PLC 5-30 VDC digital inputs/outputs 0-5-10 VDC / 4-20 mA analog inputs/outputs Modbus slave on Mini-USB slave port |
*Only ACE with analog outputs can’t be powered via USB |
Digital & analog inputs/outputs |
All ACE PLCs have a mini-USB Modbus slave port. In addition, ACE PLCs can be powered by their USB port.
The RaspBerry and Arduino can power the ACE via their USB port and as Modbus master they can read and write all inputs/outputs of the ACE PLCs.
For that, you must:
- have an ACE PLC of your choice: https://aceautomation.eu/micro-plc-hmi-touch-panel-stepper-motor-brushless-shop/
- have an RaspBerry or Arduino
- have an USB-A to Min-USB cable: https://aceautomation.eu/product/ace-plc-programming-cable-1-8-m-for-all-ace-eace/
- install the Modbus Master protocole on your device
A web ressource for install Modbus Master RTU on a RaspBerry or Ardruino
- MinimalModbus, easy-to-use Modbus RTU implementation for Python
You will find a lot of web ressources about Modbus Master RTU for RaspBerry PI or Arduino
Example of the configuration of an ACE PLC for reading and writing data in Modbus
First, create this simple program with vBuilder:
|
|
|
|
|
For to be able to write in these tags from the Modbus master, you must make them editable. For BitToWrite and WordToWrite
Add all tags to the Modbus table
Now, you can upload your program:
- Upload the program
- Run the program
And now, you can:
- Read the BitToRead tag at the address 0 with the Modbus function code 01
- Read the WordToRead tag at the address 0 with the Modbus function code 03
- Write the BitToWrite tag at the address 1 with the Modbus function code 05
- Write the WordToWrite tag at the address 1 with the Modbus function code 06
How does this configuration work?
- the state of BitToWrite change the OutBitD1 output of your ACE
- the InBitC1 PLC input of your ACE change the BitToRead tag
- WordToWrite = WordToRead