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,024 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
(984 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
(959 Views)

unfortunately, my LV code is only in LV2023 now.

 

0 Kudos
Message 4 of 12
(955 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
(954 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
(943 Views)

I hope it is ok now for reading in LV2019

0 Kudos
Message 7 of 12
(937 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
(909 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
(902 Views)
Solution
Accepted by topic author 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
(900 Views)