07-30-2015 09:17 AM
Hi!
I am having difficulty at pausing an acquisition signal.
Attached are the vi I use: the "INIT_SCAN" is the first one, then come "GET_SCAN" and "CLOSE_SCAN". I believe the modifications I need to do should only be done in INIT SCAN but I attached the others just in case.
My NI card: NI USB-6353, USB X Series.
Here's my problem:
So far I have been able to pause the analog output signal and I would like to pause the counter output whenever the analog output is on pause, so that I don't read any information during that time. Unfortunately I couldn't find anything that works.
The first counter (CO) I use is the one that creates the gate of the second one (CI), and the second one counts the pulses received by my photodetector.
My problem seems to come from the very nature of the counter, because I can pause an analog input at the same time I pause my analog output without any problem. To do so, I just share the sample clock of my analog output with my analog input (-> second line of my INIT_SCAN.vi).
I tried to use a sample clock instead of an "Implicit" timing for my counters (I tried on both counters, on the model of my analog input signal) but it didn't work, including with "Continuous Samples" (I read somewhere that I needed continuous sampling to implement a pause on a counter..?).
The error was happening in the GET_SCAN.vi, at the start task of my counter and LabVIEW suggested: "Set the buffer higher to zero, do not configure Sample Clk Timing or set Sample timing type to On Demand".
I followed these suggestions and added a buffer of size "1000" right before the start task and put the "On Demand" mode to the Sample Clock of my CO, but this only shifted the problem from the start task of the CO to the reading task of the CI.
I also tried to directly use a pause trigger property node for my counter but it did not work either. What I discovered is that LabView seems to "accept' digital pause trigger but not analog pause triggers for counters.
So I could sum up my problem like this:
1) What I think should be best is to pause the gate of the counter input, which is why I focused on the counter output. Should I instead focus on the timing of the counter input itself?
2) Is there a way to synchronize my counter output with my analog output signal the same way I synchronized my analog input? (hardware)
3) If not, is there a way to pause my counter "independtly" (using a property node most likely) with an analog signal?
If I didn't give all the information needed, please tell me,
Hope any one can help
Thanks a lot for your time,
Estelle
07-31-2015 03:37 AM
Hi Estelle,
At that point it is pretty hard to make out anything out of the VIs you have sent. I do not really understand how the 3 VIs are related together, and most of all, why this very simple program is already divided in 3 parts. I suggest you send us a zip containing the project itself and your main VI, or at least the VI calling your 3 subVIs so we can have a bigger picture.
I also believe that you do not know the function merge errors or that you do not understand the dataflow principle.
For exemple, your code :
Should look more like this :
Have a nice day,
Junior
07-31-2015 04:37 AM
Hi Junior,
Thank you for your answer
Indeed I do not know the function merge errors nor the principle of dataflow. The code I am using has been made by someone else and I am only trying to add the pause. Is that merging function something I should always try to use? Does it improve the way the program works?
Attached is the vi that calls the 3 subvis. It is the main vi of the project.
You will see that it is a bit of a gasworks, I hope you will find what you need to have a better picture of the project. If you prefer having all the project with all the subvis tell me and I will attach them. The vis called in the whole project are spread out in different files and I would have to select the ones you need which is why I did not attach them here.
In the main vi, you will find a case loop with a large number of cases. The ones that really matter in my case are: [0]: "Start": Value change and [1]: "Start live"
In those 2 cases you will find the squares for INIT SCAN, GET SCAN and CLOSE SCAN