I have a setup that controls the rotation of two stepper motor using Arduino UNO, HBS860H stepper drivers, 4X4 keypad and LCD screen. I have replaced the Arduino Uno by a Controllino Mega and it works good. Now I am trying to replace the Keypad and LCD screen by a FATEK HMI PN2043NK. I have the sketch for the Controllino, I can use RS485 to communicate both devices. I use FV Designer to program the HMI, but I don't understand how to run the sketch from the HMI. I need some help with a simple example Please, any help I could use to start learning to communicate the HMI with the Controllino and run the steppers will be welcome.

  • I am unfamiliar with those devices, but I would assume you write software for both which uses RS485 to send messages between them. It'll be up to you what those messages are and what they mean, and how you respond to them.
    – Majenko
    Apr 9 '20 at 9:54

The usual "sketch" is "always" running on your arduino (Controllino) unless it is put into a non-run mode (like when loading a program) or doesn't have power. What you need in your sketch is to do something IF a command is received on the serial (RS485). Rather than simply running the command you want, the sketch needs to check the serial and only execute the command if the HMI sent the correct signal.

For motor control, you could use G-code where your HMI sends G-code move commands over RS485 and your Controllino executes them. A handy RS232 example is grbl.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.