LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

bypassing instrument function to instrument interaction in labwindow

Hey all,

 

   I am using DAQmx and trying to figure out a way to change what the instrument functions interact with. For example:

DAQmxCreateAIVoltageChan(), creates a voltage measurement channel and adds it to a task. Normally what happens is I call this function in my source file and provide the inputs. The function then does its magic with the DAQ, I have no idea what since I haven't figured out how to check the source of the library. The DAQ then probably returns something to the function and the function returns success.

 

What I want to do is intercept the stage when the function and DAQ interacts. Its easy to cut off the connection by simply taking the DAQ off the hardware but how would I be able to redirect this connection? Would this require writing a driver? Or just another lib file?

 

thanks

0 Kudos
Message 1 of 9
(3,114 Views)

DAQMx functions actually operates as a high level interface between the hardware and the user; they are designed to address a wide variety of needs and activities of the users. If you want to skip this level and move to a lower programming level I suppose you may need the Measurement Hardware DDK, a set of informations and sample programs on register level programming for DAQ devices.

 

Nevertheless, using this material requires a deep knowledge of the hardware and is harder than using high level instructions. I seemed to understand from your posts that you are quite new to DAQ devices and DAQMx software, so are you sure you want to go the hard way? My situation can be different from yours, but consider that in many years of development with DAQ devices I never had a reason to move to RLP: is there a particular reason that compells you to abandon more friendly and still powerful high level instructions?



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 9
(3,109 Views)

I'm doing things in a strange way because I've trying to figure out a way to test my software without actually being connected to the DAQs. Right now the software works connected to the various AO, AI DAQs. What I need to do is for the software to work as if the DAQ were still connected. I tried to simply create virtual devices in MAX, but those devices only generate a single sine wave, which doesn't give me the same results that a physical DAQ would. Now i'm forced with no other alternatives but to go the lower programming level. But you are right that I'm very new to all this, so I'm possibily not thinking of the best solution. 

 

hopefully I was clear in my description, do you think that I have any other alternatives?

 

thanks alot

0 Kudos
Message 3 of 9
(3,105 Views)

Tianshiz,

 

Its not really going to be possible to truely test software as if you had the device without the daq device. Is there any specific reason you cant use the device youre supposed to be developing for?

 

Regards,

 

Kyle Mozdzyn

Applications Engineering

National Instruments

Regards,

Kyle M.
Applications Engineering
National Instruments
0 Kudos
Message 4 of 9
(3,084 Views)

Hey Kyle,

 

    Any reason why this wouldn't be possible? Suppose in an example scenario my program send a command to increase voltage generation on one of the DAQ, if I have a driver written that receives this command, couldnt I have the driver send something like a success code back? The program would get this success code, the same that a normal DAQ would send back, and update itself in the GUI.

 

  I need this form of application cause it is best for us to test code without risking damage to the daqs as well as the devices the daqs are powering.

 

Thanks

0 Kudos
Message 5 of 9
(3,082 Views)

something else to add to all this. just wondering if this is possible,

 

say for the function DAQmxCreateAIVoltageChan() in the DAQmx lib, what if i unlinked the library and then created a new lib and a function called the samething? Only problem though is that I dont really have access to what goes on in the function, is there anyway that I can figure this out through the MHDDK?

 

0 Kudos
Message 6 of 9
(3,072 Views)

Tianshiz,

 

It may be possible to do this with the DDK, but questions regarding it would best be pointed here:

http://forums.ni.com/t5/Driver-Development-Kit-DDK/bd-p/90 

 

That said, I would recommend against this plan, particularly if you are trying to prevent device damage. Tricking the driver to issue commands does not prevent the device from being damaged once real testing is underway. Often this can lead to a false sense of security while developing, only to have unanticipated problems pop up once the real device is being used, throwing off the development schedule. Our devices do have safeguards in place to prevent damage to the device, so as long as you're within some physical specifications such as maximum input voltage, damaging the device will be pretty difficult.

 

Regards,

 

Kyle Mozdzyn

Applications Engineering

National Instruments 

 

 

Regards,

Kyle M.
Applications Engineering
National Instruments
0 Kudos
Message 7 of 9
(3,057 Views)

would i need a ddk though? there will be no driver interaction. just imagine the software on a desktop connected to nothing else, it has to run as if it is connected to the DAQs

0 Kudos
Message 8 of 9
(3,053 Views)

Tianshiz,

 

If you just want to see how the code responds to data, you can simply make a file with the desired data in it to test with and pull from there. Creating a model of an instrument to test would be a large undertaking to say the least, and would not necessarily prevent you from damaging a device once one is plugged in, because it isnt really something you can model without testing.

 

 

Regards,

 

Kyle Mozdzyn

Applications Engineering

National Instruments 

Regards,

Kyle M.
Applications Engineering
National Instruments
0 Kudos
Message 9 of 9
(3,051 Views)