07-26-2007 10:01 AM
No it won't. I can generate counter output with any of these examples, in a continuous, finite mode, but not upon a software condition. It is not a problem that the counter output is not generated, but that there are more than one output coming out once the trigger is found. That is the behavior of the acquisition / generation when the reading of the samples is set the way Dave proposed: reading one sample first to initiate the waveform and then reading all available samples and (it is my understanding) the amount of samples read is determined by the wait.vi. When reading is done in a proposed way, the trigger seems to work fine, triggers reliably every time the threshold is found.
In an another attempt (program attached), when simply reading the samples without initiating the waveform, the counter output - one desired pulse - is generated promptly after the trigger is found, however the trigger seems not to be reliable and I am not sure if that has to do anything with having the generate output voltage in the same while loop. I tried changing the numbers of samples to be read, value in the wait time vi, the length of the counter output pulse etc, however in no circumstances the triggering and/or generation is reliable. Also, when specifying the read all available samples in this read vi, the message Error -20315 occurred at ma_Check Waveform Timing.vi is generated saying that: Analysis: The waveform dt parameter is <= 0. The trouble is that there is no easy way (or i don't know it ) of seeing what is really going on on the hardware level.
I've been working for months on this problem, communicated with the NI support engineers over the phone etc, and still don't know if this is even possible to do. I would really like to know if it is not why not? Perhaps you can figure out how to generate an output voltage signal upon a software trigger in a reliable and repeatable way and put it in the example finder so that other people do not struggle the way I am. Also it would be nice to have a way of graphing the output signal and observing it on the front panel along with the input signal.
Thanks, Branka
07-26-2007 10:35 AM
07-26-2007 03:48 PM
Hi Lynn,
When I said the triggering is unreliable, I meant it fail to trigger on a signal which clearly meets the triggering specifications (I believe so). I am importing a sinusoidal waveform from the signal generator 1V in amplitude, 0 offset, 1 Hz frequency and I set the level to 0, falling edge, hysteresis 0.2 (one of the scenarios - I played with the various frequencies etc). The trigger fails to respond in a random fashion and I can't quite say the percentage of the failing triggers, but anywhere from 20% to 70 % (my guess) definitely very, very high. Actually, the trigger vi seems to respond more often when samples to read is set to 100 ms than for smaller numbers, but i can't quite tell you what is the variation in the time response. I was wondering is there a minimum number of samples that are required for the Basic Trigger Level Detection.vi to work well?
The counter output is supposed to sent a voltage pulse to the driver to start the pump, and it is highly undesirable to miss the trigger. We can tolerate the variation in the response time between 0 to 30 ms, but not much more than that. The incoming signal would be a pressure signal (similar to the one I attached in the first question) and is of frequency 1 to 2 Hz.
I have changed the AI Read to be 1 channel N samples (thank you for pointing that out) and it did not improve the triggering function, but now it is possible to read all available samples as well - however with this option - no trigger is detected????
I guess I was trying to see if generation is done so that that does not affect the reading - I removed it and that did not help either.
I was looking into hardware timed single point acquisition earlier as it is recommended for the control applications, but i did not know how to accomplish data processing (measuring the integral under part of the waveform etc.) in this case.
If you have any recommendations, I would really appreciate,
Branka
07-27-2007 06:53 AM
07-27-2007 06:59 AM
07-27-2007 10:41 AM
07-27-2007 11:36 AM
Lynn,
Thank you very much; this clarifies some of my thoughts about labview data acquisition. I will try to follow your suggestions and hopefully will have better luck.
Branka