01-29-2016 07:09 AM
Hello,
In my setup While loop should be stopped once input signal goes over a threshold.
Fig.1 - Block Diagram, Fig. 2 - Front Panel (running).
As you can see, input signal (red sawtooth) goes over 2.8V (threshold).
So comparator should wire and stop While loop. But it doesn't.
What is wrong in my realisation ?
Also a couple of additional questions:
Thanks in advance
Pavel
Fig.1
Fig.2
01-29-2016 07:13 AM - edited 01-29-2016 07:18 AM
Overall, i recommend you to NOT use the DAQ Assistant.
However, the question is how you configured the ADC DAQ Assistant:
Is it single point software timed or do you acquire waveforms?
If you acquire waveforms (which i assume), the error you are doing is to convert this to a single double value. That means that you only extract the (i guess) last value of the waveform which is obviously even less than 0.
Norbert
EDIT: To address your additional questions:
1.) The name of the waveform is as far as i know defined in the DAQ Assistant (your configuration). As i obviously never use the DAQ Assistent besides "Quick and Dirty Testing" i am not sure.
2.) Same answer as to why your loop doesn't stop with the signal going above 2.8 V. And please take a look into your image of the waveform graph: The last value of both signals is very close to 0, obviously a little below (esp. the red signal).
01-29-2016 07:17 AM - edited 01-29-2016 07:18 AM
If you want to learn how to "not use the DAQ Assistant", do a Web search for "Learn 10 Functions in NI-DAQmx" and read the excellent NI White Paper at that site. In addition to not using the DAQ Assistant, I also recommend that you stop using Signal Wires and use Waveforms (or Arrays of <numerics>) instead.
Bob Schor
01-29-2016 08:37 AM
Thank you for feedbacks.
Probably "DAQ Assistant" isn't adapted for the setup like mine ... I'll follow your suggestions and try with NI-DAQmx.
In the meantime I simplified my setup - removed DAQ Assistant and some other staff.
Now it looks like this (Fig.1) ... unfortunately I couldn't insert picture: feature suddenly disappeared ???
But Ok, I've put VI in attachment.
When I started to explore this setup, everything was OK - comparator fired event and while loop stopped once amplitude of sawtooth surpassed 2.8V and tank value changed in runtime according to amplitude and frequence.
But suddenly everything changed ... no more comparatoor firing, neither tank animation.
Whar could happen ?
Thanks.
Pavel.
01-29-2016 08:45 AM
I've found error in previous case: in "Simulate Signal" number of samples was grater than samples per second.
01-29-2016 08:45 AM
Pavel,
please use more descriptive VI names in the future.
The VI you attached includes "Simulate Signal" which creates a huge array of data. You simply check the last value, so the issue is the very same as in your original question.
What is the purpose of the whole stuff?
You cannot write some "controller" when working with large arrays as long as time delay is not an issue.
Norbert
01-29-2016 09:27 AM
Hello Norbert
Yes, you are right - the problem was in timing parameters of "Simulate Signal" block.
I've changed them in the original setup (with 2 DAQ assistant blocks) and now the original setup works.
What I did - I've merely changed the ratio saples per second / number of samples to be 10 (instead of 1 as before) in the "Simulate Signal" block.
Strange phenomena ... or probably I've missed something.
The purpose of all this staff is emulating of my testbend measurement control: there are 3 different analog outputs that generate slow (about 1Hz) sawtooth waveforms that consequently are applied to measurement testbend.
Under consequently I mean when 1st analog output is operating, all other output keep theirs default values.
Once input signal from measurement testbend is evaluated to a particular value, the value of 1st analog output is frozen and 2nd analog starts to generate sawtooth ... also until satisfying some particular condition on the input.
Once condition satisfied, 2nd analog is frozen and then 3rd output starts ...following a similar scenario.
Working on this example I'm trying to emulate (in simplified manner) the behavior or the real testbend operation.
Thanks
Pavel.