ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Read binary data from GPIB in visual basic 6

Hi all,

 

I am trying to write an application in Visual Basic 6 to get data from my external GPIB device. I happen to have a copy of Component Works that has an ActiveX which can make my coding work much easier. My data has a 20 bytes header and at most 40K actual data following that. The exact number of data is specified in the 20 bytes header.  

 

I tried to follow the tutorials/examples, but still had one question to solve:

 

Q: How to load binary data into a double array

 

  The GPIB1.Read functions only returns a String variable. How can I convert this string into numbers? I need to read the first 20 bytes and then read the number of bytes from specified. There seems to be a data parsing method within the GPIB ActiveX, but I do not know how to use. I can not find same example from website either.

 

Please educate me how to achieve so. 

 

Thanks! 

 

 

 

0 Kudos
Message 1 of 2
(3,832 Views)

Hey, You can use atoi() function or type cast it.

 

-lab

0 Kudos
Message 2 of 2
(3,815 Views)