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.
04-27-2015 04:34 AM - edited 04-27-2015 04:37 AM
Hi everyone. I need your help with my program. I am using LabView2014 and an Agilent B2902A.
I want to measure current value with my instrument continuously, store values every second and display messages received through the serial port when I get some.
Everything works perfectly separately but when I put everything together I have this problem: my instrument is waiting for a message from the serial port to take (and display) a measure.
Do you have any idea to save my problem?
Thank you !
Pauline
(Please find attached a screenshot of my program)
Solved! Go to Solution.
04-27-2015 04:44 AM
04-27-2015 05:05 AM
@Albert.Geven, thanks for the fast reply.
I don't know how to test if there is a message before reading. Could you give me more details to do it?
04-27-2015 07:06 AM
@Oxydroid wrote:
@Albert.Geven, thanks for the fast reply.
I don't know how to test if there is a message before reading. Could you give me more details to do it?
Use the Bytes At Port property and test to see if there are more than 0 bytes available (Greater Than 0?). Use a case structure to conditionally read the serial port.
04-27-2015 07:56 AM
@crossrulz and Albert.Geven
I tried it as you can see on the new screenshot attached to this message but it is not working better... Maybe I did it wrong?
04-27-2015 08:00 AM
@Oxydroid wrote:
@crossrulz and Albert.Geven
I tried it as you can see on the new screenshot attached to this message but it is not working better... Maybe I did it wrong?
Post your VI not a screenshot
04-27-2015 08:42 AM
04-27-2015 08:56 AM
04-27-2015 09:29 AM
@Albert.Geven wrote:
You only should read when bytes at port>= bytes to read
because if the message is not completely available it will block the other process
My thought on that is that if there is data there, the rest of the message will be there shortly. There may be a brief blocking, but not likely enough to matter, depending on how long your message really is.
04-27-2015 09:32 AM - edited 04-27-2015 09:35 AM
Thanks to all of you, I solved my problem. First, it was what you said (test to read only if there is a message available) and then it was that my excel file was full (I guess so because it didn't want to store my variables anymore and block the all process).
Next time, I will send the VI and not screenshot as you asked.