12-12-2021 03:33 AM
Hello,
We currently have a few programs which we use in house which allow you to select voltage input, temperature input, current input, etc from within the standalone LabView program. The limitation is then that the dropdown menu we have is populated by options which have to be added in with cases. So, essentially, if I suddenly need to read an RTD, which isnt one of the cases we already have, it is not possible, because the dropdown menu only contains three cases (voltage, current and temp). Now, we could simply add a case for every single possibility, so that no matter what we plugged in we would be covered, but I have to assume that there is a better way of doing this, possibility even dynamically.
When you drop a DAQmx virtual channel into the VI, it has a dropdown which you manually select, and then it is locked to that. Is there not a way to dynamically control this with an input? Or better yet, query the device to see what it is capable of outputting, and then giving just those options for selection from within the standalone LabView program that we distribute in house? And before it is suggested, we would really prefer to avoid using external tasks made with NI MAX, which are then referenced.
12-12-2021 11:37 AM
There's a Man (Irving Berlin), a Broadway Show ("Annie Get Your Gun"), and a Song ("Anything You Can Do, I Can Do Better") whose title, for LabVIEW, would be "Anything MAX Can Do, DAQmx Can Do Better" (though it will take a little more work).
Let's say you have a number of DAQ Devices connected to your computer, and you want to find the USB-6001. Write yourself a "Find DAQ Device" consisting of the following:
Here's an example of creating a Task for some Flow Meters, where I wanted to scale the (voltage) input from the USB-6001 to L/m, specifying a Maximum Flow, and using a linear scale to give me Slope and Offset. The first sub-VI ("Find DAQ Device") implements the points of the first two Bullet Points, and this sub-VI does the rest of the work of building a Task that takes 8 channels worth of data.
Bob Schor
12-12-2021 12:46 PM
I think that you may have misunderstood my issue. Lets say that I am using a cDAQ chassis with 8 slots. In it, I have a voltage input card (9220), multiple thermocouple input cards (9213), and a current input card (9208). In my Labview program, I have a settings vi where there is a dropdown control, and I can select from it either voltage input, temperature input or current input. Now, the voltage input card can only do voltage, the thermocouple card can do voltage and temperature, and the current card can do current. So I am covered, in every situation, my pulldown menu, which controls a case structure, covers my possibilities.
But then one day, the customer shows up, and he has some PT100 sensors, and brings his own RTD input card (9217). The issue is that it only has two outputs, temperature:RTD and resistance. I do not have that option in my dropdown, because I only have cases for voltage, temperature and current. Ok, so then I could just make a new case for temperature:RTD, and then another for resistance. But then someone else needs strain measured, and then someone else needs frequency, and yet another is thinking about checking acceleration. At some point, it makes little sense to continue to keep making a new case for every single possible input type, and you start wondering if there isnt a way to have this selectable.
12-12-2021 04:24 PM
Oops, I tried to answer the "wrong question".
But as you reformulate the question, it begins to sound like "The User plugs an Unspecified DAQ device into my PC, and wants to measure X (which the device supports). How do I configure the Unspecified Device? Well, you'd need (a) some way to identify the device (which I tried to show is do-able), and (b) you'd need to know enough about the device to be able tp know how to program to its capabilities.
One way (and, perhaps at the present time, the only way) to handle this is to have a list of "possibilities" (such as all cDAQ plugins) and to use the information MAX/DAQmx provides to, at run time, choose the appropriate tests. Hmm, beginning to sound like Objects and Plug-ins might be involved ...
Bob Schor