
rjd1234 (Customer) asked a question.
I'm trying to use an Arduino Nano to collect GPS speed data and then read that data on the Click PLC.
Equipment:
GPS module: GT-U7
Arduino Nano with a screw terminal breakout board
RS-485 module (MAX485 TTL to RS485)
Click Plus (C2-03CPU)
Arduino Nano Wiring:
Pins 10/11 --> GPS Module
Pin 7 --> DE and RE of MAX485 Module
Pin 8 --> RO of MAX485 Module
Pin 9 --> DI of MAX485 Module
Click Plus Wiring:
Port 3 (RS-485) + --> A of MAX485 Module
Port 3 (RS-485) - --> B of MAX485 Module
Using the Arduino Serial Monitor I am able to generate decent speed data. The issue is getting that data into the Click.
I have followed the example by Garry at ACC Automation (https://accautomation.ca/click-to-click-plc-communication-remote-io/) The sending instructions have the success flag staying on, but the receive instructions flash between sending and error.
In this article (https://circuitdigest.com/microcontroller-projects/rs485-modbus-serial-communication-using-arduino-uno-as-slave) the author uses the same MAX485 module to communicate using a PC as the master and an Arduino Uno as the slave.
I'm hoping someone has experience with these type of communications and will be able tell what I am doing wrong.
Thanks,
Rick
What is your hardware setup for the CLICK Ladder project that is attached? That example is for communicating between two CLICK PLCs. Is that what you are testing? Or are you testing that Ladder while connected to the Arduino?
The CLICK Project is setup for Modbus addresses which do not exist in your Arduino INO project. You will need to use the "modbus.configure()" functions to define the addresses which you want to make available to the modbus connection.
Can you start with just the ModbusRTUSlaveExample and a CLICK project Reading 400001. If this is successful then the hardware is proven and you can move onto how you want to layout your Modbus map.
OK... I was finally able to get these to communicate by abandoning the SoftwareSerial for the modbus and just using the TX and RX pins on the Nano. After debugging using QModBus software and the USB to RS485 converter, it was easy to connect to the Click PLC. Thank you for the direction... It got me looking in the right places.
Here is the code I'm running now if anyone is interested: