04-06-2010 02:50 PM
I just installed Windows 7 64-bit, VB 6, and DAQmx 9.1 default installation (except I added VB 6 support).
After installing, I was able to successfully launch VB 6 examples and run them. As well, I wrote a simply test project from scratch (adding the reference to the project manually) and was successful.
Since I have validated that everything works "out of the box", this brings me to the question: What behavior exactly are you seeing? In your original post, you said you weren't able to find nidaqmx.tlb. You have apparently found nidaqmx.tlb in syswow64. What is your current problem if you open one of the shipping examples (C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\Visual Basic 6.0\...)?
04-06-2010 02:56 PM
04-06-2010 03:02 PM
If you could try this basic test and let me know the result:
1. Create a new standard exe project.
2. Go to Project>>Reference and browse manually to c:\windows\syswow64\nidaqmx.tlb.
3. Create a button on the designer and double-click it (just to create a callback).
4. Type into the callback:
Dim task As Long
Call DAQmxCreateTask("", task)
5. Run the program and click the button.
04-06-2010 03:09 PM
04-06-2010 03:36 PM
My IDE does not create exe projects. Furthermore everything I do is done directly with text code. I am not very familiar with the VB6 interface. The manufacturer of my IDE does however ensure me it is based on a VB6 shell and is compatible with its libraries. I think the fact that I cannot load a script with a DAQ command is indicative that it is not linking to the library. My quandry is my IDE manufacturer doesn't directly support NI and NI doesn't directly support my IDE. But I am using other VB6 libraries with no problems. I just load the hardware drivers then place a .BAS file (see attached example) in a folder to be loaded when I run my IDE and I am all set, it recognizes the commands.
I really don't have another day to waste on this. I'd have requested an RMA by now but I don't have another system to turn to.
04-06-2010 04:17 PM
That screenshot sheds some light on what might be going on.
It seems that this environment abstracts the concept of the VB project away from you such that you do not have a way of expressing project references. I'm guessing that you had a bit of trouble with step 2 seeing as how there's no menu (at least not in the screenshot) for "Project".
I would recommend consulting that environment's help on how to add an external reference. This does not seem to be a problem at all with your installation or the DAQmx libraries, but rather how to address modules from that environment. There is a way to talk directly to C DLL entry points but it would be a bit painful to set up calls in this way for every function (for example, "Declare Sub DAQmxCreateTask Lib "c:\windows\nicaiu.dll" (ByVal taskName As String, ByRef task As Long))... see http://support.microsoft.com/default.aspx/kb/106553?p=1 Section B for more details on that.
That being said, the reason why other modules might work fine could be because they use that method of calling C DLL entry points (as opposed to a type library). Neither is wrong, but I personally prefer a type library approach.
In reality, we do not fully support Visual Basic 6 anymore (as Microsoft has stopped supporting it for a while now). That being said, you might ask the manufacturer of your software if there's any way to have a "Project Reference" in their environment (as that is where nidaqmx.tlb fits in). While they claim that their environment is "compatible with its libraries", either that means VB6's native libraries or that statement is not true (if there's no way to have a "Project Reference").
04-06-2010 04:27 PM
Is there more than one kind of reference? I can select references and see the NI DAQmx C API (see attached). Not sure if that qualifies for the Project Reference you speak of, but have suspected what we are discussing is at the core of the issue regardless. I will ping Media Cybernetics with the info in your last post.
04-06-2010 04:52 PM
To be honest, I'm not sure if there's another concept of references in VB6. That dialog looks slightly different than the "Project References" dialog in VB6. I have, however, validated that the type library works in the VB6 environment within a project.
One additional option that you might consider: if you have access to programming in another environment with DAQmx support (like C) and your application is very basic (like read from a digital port/line every now and then), you could create a DLL in C (for example) and call that from this environment using the "Declare Sub" syntax in your VB code. In this way, you could have a function in your DLL like ReadLine which internally performs all of the DAQmx calls (DAQmxCreateTask, DAQmxConfigureTiming, etc) and returns a simple boolean (for example). By setting it up like this, you wouldn't need to do "Declare Sub" for every function in the DAQmx API; you would just need to do one "Declare Sub" for your one function that takes care of everything else.