Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA read problem

Solved!
Go to solution

Hi everyone,

I am using LabVIEW 2023 Q3 32 bits and I want to communicate with a COM port using the VISA functions. It used to work in the past but something may have changed and I can't figure out what.

 

When I use a VISA read command, I receive the correct answer from my instrument as long as I don' ask long databytes. I want to read 65536 bytes and I receive only 4096 whatever the timeout I put.

0 Kudos
Message 1 of 12
(1,173 Views)

Please attach your code (in LV2019 or earlier) and more detail of your instrument to guide you better.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 12
(1,133 Views)

When I need to read more than 4k of data, I tend to read in chunks.  This is simply a VISA Read inside of a FOR loop.


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 12
(1,108 Views)

unfortunately, my LV code is only in LV2023 now.

 

0 Kudos
Message 4 of 12
(1,104 Views)

My LV code worked fine in previous versions with 64 kB of data and it is not working well now.

 

The software dedicated to the instrument works fine but with LV I can address several instruments/motors... and make some scans.

 

Do we need to clear the buffer before addressing a new command ? I am wondering if remaining data in the buffer would cause my problems

0 Kudos
Message 5 of 12
(1,103 Views)

@YvesM_91 wrote:

unfortunately, my LV code is only in LV2023 now.

 


All that you have to do is goto File menu, select save for previous version and select 19.0

 

https://www.ni.com/docs/en-US/bundle/labview/page/saving-for-a-previous-version.html

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 6 of 12
(1,092 Views)

I hope it is ok now for reading in LV2019

0 Kudos
Message 7 of 12
(1,086 Views)

Now I put a VISA I/O buffer to 65536 but the VISA read command does only read 3741 bytes (it should read 65534).

 

Why is so ?

0 Kudos
Message 8 of 12
(1,058 Views)

@YvesM_91 wrote:

I hope it is ok now for reading in LV2019


You didn't attach anything

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 9 of 12
(1,051 Views)
Solution
Accepted by YvesM_91

@YvesM_91 wrote:

Now I put a VISA I/O buffer to 65536 but the VISA read command does only read 3741 bytes (it should read 65534).

 

Why is so ?


Potentially the data contained the termination character and hence VISA treated the data is complete.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 10 of 12
(1,049 Views)