‎08-06-2014 11:49 AM
‎08-06-2014 12:06 PM
I wouldn't use a termination character. Since you are sending binary data, it is just as likely that the termination character could show up in your data bytes. Why are you reading 6 bytes and only using the last 3?
I would set the protocol with your device so that you Write a command and then receive a response rather than just continually looking for responses. That is where you risk getting inaccurater responses because you happened to open the the serial port in the middle of an unsolicited message being sent.
You probably could and should use a marker byte to help identify where a packet of data might end. Add a 7th byte. Make sure that the byte shows up where you expect it. If you don't, then you know you have a misaligned packet of data. If you do, it doesn't guarantee everything is perfect because it is a chance that byte shows up as part of the data, but it helps prevent some communication errors. You could also use some sort of checksum to help determine your packet of data is correct.
‎08-06-2014 12:27 PM
‎08-06-2014 01:28 PM
I will sent 27 byte Data to VI in future and use This bytes seperately. for example First three byte will use for check system and other 24 byte will use for graph. each 3 byte shows in one Graph. it was a review of future Design. because of this situation, I must take 3 byte and show it in a Graph.
Data send from MCU to LabVIEW continueslly, and in this step, LabVIEW interface doesn't an Data to MCU.
in meanwhile I must say again that LabVIEW read Data accurate in few moment but crash in continue alothough MCU send Data but LabVIEW doesn't read any data. when I stop LabVIEW VI, and run it in continueslly mode VISA don't work and I should restart every thing like MCU, LabVIEw and other stuff.
‎08-06-2014 11:40 PM
if I use LabVIEW with ascii code and control character is better than sendig hex and using of byte as port ?
‎08-07-2014 12:10 AM
@ajapyy wrote:
if I use LabVIEW with ascii code and control character is better than sendig hex and using of byte as port ?
...But you're not SENDING anything...
‎08-07-2014 01:23 AM
yes , you right. but I don't want send anything from LabVIEW to MCU. in this level I want read data with LabVIEW and figure it in the Chart.
but LabVIEW suddenly stop working and however run continually is active, I don't see anything in chart !!
‎08-07-2014 07:09 AM
Why are you using "run continuously" when you already have a while loop? In fact, WHY ARE YOU USING IT AT ALL??? That's a troubleshooting tool. Which, unfortunately, is in a very obvious place next to the run button.
Always, always make it so your VI is doing the looping, not the button. If I remember correctly, LV will close and open resources each time it reiterates with the "run continuously" button, your incoming messages may be getting cut off right in the middle.
‎08-07-2014 07:44 AM
I want read Data from MCU that send Data each time. in MCU I send Data until determined time and because of this point I use run continusly in LV.
I test LV code. it stop reading data or other problem that cause read buffer and chart doesn't show anything.
‎08-07-2014 08:07 AM
@ajapyy wrote:
I want read Data from MCU that send Data each time. in MCU I send Data until determined time and because of this point I use run continusly in LV.
I test LV code. it stop reading data or other problem that cause read buffer and chart doesn't show anything.
You did read my last post, right? I'm gonna poke you in the eye...