Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert VB.Net NiDAQmx code to VB6 NiDAQmx code?

Solved!
Go to solution
Solution
Accepted by tim8w1

Hello,

 

The reason you are not getting anything returned is because the string is not initialized to a certain length before it is returned.  Basically, the function that you are calling returns a pointer to a string but doesn't return the length of the string. If you use the following code it should work correctly:

 

Dim sDevices As String *50

Dim IReturn As Long

 

IReturn = DAQmx(GetSysDevNames(sDevices, 256)

MsgBox(sDevices)

 

This should now show you the devices you have on your system and should have a return code of 0. Have a great day!

 

Best Regards,

 

Adam G 

National Instruments
Applications Engineer
0 Kudos
Message 11 of 13
(1,070 Views)

Adam,

That worked.Thanks. Been awhile since I did any VB6... I'm looking for one other function from .Net NiDAQmx... Can you tell me what the equivalent of:

 

DaqSystem.Local.LoadDevice(sDAQDevice).DeviceID

 

 

Thanks!

0 Kudos
Message 12 of 13
(1,054 Views)

Hello,

 

I don't know if there is an exact function that will do what the .NET one does, but I believe this one is pretty close: DAQmxGetDevProductType.

 

Best Regards,

 

Adam G 

National Instruments
Applications Engineer
0 Kudos
Message 13 of 13
(1,025 Views)