From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Signal Generators

cancel
Showing results for 
Search instead for 
Did you mean: 

Set the output of "paused" triggered wave to zero

Solved!
Go to solution

Hi There!

I only started to work with Labview and may not use the correct terms to discribe the problem. I hope is still understandable.

 

I generated a wafe (analoge), and its output is contolled by a (labview) trigger which pauses the wafe output while the trigger signal is low. This works fine but now I want to set the idle value during the pause to zero even if the last sample of the wave has a non zero value. I did not found an option for that.

 

I thougth allready about making a case structure which outputs a the wave or just a zero depending on the level of the trigger.  (here is an example for that: http://forums.ni.com/t5/Example-Programs/DAQmx-Function-Generator-with-Analog-Output/ta-p/3517574)

But as far as I understad this would meen I can not use "on board memory only" which would mess up the already existing code.

 

 

While searching the intrnet for solutions I found that "abitraty wave generator" with the use of the bursed trigger may solve my problem (http://www.ni.com/white-paper/5534/en/) But I think the hardware I am using is not fit for abitrary wave generation..?

I use a cDAQ 9178 with an AO+-10V NI9264 At least I had problems 

 

I hope that I just overcomplicate things and overlooked a strait forward solution for the issue. 

I am greatfull for all of you Ideas!

Tanks!

0 Kudos
Message 1 of 6
(4,547 Views)

Hi Angela,

 

two questions:

How fast do you need to put the output to zero? Is in the order of 5-10ms ok for you? If not, software timing wouldn't be an option anyway.

Could you post that part of your code? Then I could have a look into the VI and take look.

Cheers,

Niko

Niko NR
Systems Engineer, National Instruments
0 Kudos
Message 2 of 6
(4,519 Views)

Hi Niko!

 

Thanks for the reply!

We allready trigger like this, so time is not the problem, the problem is that the signal is not zero during paus but the last sample value.

 

So here the triggering works timing wise.

I tried to simplfy the currently used code.  I replaced the I/O with simulated ones so the program can run. Dose it work for you like this?

 

Thanks a lot!

Angela

0 Kudos
Message 3 of 6
(4,514 Views)

Hi Angela,

thanks for sharing the code. 

Have you had a look at something like this:

 

Solved: Re: How can I pause and resume analog output using DAQmx? - Discussion Forums - National Instruments
http://forums.ni.com/t5/Multifunction-DAQ/How-can-I-pause-and-resume-analog-output-using-DAQmx/m-p/1...

 

So my question is: how long is you trigger that pauses the measurement? 

Because if it is rather long (and swithcing behavior to 0 is ok in a couple of ms), the fastest solution that I see is that you terminate the task and start a new one with an output of 0V. This is not really elegant, but I will look into it and hopefully find something else. 

Please give me some details about your pause trigger: how often does it come and how long are the pauses and how fast do you need to switch to 0V?

Cheers, Niko

Niko NR
Systems Engineer, National Instruments
0 Kudos
Message 4 of 6
(4,495 Views)

Hi Niko,

Sorry for the late reply I had to tried some stuff and here is the result of it:

 

Thanks for the tip. Sadly "pause" dose the same as "stop", it just outputs the value of the last sample while stoped. I put the code here anyway (- stop and go).

 

I also tried to switch between two waveforms  with a case structure, this works in principle but is too slow. The time between the rise of the trigger and the response of the output is 220ms (measured with the oscilloscope). Can it be that I did something wrong with the loops and the loop is waiting for something? 

I also put the code for this approach here (- case).

 

The trigger is "on" for several ms and "off" for a time between couple of 100 ms and half an hour. It should be zero in around 100us if possible, but seeing how long it takes in the moment this seems impossible 😞 

 

Determining the task is not possible with the other part of the code because synchronization between the to be triggered waverforms is currently quite complicated since there outputs are analog and digital. The synchronization has some chance to be wrong and we solve that by "resetting" until it is ok and than not touching it for the rest of the run (several days) I know this is dirty but my colleges tried for a relay long time to fix it and did not succeed.  

 

Do you have an Idea how I can make the switching between waveforms faster? Or do you think determining is my only chance?

Thanks!

Angela

 

 

 

0 Kudos
Message 5 of 6
(4,476 Views)
Solution
Accepted by topic author NI-Angela

Hey,

 

i found a solution for my problem! I could not solve it with LabView but I still post it here for people which may encounter the same problem in the future. 

I bought a SPDT switch and use it to switch the signal of an on as i want it.

Currently I am using this switch: http://www.farnell.com/datasheets/2046236.pdf?_ga=1.248261895.1629778033.1488200800  DG419 form Vishay.

 

So my triggering signal is a TTL signal between 0 and 3 V, by conecting it to the "in" pin I can open and close the connection between "D" and "Sn". This leads exactly to what I want, the signal is transmitted during the high phase of the TTL signal and is zero during the low phase of the TTL signal. 

 

The Software version of this solution was just far to slow to be useful, and solving it with hardware just took a few minutes since I had a had a power generator at hand. 

 

Thanks for your input!

Have a nice Faschings day,

Angela

 

0 Kudos
Message 6 of 6
(4,450 Views)