LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

visa issues

Hello,

 

i have a vi that has 25 'draw oval's' in the bolck diagram , this is interfaced with a microcontroller via RS232. The microcontroller is sending data continiousl. when I run the VI There is a big delay in reception by thhe draw oval vi's . WHen I used the same vi but with simple booleans (Leds) instead iof draw oval it works fine. All I am trying to do is read three bytes of data , creat an image (any format) and then save them in a directory. Attached is the VI (downconverted to 2012v) that I am having problems in when run through VISA. ANy help will be appreciated.

 

Regards

0 Kudos
Message 1 of 7
(2,852 Views)

Get rid of the Bytes variable

 

try reading the amount of bytes available,

visa_read.png

 

Maybe you can make a 2nd parallel loop for reading VISA data & handle the processing in your current loop.

 

Good luck!

0 Kudos
Message 2 of 7
(2,835 Views)

Hi,

I tried adding the bytes at port vi and it still dintwork.Do you have any othter suggestions?

0 Kudos
Message 3 of 7
(2,821 Views)

You have a 50ms delay in your while loop which is fairly ok. 

 

But I think your  " draw ovals " take more than 50ms to process, making your while loop very slow.  

 

Because you are blocking your Visa-Read with the draw Ovals, your RX-buffer might overrun.  I propose to take the Visa Read into a 2nd parallel while loop so you are sure about capturing all your rx-data while drawing your ovals. Then you can draw your ovals with the acquired data and see how much time it takes and why you can not 'process' all your incoming data.

 

Try optimizing your code to have it work faster!  -> Check how long it takes to draw 1 oval.

 

Good Luck

0 Kudos
Message 4 of 7
(2,812 Views)

thanksf for your reply. by 2nd while loop do you mean Producer/consumer technique? If yes then Can u give me some key tips to work on it.

Greatlyappreciate your concern

0 Kudos
Message 5 of 7
(2,809 Views)

Please do not create duplicate threads: visa with png images


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
0 Kudos
Message 6 of 7
(2,807 Views)

@naserkhan wrote:

thanksf for your reply. by 2nd while loop do you mean Producer/consumer technique? If yes then Can u give me some key tips to work on it.

Greatlyappreciate your concern


Producer/Consumer


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
0 Kudos
Message 7 of 7
(2,805 Views)