LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Button press delay for Uart Read

Hi Folks.

 

I am having reading the aerial port at the right time. I am using visa write and read and they work fine, the problem is the time visa read is implemented.

 

I have to buttons that send commands 'c' and 'd'. When either of these buttons are pressed there is a reply from my external device. I want to read this reply in labview, however the read is implemented at the exact same time as write and reads the previous response. I initially had a read serial button which worked fine as I manually pressed it after I sent the command. I want it to be read automatically after I send either commands and used the OR gate setup. I am trying to have a delay so it has time to recieve it. The problem is using the delay as shown in my VI it reads it ok but then the value dissapears. I want it to stay. Is there an easier way for there to be a wait before read is implemented. I tried adding delays to the read structure but that just slows the response and still gives the previous respond.

 

This surely must be a simple fix but is prooving to be quite troubloesome.

 

Thanks,

 

Mark.

0 Kudos
Message 1 of 3
(2,544 Views)

I recommend changing your architecture.  Use an Event Structure.  This will allow you to respond to the events of the user pressing your buttons.  You can also set up a timeout for the read.  So you should be constantly reading the data.  If you still feel like you are getting "old" data, lower your timeout so that the reads happen more often.


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 2 of 3
(2,519 Views)

Thanks for the reply crossruiz. As a newbie to labview this is something I will have to learn more about.

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