Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA and GPIB

Hi all,

  It seems that all example code found online to use VISA to write to GPIB will send string (command and data). I wonder if this is how it design or we can change that to use binary data instead? Now to send 100 8-bit data (ranged from 100 to 200), I have to converted 3 character for each number so it will be at least 3 times more than sending the binary data.

0 Kudos
Message 1 of 3
(3,768 Views)
You must use strings for VISA/GPIB reads and writes. The strings, of course, do not have to be ASCII text. The representation is whatever the instrument expects. There are numerous discussions about sending hex characters when that is the required format. Some instruments allow you to select.
0 Kudos
Message 2 of 3
(3,761 Views)

@dragondriver wrote:

Hi all,

  It seems that all example code found online to use VISA to write to GPIB will send string (command and data). I wonder if this is how it design or we can change that to use binary data instead? Now to send 100 8-bit data (ranged from 100 to 200), I have to converted 3 character for each number so it will be at least 3 times more than sending the binary data.


As Dennis said, you send the data in whatever format the instrument wants it in.  If it wants ASCII digits, then use the Decimal Number to String to convert to a string to send.  If the instrument wants binary data, then just use Byte Array to String and send that.


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