11-19-2017 07:45 AM
hi
I am using visa to receive some data from a microcontroller (AVR) , but between send a string by AVR and receive it by Labview have a very big delay. (sending of data by AVR === no delay & receiving by Labview ==== very big delay) . what is the problem???
thanks
11-19-2017 08:25 AM
What is the format of your data? In 99.9% of applications, you should NOT be using the Bytes At Port in order to figure how many bytes to read. It can cause weird race conditions. There are likely better ways, but it depends on the data format.
11-19-2017 10:02 AM
my data type is a string (length about 6-10 character) what I can use instead of "byte at port" ???
thanks
11-19-2017 01:29 PM
@tehrancontrol.com wrote:
my data type is a string (length about 6-10 character) what I can use instead of "byte at port" ???
Coming from VISA it is a string. What I was asking was how is your actual data stored inside of that string and then sent. Is it an ASCII string so you can understand it when you open it up in a text editor? Does the message always end with a termination character, typically a Line Feed (0xA, LF)?
11-19-2017 10:13 PM
No , it don't finish with line feed .
String that I receive with Labview is " = 1020 " Or " = 198 "
11-20-2017 05:40 AM
Do you have the ability to change the instrument? Because that is a really stupid way to send the data. How is somebody supposed to know the whole message was received unless there is a character to state that the message is complete? Or is the message always the same number of bytes? This would be an acceptable alternative.
11-20-2017 08:20 AM
I would also recommend a line feed at the end of each message. This makes your communication protocol much more expandable.
Additionally, you could test the serial line using the simple serial example:
Help>>Find Examples... --> Hardware Input and Output>>Serial>>Simple Serial.vi
If that program is also communicating slowly, the issue is likely coming from your MC, PC, etc. and not LabVIEW. If it's not, then the delay is probably coming from something in your LabVIEW code.