LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Trigger

Thanks again for this very fast reply! 🙂

 

The hardware does support the reference trigger.

–Chasis NIPXI-1031
–DAQ card NIPXI-4472B
–NI cardbus 8310
 
I've uploaded the latest version of the triggering vi.
I've read the example and adapted my program ( except for the trigger cursor vi).
When the program is running I still get the same error. It seems that the for-loop causes this error.
 
But when I delete the for-loop, the program doesn't work the way it was meant to be anymore. ( Reading 10k samples per second and displaying them at once untill 60k samples are displayed).
 
Is there anything else I can change to make it work the way it is meant to be?
 
 
Best regards,
Dries
 
0 Kudos
Message 11 of 44
(1,460 Views)

Hello Michiel,

 

Which error do you get?

 

At my side I get an error that is totally different from the ones you posted:


- The first one is caused by some impossible default values of your VI:

The Minimum Value should always be different from the Maximum Value.

Even in your default values.

- The second error I get is because of the combination of continuous acquisition with reference triggers (Error -200358 occurred at DAQmx Start Task.vi:1), which is one I would expect with that combination.
Please let me know if this is the error you get?

 

Please also include a MAX Report of your system.

This will allow me to check your software set-up.

 

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 12 of 44
(1,448 Views)

Hello again,

 

I'm afraid I didn't upload my most recent version.

In attachment you fill now find the most recent version 🙂

 

I've added a Simple MAX report, I hope this is enough.

 

After running the vi, I still get the same error:

 

 

Error -200279 occurred at DAQmx Read (Analog 1D Wfm NChan NSamp).vi:1

Measurements: Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.

Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.

Property: RelativeTo
Corresponding Value: Current Read Position

Property: Offset
Corresponding Value:


Task Name: _unnamedTask<2>

 

 

Best regards,

Dries

Download All
0 Kudos
Message 13 of 44
(1,443 Views)

Hello Dries,

 

I don't fully understand what you're trying to do with this implementation code.

 

- You want to iterate your for loop 6 times?

- In each iteration you want to read out 10000 samples per channel (in the for loop) at a sample rate of 10000 Hz?

- Then why do you specify in your "samples per channel" control 10000?

If you're in the "finite samples" acquisition mode, then the "samples per channel" control should equal the total amount of samples you want to acquire (so 60000).

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 14 of 44
(1,429 Views)

I see, if you put it that way it makes sense...

 

I will try this as soon as ou hardware is available again!

 

I do have one more question about an expansion of the program I have made, but perhaps I should post this in a new thread.

 

A lot of thanks for your help!

 

 

Best regards,

Dries

0 Kudos
Message 15 of 44
(1,417 Views)

Hello Dries,

 

As long as it has a link to the details described over here you can also post it over here 🙂

Please let me know if anything still goes wrong when you can access the hardware..

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. 😉
0 Kudos
Message 16 of 44
(1,389 Views)

Hi Thierry,

 

I've tested the latest program today. I wish I could say that it works just fine but it doesn't.

What is wrong:

1) Instead of "contineously" ( read once per second) updating the chart, the chart is updated just once at the end of the measurements ( after 6 seconds).

2) The measured values are much smaller and with much more noise than the values obtained without the reference trigger.

3) In about 60% of the times I press "Start", I still get the error written below. In the other 40% the program works ( but not the way it is meant to be)

 

The error:

Error -200279 occurred at DAQmx Read (Analog 1D Wfm NChan NSamp).vi:1


Possible reason(s):

Measurements: Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.

Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.

Property: RelativeTo
Corresponding Value: Current Read Position

Property: Offset
Corresponding Value:


Task Name: _unnamedTask<24>

 

 

I've added the latest version in attachment. Hope you can help me out.

 

Furthermore, I have some other questions:

- Is it possible the change the Display Format of the x-axis into seconds? I don't need the time/date stamp. The only thing I need on the x-axis is the time for which the program has been running since the trigger was activated.

- Is it possible to temporary stock the measured values into an array ( Dimension nx2) so that later on I can still use the measurements for further calculations? I would do this using the 'initialize Array' command, but the types do not match.

 


Thank you, in advance.

 

Regards,

Dries

0 Kudos
Message 17 of 44
(1,378 Views)

Hello Dries,

First of all I would like to note that the program in attachment does not seems to be your latest program.
You seem to be still using the reference trigger in combination with continues samples option.

By definition a reference trigger is a finite acquisition so as written in your the VI in attachment (continuous acquisition) it will not do the trick. Based on what you explain you however seem to have changed it to finite samples at your side.

First some feedback about your comments:
1) Instead of "contineously" ( read once per second) updating the chart, the chart is updated just once at the end of the measurements ( after 6 seconds).
->This is also what I saw at my side, but I didn't get any error (in the simulated version).
If this is not what you want to have, then we'll have to take a different approach.

2) The measured values are much smaller and with much more noise than the values obtained without the reference trigger.
-> I don't really see why this would be the case. Measurements should be the same independent of which kind of trigger you're using.

3) In about 60% of the times I press "Start", I still get the error written below. In the other 40% the program works ( but not the way it is meant to be)
-> This seems very weird. Let me start with another approach.

If you really want to have a measurement that seems continuous in how the chart gets updated in combination with a certain amount of pre-triggered values, then with this hardware set-up we'll need to take a different approach.

Although continuous data acquisition with pretrigger samples is not built into the driver as a default option you can implement this through a nifty work-around. Typically, most people use reference trigger with finite measurements, but there are ways to get around this.

The method I’m going to propose involves “counting the number of samples that have been acquired since the beginning of the acquisition until the start trigger arrives.
This will allow us to calculate back at which point the start trigger occurred.

I have briefly done this in a software wise way.

 

It's not perfect and also not a 100% complete. There are still some parts you should implement yourself.

If these are not clear than please let me know.

 

The attached Code is provided As Is.  It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments.  You assume all risks for use of the Code and use of the Code is subject to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

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 18 of 44
(1,367 Views)

Hi Thierry,

 

Apoligies for my late reply.

The program you made seems to do its job properly. Thank you! I do not fully understand how the program operates right now, but I hope to understand it soon.

However, as you said, it is not 100% perfect yet 🙂

 

I am trying to allow the user of the program the change both the trigger value and the amount of pre-triggered samples.

I thought you said something about using a 'circulair buffer'? I looked up some information about the circulair buffer in the Labview help, but it seems rather complicated to me as I do not fully understand how to use it.

Aren't there any other ( read more simple) solutions for this problem?

I unlcicked the 'View as Icon' property from the 'Trigger and Gate VI', but the 'trigger value' and the 'amount of pre-triggered values' are not listed with the inputs/outputs.

It seems the only way that I can find to change these values is true the properties of the Trigger and Gate VI. Could you tell me how else to change them?

 

 

Furthermore, I have some other questions:

- Is it possible the change the Display Format of the x-axis into seconds? I don't need the time/date stamp. The only thing I need on the x-axis is the time for which the program has been running since the trigger was activated ( in seconds).

- Is it possible to temporary stock the measured values into an array ( Dimension nx2) so that later on I can still use the measurements i.e. to save the entire array ( with all the measured values) to a file?

 

 

Thank you very much for the time you are putting into helping me.

I really appreciate it.

 

 

Best regards,

Dries M.

0 Kudos
Message 19 of 44
(1,336 Views)

Hello Dries,

 

The circular buffer is actually a relatively easily approach to your issue.

If you want to have trigger value and amount of pretriggered values programmable or accessible from outside the trigger and gate VI.

This one can (relatively) easy be created, but you you should best use a circular buffer.

Is there anything specific that is confusing you or that you don't understand about it?

 

Answers to the last questions

1) You can change the display format.

2) Yes, it is possible to store values in an array and then save it.

 

At which point are you stuck to do these 2 things?

Can you share the VI with your attempts to realize this?

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 20 of 44
(1,317 Views)