Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the old NI bas-files for accessing a GPIB board in Visual Basic.NET

Unfortunately, the GPIB Beta Enrollment Data page breaks as soon as I click the Submit button.
I get "A Runtime Error has occurred. Do you wish to Debug? Line: 0 Error: Object expected".

It would be really helpful if someone could just email the NI-488.2 VB.NET beta files to me at c3@hp.com.

I've wasted all week so far fighting NI-488.2 & VB.NET
(I've been using NI-488.2 & VB3/4/5 successfully for the last decade - I don't want/shouldn't need to learn how to address the DLL directly. I'm an engineer, not a programmer.)

I know that NI has the solution; please make it easy for us long-term customers to get the code we need, when we need it. Warts and all if necessary - we'll help you debug it.

Chris Coleman
Hewlett-Packard Ltd
.
0 Kudos
Message 11 of 15
(1,870 Views)
Hi Jason,
I did almost the same thing as you mentioned. Only thing is not working is the ilrd calls. The VB.Net is a 16 bit based character, and the VB 6.0 is 8 bit based character. Fortunately ilwrt is working well. ibrd doesn't seem can work, unless we changed the system back to 8 bit char by some code at the top of the main module, I don't know how to do it yet.
I am just wondering how did you deal with this problem and make the ilrd working.
Thanks
Kang
0 Kudos
Message 12 of 15
(1,870 Views)
In VB 6.0 the mix of 8-bit and 16-bit characters depends on which ANSI code page you're using. I read that the executable code of VB 6.0 programs already uses Unicode internally and guessed that the VB 6.0 runtime library translates between that and a chosen code page assumed for the language version of the OS. Just now I tested this by telling VB6 to compute Len("東京") and it said 2 not 4, so indeed it's counting characters not bytes.

I read that in VB .Net the default is to assume that Unicode is used everywhere. In order to make the executable code translate between that and a chosen code page assumed in some manner, the keyword ANSI can be included in a VB DECLARE statement. I haven't had an opportunity to test this, but yo
u do, and you could let me (and everyone) know if it works 🙂
0 Kudos
Message 13 of 15
(1,870 Views)
"keyword ANSI can be included in a VB DECLARE stateme"
Doesn't work at all. It may need to convert entire page or program to 8 bit character scheme.

Kdeii
0 Kudos
Message 14 of 15
(1,870 Views)
Hi Guys,

I've got an example here where the two files are used in VB.net. This works fine for one of my customers.

Regards.

Applications Engineer
NI Belgium
Download All
0 Kudos
Message 15 of 15
(2,092 Views)