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-22-2020 01:14 PM
Hey guys, how's it going?
I am currently working with a Mensor CPC 6000 (pressure calibrator). I am using the format Open connection>Write Command>Read bytes at port > Read Buffer, but the problem I am facing is that if I don't place a wait command in between the "VISA Write" and "VISA Read", LabView can't really read the buffer (it will show a random message or an empty string).
The problem with using the wait VI is that I am using multiple of these commands sequentially, and it is starting to take a long time to execute them (wait after wait...), so I wanted to take the wait out. For clarification, the hardware receives the command fine (even without the Wait command), but I just can't read the buffer return.
Is this a known issue to anyone? Is there any solution or will I have to stick with a slow execution?
I have attached 2 pictures below, one showing the Wait command (which I can read the buffer) and one without (I cannot read the buffer) so you know what I am talking about.
Thank you.
07-22-2020 01:35 PM
DO NOT USE THE BYTES AT PORT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (still not enough emphasis)
1. Make sure you have the termination character enabled. If using the VISA Configure Serial Port, it is the default.
2. Remove the wait, clear buffer, and the Bytes At Port. Just tell the VISA Read to read more data than you expect in a message. In this case, I would probably use 50.
So what this will do is make the VISA Read read data until the termination character is read, ensuring you have a complete message.
For more information, go watch this: VIWeek 2020/Proper way to communicate over serial
07-22-2020 01:42 PM
I guess, you'll need wait, but you want to save some milliseconds, instead of fixed 300ms, you can poll for # of bytes in a loop.
On a separate line, don't we want to move the 'VISA Flush I/O Buffer' before sending command to the instrument.
07-22-2020 01:57 PM
@scofield wrote:
I guess, you'll need wait, but you want to save some milliseconds, instead of fixed 300ms, you can poll for # of bytes in a loop.
No No No.
With a proper protocol, you'll never need to poll for the number of bytes.
07-22-2020 02:07 PM
@RavensFan wrote:
@scofield wrote:
I guess, you'll need wait, but you want to save some milliseconds, instead of fixed 300ms, you can poll for # of bytes in a loop.
No No No.
Just because RavensFan did not have enough emphasis...
NO NO NO NO NO NO NO NO!!!
Again, go watch this: VIWeek 2020/Proper way to communicate over serial
07-22-2020 11:23 PM
Ugh. Proper use of VISA read and write and you can have zero extra milliseconds of wait.
07-23-2020 06:23 AM
What RavensFan, crossrulz, and billko all said.