How Can We Help?

Print

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
(+ powerfull PLC)

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:

A web ressource for install Modbus Master RTU on a RaspBerry or Ardruino

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:

  • InBitC1 is an existing physical input of your ACE
    • used for change the state of BitToRead
  • BitToRead is a new internal bit of your ACE
  • BitToWrite is a new internal bit of your ACE
    • used for change the state of OutBitD1
  • OutBitD1 is an existing physical output of your ACE
  • WordToWrite is a new internal UI16 word of your ACE
    • used for change the state of WordToRead
  • WordToRead is a new internal UI16 word of your ACE

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:

  1.  Upload the program
  2.  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
  • WordToWriteWordToRead