Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

use a digital trigger on Mseries board several times

Hi

 

I am developping a vi to acquire several AI from a Mseries 6229 board and store the data on a files.I want to trig the sampling from an external digital trigger.And I would like to sample data several times in a row without stopping the vi.

 

So far when I start the vi the trigger works fine the first time but I am unable to sample a second set of data without stopping the vi completly and restarting it.

 

I have tried to include a "DAQmx reset device" after the first acquisition but it doesn't help.

 

Is there a way to use theMseries digital trigger several times in a row ? (I have checked that it works with analog trigger on a Eseries board).

 

Thanks for your help

 

Félicien

0 Kudos
Message 1 of 11
(3,991 Views)

I'm not entirely sure I understand your application (the "analog trigger" comment near the end of your post threw me off a little), but I think what you want is to set the Start.Retriggerable property to True for your task.  This property can be found inside the DAQmx Trigger Property node under Start->More->Retriggerable.

 

If this isn't quite what you need, a little more explanation of your problem would help.

0 Kudos
Message 2 of 11
(3,986 Views)

Hi Félicien,

 

Chad would be correct that you could use the property node if you were on an X Series DAQ device.  However, on E and M Series the only retriggerable subsystem is the counters.  You may restart the task to rearm the trigger, but this would have the chance of missing a trigger signal while the restart was taking place.

 

If you have both counters available, the best way to implement the retriggerable AI task is to use the counters to generate a finite retriggerable pulse train to use as the sample clock.  The following two examples show how to do this for both Analog and Digital triggers:

 

Finite Retriggerable Analog Input using Digital Trigger -- I wrote this one myself so it should be good to go 🙂

 

Retriggerable Analog Input with Analog Trigger -- I didn't write this but it should work also.

 

 

If you have any questions don't hesitate to post back!

 


Best Regards,

John Passiak
Message 3 of 11
(3,971 Views)

Dear  Chad A and John P,

 

Thanks for your answers. I have tried to simplify my code to the DAQmx part and here is what I would like to do :

 

sample.JPG

Of course, this simplified vi is working fine ! I stop/start the task so the trigger works fine for both samples.

Now it is not working in my original code so I have to track down the problem in the code. Clearly, I am not doing what I think.

 

Could you just confirm that the code above is ok ?

 

Cheers

 

Félicien

0 Kudos
Message 4 of 11
(3,941 Views)

Well the previous simplified code was not exactly what's in my code. Here is a new one and this one is not working.

Have you got any ideas ?

 

sample2.JPG

 

It is the fact that I want to remove and re-add the trigger that is not working. I don't see what the problem may be.

Felicien

 

0 Kudos
Message 5 of 11
(3,939 Views)

Hi Felicien,

 

I tried running the following (I think this is the same as your code, but I am not 100% positive--my French is not very good):

 

2010-02-05_102353.png

 

Anyway, I didn't notice any unexpected behavior.  The code performs the following:

 

1.  Configure the task to use a Digital Edge Start Trigger.

 

2.  Acquire 100 samples after the first digital edge is received.

 

3.  Restart the task, but with no trigger (this takes several milliseconds).

 

4.  Immediately acquire the next 100 samples once the task has restarted.

 

5.  Restart the task, again with a Digital Edge Start Trigger (the restarting again takes several milliseconds)

 

6.  Acquire 100 samples after the Digital Edge is received.

 

7.  Stop and clear the task.

 

Is this the behavior you are expecting?  If you are seeing any behavior contrary to this, could you let us know what exactly is happening in your application?

 

 

Best Regards,

John Passiak
0 Kudos
Message 6 of 11
(3,917 Views)

John

This is exactly the behavior I am expecting.

However, in my application, the first digital edge is correctly seen and the first 100 samples are recorded.

Then the next 100 samples are recorded.

But the second digital edge is never detected although I use the same external device to send it on PFI0. The third "analog read" exits after timeout.

I use Labview 8.5, I have tried it on two PC, this is reproducable.

Does it make sense .

Félicien

0 Kudos
Message 7 of 11
(3,914 Views)
Note that the code you showed is working fine if I use a simulated device. But not with our M6229 boards.
0 Kudos
Message 8 of 11
(3,912 Views)

Well, I just noticed that you use finite samples whereas I used continous sampling.

Could it make a difference ?

I will try that on Monday (just left office).

Cheers

Félicien

0 Kudos
Message 9 of 11
(3,911 Views)

Hi Felicien,

 

I changed my code to Continuous and still get the same expected behavior.  I am running DAQmx 9.0.2, what version are you on?

 

Are you positive that there is a trigger signal on the line after the task is restarted?  Remember, the device will not detect any triggers while it is being reconfigured.

 

 

 

Best Regards,

John Passiak
0 Kudos
Message 10 of 11
(3,906 Views)