SignalExpress

cancel
Showing results for 
Search instead for 
Did you mean: 

Capturing only one sample after analog trigger on a PXI4461 in Labview SignalExpress

Solved!
Go to solution

----- Repost from the LabView forum where this thread does not belong-----

 

Hi

 

I capture two waveforms (external excitations) with my PXI446, one on each AI. I use one of them as an analog trigger (rising edge @ some voltage), lets say AI0. I need the value of AI1 at the time (or fixed # of dt's afterwards) when the trigger occurs. I need just that one sample.

 

(Practically I use the 4461 as sample & hold circuit that has AI1 as an input signal and AI0 as the "sample" signal.)

 

Currently, I use a "subset and resample" step with a very small dt and it seems that it works but I dont like it.

 

The procedure above is within a conditional loop that collects 100 of these samples (acquire signal triggers 100 times) and produces a statistic of this ensemble (using the Statistics step).

 

Is there a better way to do this?

 

 

Thanks,

 

Aleksandar Andreski

0 Kudos
Message 1 of 11
(8,479 Views)

Hi Aleksandar Andreski,

 

First of all, it would be better to post you LabVIEW code over here, if you want us to judge your current situation. Based on just text, it is quite hard to verify LabVIEW code 😉

 

If you want example code on how to implement analog triggering, a lot of examples are already on your computer: in the NI Example Finder (open LabVIEW and in the Splash Screen, you will find the link "Find Examples").

 

In the example finder you will find examples like:

  • Hardware Input and Output >> DAQmx >> Analog Measurements >> Voltage >> Acq&Graph Voltage-Int Clk-Analog Start w Hyst.vi.
  • Hardware Input and Output >> DAQmx >> Analog Measurements >> Voltage >>Cont Acq&Graph Voltage-Int Clk-Analog Start.vi.

 

These examples show you how a lot of functions in LabVIEW work.

 

Please let me know if this does not answer your question. If you need further assistance, please post your code as well, then we can review it.

 

Best regards,

Peter S

0 Kudos
Message 2 of 11
(8,411 Views)

Hi Peter,

 

Thanks for your reply.

 

My question boils down to a very simple one: (how) can I acquire just one sample after an analog trigger signal in SignalExpress?

 

Putting 1 sample in the "number of samples" box will report an error. With 2 samples it works, but not with one. 

 

(The SignalExpress project file I can attach but I am afraid that one wont be able to see the tree for the forest as I added many other things in the project since I asked the original Q above.)

 

Greetings,

Aleksandar

 

 

0 Kudos
Message 3 of 11
(8,408 Views)

Hi Aleksandar,

 

That's one huge mistake I made... I'm sorry for the confusion... I was really thinking in LabVIEW terms, and not in LabVIEW SignalExpress (LVSE).

 

If I look at LVSE, it should be possible what you mention, but how did you configure the DAQmx Acquire task?

 

I've just done a test (without the actual hardware), but this proved to be working with the following timing settings:

Acquisition Mode: Continuous Samples

Samples to Read: 1

Rate (Hz): 1

 

This does not sound logical; Acquire N samples seems to be more logical to choose, but this will result in the error you mentioned (a minimum of 2 samples is required).

 

Please verify that you've choosen the above timing settings. If so, please post your LVSE project over here, including the version number of your LVSE.

 

Best regards,

Peter S

 

0 Kudos
Message 4 of 11
(8,394 Views)

 Hi Peter,

 

I have attached a simple project file that captures the gist of what I want to do. I have LVSE 3.5.0 and the device is a PXI4461.

 

It is a stimulus-response type of setup: a 4-point resistance measurement of a non-linear device. Ai0 measures the current sent to the DUT and AI1 measures the voltage across the DUT. AO1 provides the stimulus (~1kOhm in series). The stimulus is a simple triangle wave.

 

I want to know the current through the DUT at the moment when the voltage on the DUT crosses a given value, say 10uV:rising. The point is to make a statistic (mean, sigma, max/min) of the value of the current across a large number of these 10uV:rising crossing events.

 

When I choose "Contonuous Samples" and the number of acquired samples is small, then the triggering does not work at all. Here I suspect that N has to be large enough for it to always capture the portion of the signal's period where the trigger condition occurs.

 

If I use "N samples" then the triggering works but I need to acquire at least 2 samples. This seems logical to me since the analog triggering circuits in the 4461 are in fact triggering on the digital data leaving the ADC and they would need at least 2 samples to determine the "direction" of the slope: rising or falling.

 

I now use "N samples" and N=2. The "Statistics" block afterwards seems to accept these 2 samples as two consequtive events. I am not happy with this obviously. I just need thet one sample immediately at the trigger.

 

If I can just drop the second sample in the case "N samples" with N=2, it will quickly solve the problem. 

 

 

Thanks,

 

Aleksandar

Message Edited by alek_a on 06-02-2010 04:39 AM
Message Edited by alek_a on 06-02-2010 04:40 AM
0 Kudos
Message 5 of 11
(8,390 Views)

Hi Aleksandar,

 

It's not quite logical that you need 2 samples to determin the edge type...

 

If you're using Analog Triggering, you're setting specific hardware to generate a trigger if something happens (rises above / falls below a certain point). This hardware has nothing to do with the general timing information used for sample rate, # of samples to read, etc.

 

In your program I see you're using a sample rate of 1Khz. Have you tried the program with the settings I mentioned (Continuous; 1 sample to read; 1Hz)?

 

Regards,

Peter S

0 Kudos
Message 6 of 11
(8,384 Views)

Hi Peter,

 

Since I am also generating a signal on the same device (a 4461), the sample rate of the AI's and the output rate of the AO's must be 2^n multiples of each other. Hence I can use 1Hz but my AO rate then must be 2^n Hz. 

 

However, the minimum input sample rate of the 4461 seems to be 31.25Hz as written in the error message when I put a lower number (say 1Hz). So, I use this 31.25Hz for the AI rate. But the AO rate cant be smaller than 1K as demonstrated in an error message. The excitation frequency I choose to be less than 1Hz, say 0.1Hz.

 

To check whether the triggering works, I now use "Contonuous samples" and an N=200. But the triggering does not work: waveform simply "rolls"on the graph. This is so unless I make AI_rate*Nsamples=excitation_frequency*Q (Q integer), when the waveform does not roll but this it is not due to triggering - it is simply synchronisation due to the shared master clock of the AO and AI. Quite often I also get error message 200278 from the DAQ assistant. When I choose N=1 in this situation (as close as possible to your reccomendation) the numbers that I get are random, again indicating that the triggering does not work.

 

However, even if I make it work with such a low sample rate, it is not usefull to me since I need to measure much faster.

 

Using "N samples" triggers correctly and I still think the best will be if I just have a way (with some of the tasks in SE) to get rid of the second sample in the "N samples" N=2 situation.

 

 

Greetings,

Aleksandar

 

 

0 Kudos
Message 7 of 11
(8,379 Views)

Hi Aleksandar,

 

I've been looking into this, but I could not find a perfect solution in LV SE.

 

There is a function in LV SE called "Subset and Resample". If you choose this function, you can get a subset of the original acquired samples, but I was not able to make this the first of 2 samples (I always got the second sample, whatever I tried....).

 

Another option would be implementing a LabVIEW VI that deletes the second sample.

 

Best regards,

Peter Schutte

0 Kudos
Message 8 of 11
(8,327 Views)
Solution
Accepted by topic author alek_a
Hi Peter,

Thanks for your answer.

I am also thinking the same: better do this in LV rather than SE-LV. I tried the "subset and resample" function before but as you say it cant be made to select only one sample. Moreover, the overhead in SE is greater than in LV and so it slows down the other parts of the measurement that I would like to do (ex. a conditional loop).

I will probably make an LV task.

BTW, if I use LabView Realtime, can it execute said loops faster?

Greetings,
Aleksandar
0 Kudos
Message 9 of 11
(8,313 Views)

Hi Aleksandar,

 

LabVIEW (LV) is the environment in which all functionality for LabVIEW SignalExpress (LV SE) is developed. You can see LV SE as the Express Version of LV. Nice to do a quick measurment, but in terms of complexity not quite useful.

 

If you look at the performance, LV would be much better than LV SE (if you have programmed it well). LV Real-Time (LV RT) in itself does not provide performance. It provides reliability (i.e. constant loop timing).

For LabVIEW Real-Time you need a Real-Time target which can be a small controller with lower performance hardware, but also a Desktop Computer or NI Computer (PXI) with high performance hardware. If you choose the latter option, the performance will be better and more reliable than with LV for Windows.

 

For your information, I've added a link below that can provide you with information regarding Real-Time:

Real-Time Hardware & Software: http://www.ni.com/realtime/

 

Best regards,

Peter S

 

0 Kudos
Message 10 of 11
(8,309 Views)