06-23-2011 09:45 AM
Hi,
I'm pretty new to this so forgive my rubbishness. I'm using cDAQ and NI9205 to take signals from 10 sensors. All DC between 0 and 5V. Running them a test for 60 seconds and plotting this onto a chart.
The issue im having is I can't seem to get the chart to start from zero each time. When its stopped it starts again at a relative time to how long its been stopped. No Matter what I do with the scales and units for the x axis I can't seem to fix it. Attached is the bare bones of this as test panel.
The tester test file is more the format I need and the scale is fine. Though the only way i could get it to show a graph trace over a time period was to adjust the sample/frequency ratio to get the desired time. But then the problem is that it collects all the samples then displays them after the fact, rather than real time. This VI would be perfect if it did the same thing but with real time graphing of the outputs.
Any help would be great,
Thanks
06-24-2011 02:25 AM
Hi Claptrap,
I am not sure what exactly is your problem , but if it is just about clearing the chart after each run, you can righclick the graph when its blank and in data operation set it as default value. Then in the block diagram use an invoke node with reinitialize all to default property befor starting the while loop. Check the attached VI for more details. This will make the graph start from 0 evrytime you run the VI.
Regards,
Nitzz
(Give kudos to good Answers and Mark it as a Solution if your problem is Solved;))
06-24-2011 04:30 AM
Hello Nitzz,
Yes that's the operation I need to happen. A reset graph for each test run.
I've loaded your attached modified vi but its not saving the default value properly. I right clicked and set the default when the graph was blank and ran it. Whether the vi ran for the designated time and stopped or I stopped it the old graph data was still there. Pressing start would just add to the old data.
Right clicking and pressing reinitialize to default value doesn't do anything so the problem seems to be the default value not being stored.
If I manually clear the graph I can start again properly.
Hope this makes sense and thanks for your help.
06-24-2011 04:47 AM
Hi,
I am not sure why is that happening. I think it has something to do with the DAQ configuration and reset. I don't have a DAQ here and so i cant check that part here but when i tried running your code with a signal simulator its working fine here. Can you just check the attached VI and tell me if you are getting this trouble while using the signal simulator also.??
Regards,
Nitzz
06-24-2011 04:57 AM
Thanks for the speedy reply.
Its working fine with the simulated signal, so you're right. The issue is with the DAQ setup. Will it be using the DAQ assistant thats causing a problem?
06-24-2011 05:06 AM
Hi,
DAQ assistant usage is not causing the problem i think. The problem may be because the DAQ is not getting reset when the program is stopping. If you press the Abort execution button the DAQ cant get reset. It resets only when the program stops properly. Did you check what is happening if you stop the loop by pressing a stop button and then again starting it?? I mean closing the loop in a proper manner i mean.
Regards,
Nitzz
(Give kudos to good Answers and Mark it as a Solution if your problem is Solved)
06-24-2011 05:20 AM
Hi,
Yes I've been letting the program stop with the timer value. Even if I wire it to a stop button it behaves the same. If you abort the simulated signal it will still reset to default when you start the vi again.
thanks
06-24-2011 11:37 PM
If I understand the problem correctly, you want to start with a blank chart each time you run the VI (you don't mind having the values remain "visible" when you stop/pause). All you have to do is wire a blank array into the History Data property of the chart (it's the very last property listed when you plunk down a Property Node for the chart). This clears out the old data and starts the chart off from scratch.
Bob Schor
06-27-2011 03:41 AM
Hi Bob,
Sorry only just got into the office to try your idea. Which type of array do I need to wire into the chart history data terminal?
I've tried the basic array in the array, matrix and cluster section but you can't wire these together due to conflicting data type. Thats after I changed the history data to an input rather than an output.
Thanks for your help, much appreciated.
06-27-2011 08:59 AM
In my case, I'm plotting multiple channels (say 5) of analog data, updating the points (say) every 100 msec. I'm working with "raw" analog signals, so my basic data type is I16. Because I'm plotting multiple lines on the same chart, my input data (the individual points coming from my A/D converter) arrive as a 1-D array of I16. However, to plot multiple channels on my chart, I need to wire a 2-D array, so I simply run my 1-D array through "Build Array", one input and one output (which becomes a 5-by-1 2-D array, perfect for plotting a single time point having 5 channels of data).
About clearing the History -- you do this only once before you start sending points, e.g. before you turn on your A/D converter.
Bob Schor