01-20-2009 05:47 PM
I am trying to create a VI which takes data in several phases: averaged, with multiple iterations, but that can be started and stopped on command. In the attached VI (in the library IMS Software V1.4, Single Gate Mode), the data outputs as requested the first time the VI is ran. However, when it is put into the wait mode and then restarted with a different number of points or scan time, all of the inputs go to the AI correctly, including number of points (this is based on highlight execution), and the array is indexed as the changed number of points, but the AI outputs the initial value placed into the system when it was started for the first time. I cannot change these values unless the VI is stopped and started again using outside controls. Any assistance on this would be greatly appreciated. I am sorry that it is a very complicated looking block diagram, I am new to LabVIEW, and this is what has needed to happen to make the system work as I would like. Thank you,
<>< Eric
Solved! Go to Solution.
01-21-2009 11:17 AM
Hey Eric-
After looking through your vi and your last post I have a few questions for you to identify the root of your issue. In your last post you mention that the second time you execute the main part of your program 'the AI outputs the initial value placed into the system.' For clarification purposes, are you saying that the data being read by the 'DAQ Assistant2' that is in the middle of your code is the same data as the first time you executed the program? If you place an indicator that displays the data immediately after the DAQ Assistant can you confirm that the data being read by your device is identical? What data are you expecting the second time you run your code versus what you are currently receiving?
Hopefully these questions help identify your issue so we can work to resolve it.
Ben
Applications Engineering
National Instruments
01-21-2009 11:24 AM
I think the best way to answer this question is to use an example. If I run the VI, and initially put a value of 1000 points and 25 milliseconds into the front panel, and allow it to save, I can view the file, and 1000 points are recorded, with a dt of 0.025. However, if I run the VI again (without exiting, just using the in VI controls), with 2000 points and 25 milliseconds, and watch the highlighted execution, my inputs all send to the DAQ Assistant2 as I desire, but the array output from the assistant gives a value of only 1000 points, instead of 2000 as I wanted. Thus, when the graph is displayed after the calculations I perform, the time intervals are all cut in half. However, if I use the outside VI controls and fully "exit" the program, then input 2000 points with 25 ms, 2000 points are output and the graph and save file are correct. It seems like the DAQ assistant is keeping the 1000 points and memory and not updating to the new values when the loop is ran again. I hope this helps clarify the problem,
<>< Eric
01-21-2009 12:30 PM
Hey Eric,
Thanks for the clarification of your issue. Unfortunately, what you wish to do is a limitation of the DAQ assistant. What you want to do is dynamically change the number of samples taken by the DAQ Assistant. However, the DAQ Assistant only takes the first ‘number of samples' value that is it passed, and any value that is passed after that is ignored. This value can only be changed or updated if the program is stopped and restarted, which matches the behavior you are seeing.
What you will want to do is get rid of the DAQ Assistant and replace it with the lower level DAQmx vi's. To help you out with this you can find examples of DAQmx code by going to Help»Find Examples and then to Hardware Input and Output»DAQmx»Analog Measurements»Voltage.
Let us know if this helps.
Ben
Applications Engineering
National Instruments
01-21-2009 12:39 PM
Hey Eric,
For some more information on how to use DAQmx commands instead of the DAQ Assistant, you might want to take a look at the tutorial that can be found on our website. DAQmx
Ben
Applications Engineering
National Instruments
01-21-2009 03:55 PM
Thanks,
I replaced the DAQ assistant, and it works perfectly now!
<>< Eric