02-18-2015 03:31 AM
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.
02-18-2015 06:14 AM
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.
02-18-2015 07:24 AM
Thanks for the reply crossruiz. As a newbie to labview this is something I will have to learn more about.