From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-15-2013 11:30 AM
Hi,
I need to read a position from a control unit device continuously or even by click a button, for this I have to put "visa configure serial port" and" "visa close" inside a while loop. Dose it make any problem?
07-15-2013 11:34 AM
It could slow down your code. It could cause you to miss bytes while the port is closed depending on how you are handling the serial communication overall.
Why do you "have to put" them in the loop?
It might work just fine, or it might cause problems. I wouldn't recommend it.
07-15-2013 11:45 AM
Thanks for reply,
If I don't put inside the loop, the position reading comes with delay and I have to click several time the button to shows the correct value!!!
07-15-2013 11:51 AM
Then something must be wrong with your code.
You need to post your VI so we can look at it.
07-15-2013 12:19 PM
Sounds like a "Flush buffer" before each read is needed to get rid of "Old" data being "Spewed Asynchronously" from the device on the other end.
What is the device? (Make/Model)
07-15-2013 12:29 PM
The programs are attached for continues reading and by clicking.
The device is a Control unit for antenna.
07-15-2013 12:32 PM
Sorry...It seems the attachments are not readable I will attaché them again.
07-15-2013 12:33 PM
Attach the .vi, not pictures.
/Y
07-15-2013 01:03 PM
I attached the vi,
07-15-2013 01:25 PM
You shouldn't need the VISA Event nodes. Get rid of those.
Why are you using Concatinate String just to build up a constant. Just create a single string constant. It is a lot cleaner.
Is the antenna constantly sending data to you or only when you request it?