Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Serial Read "Problem".

Hello again,

When using VISA Serial Read and requesting 227 bytes, only ~30 are
read, which is reported by the vi. Why doesn't the vi read all the bytes
at the port? I made sure all the bytes were transmitted by my modbus
device via a datascope so I know its not on my end. Is there a property
to set? The old Initialize Port vi had a buffer size that could be set,
which seems to be my problem here. I don't see this in the VISA
properties. Is there one that is just worded differently? Thanks in
advance for any help? I am new to VISA.

Pat S.
0 Kudos
Message 1 of 3
(3,162 Views)
Most likely you have termination char at your data sequence. So you need to set property of Message based settings->Termination char and Termination char enabled. This hopefully should switch VISA to read the whole data string up to termination char.
If this is not so, do VISA read sequentially in a loop until get the all desired data or reach timeout. See online help for VISA functions and VISA manuals for details.
Sergey
0 Kudos
Message 2 of 3
(3,162 Views)
Pat:

There are 2 things to try here:
1) Set the serial input end mode attribute to 0. The attribute/property name is either "ASRL End In" or "Serial End Mode for Reads".
2) Use the "VISA Set I/O Buffer Size" function in the VISA Interface Specific subpalette. This will let you set the receive and/or transmit buffer size.

Dan Mondrik
Senior Software Engineer, VISA
National Instruments
0 Kudos
Message 3 of 3
(3,162 Views)