LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

synchronise microcontroller and labview Visa Serial

Solved!
Go to solution

Hi,

 

I have a small problem regarding my labVIEW VI. I am doing following things:

  1. I am sending 7 data from microcontroller to Labview as string (ASCII characters) at a time interval of 31.45mS.
  2. In labview, I read the string with delay of 32 mS.
  3. I extract the individual data from string and then get the substring.
  4. I use string to number converter to convert the number.
  5. Finally I display the data.

 

The problem I am having is that when the bytes read (at Property Node) is less than 4000, the data read is perfect. But once the bytes at port reaches 4000, the data I get has periodic zeros. I think that the problem is with synchronisation of sending of data from microcontroller with the LabView. I dont know what to do with it. Could someone please advise me regarding it?

 

Thanks in Advance

 

Regards

0 Kudos
Message 1 of 3
(2,246 Views)
Solution
Accepted by topic author SrisTik

You are only reading 49 bytes at a time.  You are telling me that your buffer is getting larger than 4000 bytes?  That tells me you have a major timing issue.

 

If you will always get 49 bytes per message, then just read 49 bytes.  Get rid of the delay and the Bytes at Port.  They are usless.  And since you are also using a termination character, that makes them even more useless.  The VISA Read will wait up to the timeout for the number of bytes you told it or a termination character is recieved.  If you are truely using a termination character, I would even set the bytes to read to something totally outrageous, like 500.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 3
(2,230 Views)

Hi,

 

Thanks a lot for showing me my mistake. Really appreciate it.

 

Regards,

Sris

0 Kudos
Message 3 of 3
(2,185 Views)