11-26-2013 06:45 AM
I am trying to plot multiple rails, both voltage and current, over time and then at the end of the run, display the averages of each V&I rail. I am guessing this is quite a common application but am having trouble finding an example.
I have written this in python, please see atatched, but would like to recreate this in LabView.
Can someone point me in the right direction please?
thanks
Rod
11-26-2013 07:44 AM
With so little information, the best recomendation is Help>Find Examples. You have not even mentioned the hardware you are using. Have you taken any of the LabVIEW tutorials? Please attach the code you have written so far so someone can see what your problems might be.
11-26-2013 08:04 AM
Thank you for the reply. Yes, I have looked at various examples and completed a few tutorials but I am still stuck.
I am using a USB-6218 DAC. I want to record the voltage and current on 8 separate power rails. I have connected up 16 channels, 8 to monitor the voltage and 8 to monitor the current.
ie. AI0 monitors the voltage on the first power rail, AI1 monitors the current on the first power rail
AI2 monitors the voltage on the second power rail, AI3 monitors the current on the second power rail
AI4 monitors the voltage on the third power rail, AI5 monitors the current on the third power rail and so on.
I want to show the voltage and current on each power rail on the same graph and print out a separate graph for each power rail. (I have shown an example of this, written in python, on my initial post)
I have attched the code that I currently have. The problems I am having are
1) Current and voltage are on separate graphs, I want to combine these. ie 8 graphs, one per power rail, each showing voltage and current.
2) I would like the graphs to show real time, ie start at 0 and go up to the end of these test which can vary from 30 secs to 5 mins.
3) I would like to show the average current and volate for each rail at the end.
Thanks,
Rod
11-26-2013 08:24 AM
I don't understand why you aren't getting an error. There are two separate tasks - one for voltage and one for current. That should cause a resource reserved error. Instead of two separate tasks, use one with all channels. You would still use two separate DAQmx Create Channel functions but the task output of one would be wired to the task input of the next. You would have one timing function and one read function inside the loop. The output of the DAQmx is an array of waveform data types. You can index the array and wire the functions to however many charts that you want.
Your charts are current set to display absolute time. Have your right clicked and changed the x axis properties to relative time?
In order to take the averages, you would need to either retain the Y array of each acquisition or take the average of each acquisition and retain that (i.e. with a shift register). A chart does keep a history so that is one option if you set the History Length long enough. Be aware that if the history length is not long enough, you will start to drop the earliest data. Using a shift register to retain the data can run into performance issues. Some testing here is required.
11-26-2013 08:55 AM
thanks. OK, I think I understand your comments about the inputs. I have rewired as you suggested, please see attached.
What do I do with the physical channel input on the second one? When I leave it unconnected I get and error, when I connect it as shown I get an error?
11-26-2013 09:14 AM
The physical channel input must be wired but it must be wired to a different control. The channels are different, after all.
11-26-2013 09:15 AM
sorry, yes, stupid question 😞