Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VB6 string conversion after an ibrd32 request

I'm updating a basic program written in Microsoft Quick Basic on a DOS platform. I'm using VB6sp5 on a WIN98SE platform. I'm using NI GPIB pci card with latest niglobal and vbib-32 files. Everything works well except when I try to read my Orbit A8000 Microwave receiver. Once it is triggered, it takes a snapshot of Phase and amplitude. This is returned in a 6 character string as binary data represented as characters. This workes as advertised in Qbasic. However, I get what appears as garbage in VB6. I believe there is some unicode conversion done by VB6 (thank you Microsoft!!!) I understand this corrupts the binary data. Microsofts soultion is to use a byte array instead of the string. I have not found a way to sen
d a byte array with the GPIB commands. ibrd requires a string and ibrdi is an array of integers. I did try the ibrdi sending an integer array, but that data is still incorrect. (that might be inpart because integers are signed.

Does anyone have some ideas how I can retrieve the binary data using the GPIB commands?

Thanks,
Ron
0 Kudos
Message 1 of 2
(3,359 Views)
Hey Ron,

I was looking through some of the shipping examples for VB, specifically C:\Program Files\National Instruments\NI-488.2\Languages\Visual Basic\ScopeSimple.

In that example after performing a read (ilrd) they perform a "DisplayStr = Left(ValueStr, ibcntl - 1)" to remove the carriage return. The ilrd function calls ibrd32.

Take a look at the example. I think it might help out.

Best Regards,
JoshuaP
National Instruments
0 Kudos
Message 2 of 2
(3,359 Views)