12-14-2006 01:51 PM
12-14-2006 06:06 PM
Hey Matt,
I understand your frustration. You could call a batch file that launches the DAQmx installation (even silently) so that you do not need to do this. I am not aware, however, of Visual Basic 6.0 installers' capability to launch a batch file after installing. It might be possible, but I have not heard of a way to launch a .bat file after installation using the built-in installer capability. That being said, once the application is run, you could check whether the DAQmx driver is installed (through several different methods, most basically a file existence check) and, based on that response, launch the DAQmx installer from the Visual Basic code. With this method, you could silently launch the DAQmx installation (or even a DAQmx runtime version if space is a problem).
Another way you could ensure that DAQmx is installed during installation is to use another application (such as CVI or LabVIEW) to provide a more customized installer. For instance, with CVI installers, you have the ability to target your distributables to whatever directories you wish and the DAQmx installer is a built-in capability. Even using Visual Basic .NET, you have the ability to launch batch files (*.bat) post-installation.
Are these 300 computers not the same image? Typically in lab situations, several computers would use the same image. In that case, you could install DAQmx on the image.
Best regards,
12-15-2006 11:10 AM
12-15-2006 04:14 PM
The suggestion for "late-binding" sounds like it may work, but I haven't used that before. Is there example code I can copy (I haven't googled it yet to check)?
The root cause though is the decision by NI to change the architecture. I'm sure there are 100 reasons why it was done, but the end result is an inconvience to the the end (paying) customer. If you have a means to bring it to the attention of the right people, maybe someone will put it back the way it was....1 install and done. Isn't that kind of the point of Visual Basic and ocx controls? The only reason to install the whole thing should be if I need to use some of the other tools or interfaces.
Thanks for your suggestions!
Matt
12-18-2006 09:12 AM
Sorry, I wasn't aware of the term. Sure, I can do a CreateObject() to get a nidaq object. I'm still trying to find the correct object to create, something like CreateObject("NiDAQmxCAPI.DAQmx"). Any hints would be appreciated.
Matt
12-18-2006 12:58 PM
12-18-2006 01:20 PM
Probaly I should be more clear. I am only interested in Digital IO, I don't use any other functions. I have a very simple app that just sets and reads IO. This is a pseudo-excerpt of my code...
' Create the DAQmx task.
DAQmxErrChk DAQmxCreateTask("INPUT", taskHandle)
DAQmxErrChk DAQmxCreateDOChan(taskHandle, daq_str, "INPUT", DAQmx_Val_ChanForAllLines)
' Start the task running, and read from the digital lines.
DAQmxErrChk DAQmxStartTask(taskHandle)
DAQmxErrChk DAQmxReadDigitalLines(taskHandle, 1, 10#, _
DAQmx_Val_GroupByChannel, readArray(0), arraySizeInBytes, _
sampsPerChanRead, numBytesPerSamp, ByVal 0&)
Currently I include the reference "NiDAQmxCAPI" into the project to allow this to execute. This does not work for me because then I have to install another app (either the big NiDAQ or the runtime) before my program will even run, whether or not it needs to use the NiDAQ card. What I need is help to do the above without the reference included in my project, which means it should run fine as long as it does not call a NiDAQ function. On the small number of computers that need NiDAQ, I will install the NiDAQ software. Does anyone have that solution? I think it should be simple, but all the URLs etc... just dance around the concept, no concrete examples. I'm thinking it would be something like...
set my_daq = CreateObject( "nidaqmxcapi.daqmx" ) <==this doesn't work in reality
' Create the DAQmx task.
DAQmxErrChk my_daq.DAQmxCreateTask("INPUT", taskHandle)
DAQmxErrChk my_daq.DAQmxCreateDOChan(taskHandle, daq_str, "INPUT", DAQmx_Val_ChanForAllLines)
My code is mostly just cut-and-paste from the DIO example code (suggestion: update the examples to show whatever solution we come up with here). I'm not a pro developer so I'm not doing rocket science...
Matt
12-19-2006 03:39 PM
01-10-2007 09:23 AM
01-10-2007 01:22 PM - edited 01-10-2007 01:22 PM
Message Edited by Jonathan N on 01-10-2007 01:25 PM