i need help to read hex data format
i have Dwin HMI touch screen i use it with arduino Uno
i succed to send data to HMI to control of it
but i cant understand how to deal with data send from HMI to Arduino
it is in Hex format like This
(0x5a 0xa5 0x06 0x83 0x00 0x01 0x01 0x00 0x02)
i bulid coode to send data to HMI and it works good
i want a Help
code in flowcode which can recive the data come from HMI and know it is real value to make desions in my program.
need help to read hex data format
-
- Posts: 2
- http://meble-kuchenne.info.pl
- Joined: Sat Oct 29, 2022 2:09 pm
- Has thanked: 2 times
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: need help to read hex data format
Hi
I looked at these displays a while back, probably around the time I started messing with Flowcode App Developer, and thought FAD would suit me better in that particular application.
I don't know which one you have, but you can use their software to create your own GUI etc. Connection to MCU was by serial port.
As far as I am aware, it sends an 8-byte frame (which you could capture using Terminal or PuTTY etc to look at). This frame would contain data that you preconfigured. By that I mean if you created a button on the GUI you would need to assign it an address and value(s) as you created it. When you press a button a frame corresponding to such would be sent to your MCU.
You will need to establish exactly what is being sent before you can look for it, i.e. know exactly what addresses are being used / sent etc
Once you know what you are looking for it is quite easy to capture. If you do a Flowcode WiKi search for Rx Interrupt and also Circular Buffer you will find examples of how to use these two very useful components to ensure you never miss any incoming signal. Once in the Circular Buffer it is quite easy to "look" for specific values and take action if found.
Hope this helps a little,
Regards
I looked at these displays a while back, probably around the time I started messing with Flowcode App Developer, and thought FAD would suit me better in that particular application.
I don't know which one you have, but you can use their software to create your own GUI etc. Connection to MCU was by serial port.
As far as I am aware, it sends an 8-byte frame (which you could capture using Terminal or PuTTY etc to look at). This frame would contain data that you preconfigured. By that I mean if you created a button on the GUI you would need to assign it an address and value(s) as you created it. When you press a button a frame corresponding to such would be sent to your MCU.
You will need to establish exactly what is being sent before you can look for it, i.e. know exactly what addresses are being used / sent etc
Once you know what you are looking for it is quite easy to capture. If you do a Flowcode WiKi search for Rx Interrupt and also Circular Buffer you will find examples of how to use these two very useful components to ensure you never miss any incoming signal. Once in the Circular Buffer it is quite easy to "look" for specific values and take action if found.
Hope this helps a little,
Regards
Re: need help to read hex data format
Hi,
Have you read the datasheet/instructions for the display. As Chipfryer said, normally the button, switch etc just send a value back which you determine. I would expect it to do the same as what you are doing to send data to it but in reverse.
Regards,
Bob
Have you read the datasheet/instructions for the display. As Chipfryer said, normally the button, switch etc just send a value back which you determine. I would expect it to do the same as what you are doing to send data to it but in reverse.
Regards,
Bob
-
- Posts: 2
- Joined: Sat Oct 29, 2022 2:09 pm
- Has thanked: 2 times
Re: need help to read hex data format
Thank you Dear
chipfryer27 , RGV250
you guide me on avery good way
i alrdy make GUI program in HMI and Know the data send format and value my problem was in how to recive it in my Arduino using Flowcode
i will study about Circular Buffer and give you feedback soon .
chipfryer27 , RGV250
you guide me on avery good way
i alrdy make GUI program in HMI and Know the data send format and value my problem was in how to recive it in my Arduino using Flowcode
i will study about Circular Buffer and give you feedback soon .
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: need help to read hex data format
Hi
If you use the Rx Interrupt feature, upon an incoming data stream it will automatically branch to an Interrupt Service Routine (a User Macro that you will create). This Macro should be as small as possible. In the Macro you could have for example
Rx Byte
Put Byte in Circular Buffer
The incoming data will now automatically populate the CB. In your Main program you can "look" for specific values in the CB and if found "do something". The WiKi has good examples.
Good luck.
If you use the Rx Interrupt feature, upon an incoming data stream it will automatically branch to an Interrupt Service Routine (a User Macro that you will create). This Macro should be as small as possible. In the Macro you could have for example
Rx Byte
Put Byte in Circular Buffer
The incoming data will now automatically populate the CB. In your Main program you can "look" for specific values in the CB and if found "do something". The WiKi has good examples.
Good luck.
-
- Posts: 1
- Joined: Tue Dec 10, 2024 3:15 pm
Re: need help to read hex data format
Bro i need help how to read data from dwin hmi using flow code