LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Trigger

I have two questions for the VI in attachment. I hope someone can help me 🙂

 

1° The trigger does not work properly: measurements should start whenever the given value ( "Level" * hammer sensitivity) is reached on channel 0. In fact, if I make the value almost 0, it still doesn't work.

 

2° The charts should have a "memory" of 6 seconds: ( 10kHz rate at 10k samples per second and chart memory is set to 60k ).

After plotting those 6 seconds the program should stop ( therefore I used a for-loop, but I'm not too sure what number I have to attach to 'N').

 

Any suggestions?

 

Thank you in advance.

 

 

Dries

0 Kudos
Message 1 of 44
(3,581 Views)

Hello Dries,

 

So actually you want to do a finite acquisition of 60000 samples on 2 channels  at a rate of 10kS/s.

The measurement should be triggered by an analog edge.

 

Seeing that not all devices support this type of triggering, there are still some important pieces of info missing.

Can you share with me the following information?

- Which DAQ device are you using? (this will allow me to do some tests at my side)

- What ranges (in voltage) do your measured channels have?

You can check this by doing a continuous measurement without triggering.

- Can you provide me with information about the transducers/sensors you're using?

- You talk about making the value almost 0 and that this does not work.

What happens if you do make it 0?

 

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
Message 2 of 44
(3,559 Views)

Hi Thierry,

 

Thank you for your fast reply.

Yes, that is excactly what I want to do 🙂

Here is the information you asked for:

 

Information about the device:
–Chasis NIPXI-1031
–DAQ card NIPXI-4472B
–NI cardbus 8310
 
Sensors:
–Accelerometer PCB 333B40 ( Sensitivity = 51.9 mV/(m/s²) )
–Impulse Hammer PCB 086C05 ( Sensitivity = 0.22mV/N )
 
I don't really have an idea right now about what ranges the measured channels have, nor do I have an idea what happens when I make the value 0 as I don't have the device with me right now. But I will post the information as soon as possible.
 
Hopefully you can already help me out a little bit with the information I gave you.
 
 
Thank you,
Dries
0 Kudos
Message 3 of 44
(3,552 Views)

Hello Dries,

 

Thank you for the info!

 

Once I know the actual measured values, we can help you further in the right direction.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
Message 4 of 44
(3,527 Views)

The range of the measured channels is between -10 and +10 Volts.

 

If I change the value of the trigger to zero, the program works ( but without triggering).

 

Apologizes for this late respons.

 

PS: I would like that, if I press the stop buttom and then the run bottom again, the chart display clears itself. Any suggestion about how I could do this?

 

 

Regards,

Dries

0 Kudos
Message 5 of 44
(3,515 Views)

Hello Dries,

 

Can you share the latest version with me?

It's not because your trigger value is 0 that you are not triggering.

 

Also please note the difference between the range of your measurement device and the actually measured values.

 

Are you measuring a few mV's, 10's of mV's, 100's of mV's?

 

Please take a printscreen of your measurement and share it over here.

A logged data set would also be perfect.

 

That "start stop clearing" can be easily done, but let us first fix the triggering issue.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
Message 6 of 44
(3,512 Views)

Hi,

 

I've made a few modifications and now the program ( with trigger) seems to work if only I put the trigger value low enough.

 

Could you perhaps tell me how to do the "start stop clearing"?

I've also read that it is possible to display an amount of pre-triggered values on the chart.

For instance when the trigger value is reached, the chart will display both the 'incomming' measurements AND the latest 10k samples before the trigger value was reached.

Does that make any sense? 🙂

 

Thank you again for the help.

In attachment you can find the working vi.

 

 

Best regards,

Dries

0 Kudos
Message 7 of 44
(3,492 Views)

Hello Dries,

 

The fact that you need a small trigger value is an indication that you're measuring small values, so that was what we expected.

 

To clear a chart you can just write an empty array to the History Data property (through a property node of that Chart).

Are you familiar with property nodes?

 

If you want to have pre-trigger samples, then for some devices you can use a specific kind of trigger type called a reference trigger (http://zone.ni.com/reference/en-XX/help/370466V-01/mxcncpts/referencetrigger/)

 

Of course it can always be useful to also know the other types of available triggers:

http://zone.ni.com/reference/en-XX/help/370466V-01/TOC12.htm

 

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
Message 8 of 44
(3,466 Views)

Thank you for your reply.

 

I don't know property nodes very well, but I already read something about wiring an empty array to the History Data property. The problem which occurs here is the following: if I create an empty array and I want to wire it to the History Data property of that Chart, the following error shows up:

 

Array element conflict:

The type of the source is 1D Array of Double, the type of the sink is 1D array of waveform.

 

I've tried to change the 'represetation' of the array, but the '1D array of waveform' type is not shown in the list.

 

 

About the reference trigger:

If I change the Trigger to a Reference Trigger, set the pretriggered samples to 1000 and run the VI, I get the following error:

 

Possible reason(s):

Measurements: Attempted to read a sample beyond the final sample acquired. The acquisition has stopped, therefore the sample specified by the combination of position and offset will never be available.

Specify a position and offset which selects a sample up to, but not beyond, the final sample acquired. The final sample acquired can be determined by querying the total samples acquired after an acquisition has stopped.

Attempted to Read Sample: 22362

Property: RelativeTo
Corresponding Value: Current Read Position

Property: Offset
Corresponding Value:


Task Name: _unnamedTask<8>

 

 

 

Now if I take a look at the Labview Help for Reference Analog Edge Triggering, I read the following:

"When you use a Reference Trigger, the default for the read RelativeTo property is First Pretrigger Sample with a read Offset of 0."

 

Does this mean that I have to use the DAQmx Read Property Node? If so, could you explain me how I have to use it?

 

Many thanks in advance,

 

 

Best regards,

Dries

0 Kudos
Message 9 of 44
(3,459 Views)

Hello Dries,

 

A waveform is not a simple numeric value, so you cannot change the representation of a numeric value to a control.
A waveform is a cluster that contains an array of numeric values combined with timing information.

- To easily create this array you can use to right-click context menus. (right click the History Data input and select create>constant.

- Otherwise you can also go to the waveform palette (Programming>Waveform) go to section Analog Waveform and in there you'll find the WFm Constant.

You can then create an array of this datatype and wire it to the History data input.

 

Regarding the reference trigger you should first check if it is supported in your hardware.

Then you should just search on the NI website for "DAQmx reference trigger" and then just observe the first example you find.

This will explain the concept.

 

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
Message 10 of 44
(3,453 Views)