LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TSI Flow meter Visa read error 1073807339

Hello everyone,

 

I am trying to measure flow, pressure, and temperature with the TSI 4100 flowmeter which is connected to the computer. Here I attach two files:

Flow meter read vi is provided to me by my colleague who was using it (without knowing Labview) with the 2013 or 2014 version. The second file is the trail file I was trying to figure out the problem.

I can connect the device to the TSI direct software and the device communicates with that software smoothly so it doesn't look like a hardware error. Once the device is connected to the laptop with the right port, it clears the write command and property node command. But after that, there is an error. It could be a minor one or I don't know.

For your information, NI Visa drivers are already installed on the system. I hope this information helps. Let me know if more information is required.

I am new to LabVIEW and looking forward to your support. I hope I will get a solution. Thanks for your time.

 

Best,

Harsh

 

0 Kudos
Message 1 of 7
(877 Views)

Unfortunately, the "Trail" (or "Trial") file is a LabVIEW 2023 file, and many of the more experienced Forum users (myself included) are using LabVIEW 2019 or 2021.  Could you please "Save for Previous Version" the "Trial" file, specifying, say, LabVIEW 2019?

 

I did look at "Flow meter read.vi".  You specify a read of 22 bytes, but are also (correctly) initializing VISA with the default "Use Termination Character".  Try reading 1000 bytes (or, since I like binary, 1024 bytes), which would allow a slightly-longer (say, 26 byte line) to be accepted.  It may be as simple as that.

 

Bob Schor

0 Kudos
Message 2 of 7
(847 Views)

@Bob_Schor wrote:

I did look at "Flow meter read.vi".  You specify a read of 22 bytes, but are also (correctly) initializing VISA with the default "Use Termination Character".  Try reading 1000 bytes (or, since I like binary, 1024 bytes), which would allow a slightly-longer (say, 26 byte line) to be accepted.  It may be as simple as that.


Yeah, 22 seems too specific as if that is how long a line was expected to be.  I typically do not go so far as saying to read 1000 or 1024 bytes.  I will tend to use 50 or 100.  Though, my generic library uses 4096.  I'm not sure if it actually makes a difference as far as memory is concerned.  The only real thing is that the number of bytes requested have to be more than the number of bytes in a message/line when the termination character is used.


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 3 of 7
(840 Views)

Hello, both of you, 

 

Thanks for the response. Here I attach both files in the 2019 version. The original file was working earlier when another student was using it 2 years back but the same file is not working now. I tried but couldn't solve the issue.

 

looking for your suggestions and solutions.

 

Harsh

0 Kudos
Message 4 of 7
(817 Views)

It goes against my intuition, but I think I read somewhere that the VISA Read byte count doesn't actually allocate memory.  My best guess would be it uses this value to determine when to call that "number of bytes read equals the number of bytes requested" warning.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 7
(794 Views)

Time to read the manual: https://tsi.com/getmedia/53b953c3-efb4-4ee9-81bc-0e43b4626254/1980430-4000-4100-Design-Guide-web?ext... 

 

1. The flow meter uses 38400 while you are using the default of 9600.  

 

2. DO NOT USE THE BYTES AT PORT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (still not enough emphasis)

 

When you use the Bytes At Port to tell the VISA Read how many bytes to read, you have a race condition.  You expect for your message to get to the device, the device process the command, the device take its measurements, and then reply with the data all before you check the Bytes At Port.  That is not going to happen.  Instead, use the termination character built into the VISA library.  Just tell the VISA Read to read more bytes than you ever expect in a message.

 

3. Use Scan From String to very easily parse the returned string.

 

I did some clean up of your code.  See if this works for you.


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
Message 6 of 7
(776 Views)

@billko wrote:

It goes against my intuition, but I think I read somewhere that the VISA Read byte count doesn't actually allocate memory.  My best guess would be it uses this value to determine when to call that "number of bytes read equals the number of bytes requested" warning.


Correct on both points.  crossrulz must have learned the forgotten that the VISA buffer is 4096 bytes (giving you a beautiful I16 bit count) 

 

That is mostly still a holdover from 77 Baud (90wpm) DC current loop teletype and telegraph technology.   At low data transfer speeds longer messages added considerable latency in the transmission.  Moreover, the data speeds were impacted by the physical relay switching time on either end.   Relays also bounce and chatter so, smaller packages of data were used to error check (checksum) and the old ACK/NAK feedback was used to determine if a packages needed to be resent.  Ridiculously slow a century or so later.... until you realize that human typing speed hasn't changed much and is still used today (like RIGHT NOW by me) 

 

Eye can tepy 09wpm, know mitsarks.


"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 7
(771 Views)