10-26-2022 04:47 PM
Hello dear LabVIEW community.
I have 3 pressure transducers (Omega PX409-015G5V, Omega PX309-002G10V, MKS Baratron 750C13TCE2GK) and 1 flow meter (Omega FPR303). All of them output voltages. With the transducers I just want to read voltages and save them to an Excel file, with the flow meter - which is a turbine type flow meter - I want to read voltage, convert it to frequency and then save it to an Excel file.
I wrote separate LabVIEW programs for every sensor, tested them and even calibrated the sensors with them. Everything worked fine like I wanted.
Then I figured out that I had to combine them to one LabVIEW program in order to run all the sensors simultaneously.
That's where I have problems and that's what my question is about: how to combine them all into one program.
I've tried two ways.
The first way was suggested on the LabVIEW forum. It was about mere copying the 4 sensors' programs into one program. And that one program would have 4 separate while loops. That didn't work. I had some error about DAQmx. That error was mentioned in the suggestion on the forum. So, I abandoned that way.
Then I found another suggestion on ResearchGate. I created one while loop and one DAQ assistant for all the sensors. Within the DAQ assistant I created the channels for each sensors. Turned out, the DAQ assistant would output data from all the sensors simultaneously and I had to split the data after the DAQ assistant. I added a "convert from dynamic data type" vi, then I added an "index array tool" to split the data. Then I added "convert to dynamic data type" to read the voltages.
And nothing works. I would start the program, it would sit for a while and would give me an error.
The worst part is after I got the error from the combined program, the separate programs for each sensor stopped working and started giving me the same error.
I'm wondering if anybody can have a look at my code and say what's wrong with it, please.
The specs are as follows.
Thank you in advance.
Ivan
Solved! Go to Solution.
10-26-2022 08:23 PM
Alas, another LabVIEW user who has been misled by the Dreaded DAQ Assistant,A its evil twin, the Dynamic Data Wire. Please open a Web Browser and find and read "Learn 10 Functions in NI-DAQmx and Handle 80 Percent of your Data Acquisition Applications" (I've mentioned this so much I'm 95% certain that this is the actual title of this excellent NI White Paper).
Ignore the first point, which mentions the Dreaded DAQ Assistant. You should never use it. Here's how to get started "the right way":
Here is the One Channel A/D VI I just built (yours should look similar):
Give it a try. Your code for your 4 channels into the USB-6009 should look (almost) identical to the above (except it is NChan NSamp, and a different Task name). Note that the 6009 is sampling all 4 channels at the same time, keeping them separated and organized for you, and you can just plot it (or do whatever you need).
Bob Schor
10-27-2022 04:01 PM - edited 10-27-2022 04:53 PM
Thank you very much, Bob.
I accepted your answer as the solution: it seems clear, but I haven't been able to proceed beyond the third bullet point.
When I opened MAX and expanded the devices list, I noticed a worrying red circle with a white cross next to the symbol of my DAQ. And then I saw this message: Error status code: -88705. I have attached the screenshot.
I don't think that's something good. I've been looking all over the place for the test panel you talked about and couldn't find it.
I think something had happened to my DAQ.
Like I mentioned in my original post, my separate codes for each sensors worked fine. Then I wrote that all-in-one code, ran it and got the error. Immediately, I tried running separate codes and they started giving me the same error. I think I broke my DAQ with that all-in-one code. Do you think that is a possibility?
Thank you.
Ivan
P.S. For those like me who doesn't know what MAX is, double click on the LabVIEW shortcut on your desktop. Go to Tools. The first line there is MAX.
----------------------------------------------
UPDATE.
I panicked too early. My DAQ is working. I deliberately don't delete this post in case another person experiences the same issue. I found two posts: this one and this one. I followed the second post primarily. I rebooted the computer having my DAQ plugged in. I suspect that solved the problem, but I didn't try my DAQ after the reboot. Instead, I went ahead and did the manipulations with NI device loader as prescribed in the second link (note that it wasn't that clear how to access that, I ended up typing administrative tools in the Windows search bar and it opened up a folder for me where I could locate services). Then I just opened NI MAX and saw my DAQ there without any errors. The test panel Bob talked about is now there in NI MAX.