Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

can I generate a trigger with counter out put?

Hello,

 

I will be using a digital trigger (0-10V) as a gate for my counter  out0 and  a 100MHz timebase clock as my source for counter out0. I want it to generate finite pulse train or contineous pulse generation. I want to count the pulse/ticks and then after "nth"  pulse, I want to generate  a digital Trigger.  Is it possible ??

 

I am Using a USB X series 6353.

 

 Thank you very much.

 

Best,

pjkunwor1

0 Kudos
Message 1 of 36
(6,656 Views)

Hi pjkunwor1,

 

This example takes in a signal and, after the nth tick, begins a CO task (finite or continuous):

 

https://decibel.ni.com/content/docs/DOC-34901

 

Is this what you are looking for, or is there another piece of functionality I may have missed?

 

Best,

David R
Systems Engineer
National Instruments
0 Kudos
Message 2 of 36
(6,608 Views)

Hello David,

 

Thank you for your reply. Your answer is very helpful and guided me to right direction. But I am still not sure if it actually helps me in my overall application. Thats way I have explained my problem in detail below.

 

Problem  :- generate 4 sine pulses from 4 channels with 50us delay in-between using a single digital trigger form external hardware.

 

My detail understanding

Problem:-

I need to generate 4 single sine pulses from 4 different channel of my USB 6353. I just have a single (0-10V) digital trigger to generate these pulses. First channel should output a sine pulse as soon as trigger occurs, whereas remaining three channels should output  sine pulse with subsequent delay of 50 micro seconds between each other. I know Labview software delay is of millisecond.

Solution Approach: -

So far I am able to generate a single sine pulse output using a VI (VI Attached).

I have decided to use counter output.

Using counter output I want to generate finite pulse train or continuous pulse train. Count the pulse train and after "nth" pulse rain, provide a trigger to execute the same VI to output subsequent sine pulse.

 

Please help me whether I am going in a right direction

Thank you very much

0 Kudos
Message 3 of 36
(6,596 Views)

Hi pjkunwor1,

 

If I am understanding your application correctly, you are receiving a single digital pulse. That pulse needs to trigger 4 analog out waveforms on 4 channels each with a 50us delay from one another. One simple way to do this would be to have four synchronized analog out tasks with the master task receiving the digital trigger. You could write zeros for as much time as you want before each waveform actually begins. You can write the complete waveforms to the buffer before even starting the tasks. In other words, your output data would look like this after receiving the start trigger:

 

AO Channel 1: DATA

AO Channel 2: -----50us wait-----DATA

AO Channel 3: ---------------100us wait---------------DATA

AO Channel 4: --------------------------150us wait-------------------------DATA

 

Where DATA is your sine waveform.  The wait time would manifest as some number of samples written at a certain sample rate.  For example, if you were outputting at 1 MS/s, you would write 50 samples of zeroes and then write one period of your sine wave to the buffer for that task. Once you started the task (in synch with the rest of the AO tasks), your AO channel would put out 0V for 50us and then your sine wave.

 

You should not need to use a CO task, unless I am gravely misinterpreting some portion of your application.

 

Best,

David R
Systems Engineer
National Instruments
Message 4 of 36
(6,594 Views)

Hello David,

 

What you explained is exactly what my application is suppose to do. This was a great explanation of solution for my problem.

But I am fairly new with Labview and not quite sure how to implement those changes to my current sine pusle vi.

 

Can you please guide me towards helpful example or resources related to this problem??

 

And also If I successfully synchronized 4 channels, how to I get my channels to write zeroes before single sine pulse??

 

Once again thank you very much. I was struggling to approach solution before you explained this.

 

Best,

Pjkunwor

0 Kudos
Message 5 of 36
(6,591 Views)

For some reason I am unable to attach my VI here. I tried multiple times.

 

Best,

Puspa

SinepulseVi.PNG

0 Kudos
Message 6 of 36
(6,583 Views)

Hi pjkunwor1,

 

We have some helpful DAQmx examples in LabVIEW. These can be found in Help>>Find Examples>>Hardware Input and Output>>DAQmx. There is a Synchronization folder there which includes an Analog Input Synchronization example. It deals with synchronizing two channels, though you could easily add two slave tasks to get to four. 

 

To write zeros, you can configure a DAQmx Write block to either accept a 1D DBL or a Waveform, as shown below. Depending on which you choose (it really doesn't matter), you can wire in a 1D array of as many zeros as you want or a flat Waveform at zero for as many samples as you want to specify. You can either add your sine waveform to the end of the zeros before wiring into the Write block or just use a second DAQmx write block later on to write the sine waveform.

 

Untitled.jpg

 

Let me know if this helps!

David R
Systems Engineer
National Instruments
Message 7 of 36
(6,558 Views)

Hello David,

 

Thank you verymuch. I will keep you posted with my progress.

 

Best,

Puspa

0 Kudos
Message 8 of 36
(6,547 Views)

Hello David,

 

I just started on this problem again, since I was busy with some other stuff. I took your advice and got some help form Ni Examples. But I faced some new error.

At the moment I am just looking to generate two synchronized AO form two channels. Once I get this right I will implement 2nd (outputting zeroes to add delay) and 3rd (adding two more AO channels) part of problem.

 

I used my single channel AO VI and tried to change in to two channel synchronized analog output channels based on NI examples.

 

Looks like I have problem with my external trigger setup.

 

Please look at the image attached and direct me towards right direction.

Best,

pjkunwor1

0 Kudos
Message 9 of 36
(6,462 Views)

ImageA.PNGImageB.PNGImageC.PNG

0 Kudos
Message 10 of 36
(6,461 Views)