- AuthorPosts
Good day.
I am trying to use Stone HMI as input to Arduino Mega 2560 to turn on/off some relays. However, I am unable to do so. I hope someone here can help me figure out and resolve this problem.
Here is my hardware connection:
First, I removed the solder on Stone HMI’s J17 to convert it to TTL.
Then, I cut the other end of the white wire-harness and connected it to the Arduino. The photo below shows the complete wiring configuration. Please refer to the color code for the wiring:
I’ve attached the Arduino firmware code for your review, as well as the VT set folder zip file for the GUI. Am I missing a line of code here or library?
I used the settings below for the buttons:
Button 1:
Button 2:
Button 3:
Thank you in advance to those who will help.
Looking forward to hear from you. 🙂
Attachments:
You must be logged in to view attached files.Hi, I looked at your GUI and I noticed that the three Button key value return controls you created have the same variable address, which is theoretically not possible. You can try to change them to different addresses and modify the code accordingly, if you still have problems please feel free to come to me.
Hi bancroft,
Thank you for your reply.
I actually used the project below (which is listed on this website as Arduino x Stone HMI sample project) as reference: https://www.electroniclinic.com/arduino-hmi-tft-lcd-module-electrical-load-controller/
The GUI values and the source code was based on this too. The values set on the GUI (variable memory address, key hex return values) are not written anywhere on the Arduino source code. Hope you can help me review that one too. Thanks alot! 🙂
Our screens have our own instruction set, and our official website has our instruction set manual that you can read and get familiar with how to use.
https://www.stoneitech.com/media/upload/LargeFile/TOOL2019-User-Development-Guide-200327.pdf

When you open the serial port tool and click the button key value return, you will see the following message.

When you are writing the code simply write like this(The code here is from my other projects and you can replace it as needed):

First, at the very beginning, the instruction of sending or reading is defined as 0, and the instruction is read in the loop, only one bit can be read at a time, so how many instructions are there, just do several loops to read all instructions.
After that, just use Serial. write() to write.
- AuthorPosts
- You must be logged in to reply to this topic.