LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multi-devices synchronization problem with Analog input and quadrature measurement

Hello,
 
In my welding application, I use a S series DAQ card (PXI 6123 in slot 2) to capture analog signals, and a M series DAQ card (PXI 6221 in slot 3) to do quadrature displacement measurement. I try to synchronize these two cards with error data flow.
 
When I use digital start triggering, the displacement waveform seems correct.
 
However, when I change to analog start triggering, the displacement waveform seems incorrect.
 
I am attaching the screenshot and the VIs to this post. Any help and comment will be very appreciated.
 
Thanks,
 
JSInc
0 Kudos
Message 1 of 10
(3,234 Views)
I forgot to mention that I am using DAQmx 8.6.1, Labview 8.5.
0 Kudos
Message 2 of 10
(3,211 Views)
Hi JSInc,

I am not exactly sure what I am looking at here.  When you do the digital edge trigger, what signal is connected to PFI0?  You are also doing two fundamentally different triggering types.  One is an edge trigger and one is a reference trigger.  With the edge trigger, it seems like you are acquiring 50ms of data after the rising edge comes in (the one that I'm not sure where it is coming from).  With the reference trigger, you are acquiring 40ms of data after and 10ms of data before the analog signal get's above 100.
You have it labeled as current, but the task is setup as a voltage task, so you are using a voltage trigger.  That might be an issue.

It looks like the trigger is starting the task too early so the displacement is still at zero when it is being acquired.  Is this correct?

If you could elaborate a little more on your application, I can help you much better.
Thank You,

Nick F.
Applications Engineer
0 Kudos
Message 3 of 10
(3,198 Views)

Hi Nick F.,

Sorry I did not explain my problem clear.

I setup a "current" scale in MAX, then I have a "current" task in my VI, which actually is a voltage task.

For the digital edge trigger, I wire the output of a relay as triggering signal to PFI0. When I set falling edge as triggering edge, the close action of the relay will start the DAQ. It seems in this way I can get my VI working now.

 

My problem is that some of my welding equipments dose NOT have a relay output can do digital edge trigger, so that I have to trigger the DAQ by "current", it is actually a voltage trigger. When I use reference analog window trigger, the counter task starts too early (or too late) so that the data acquired is almost zero.

After my last post, I spent more time in my lab, I found that if I use start analog window trigger, the VI acquired displacement data at the right moment as expected.

Back to my question: Is there anyway to use reference analog window trigger in my application?

Thanks,

JSInc

 

 

 

 

 



Message Edited by JSInc on 05-13-2008 04:32 PM
0 Kudos
Message 4 of 10
(3,188 Views)
Does anybody know whether I did something wrong in the program or this is just how Labview works?
 
Thanks,
 
JSInc
0 Kudos
Message 5 of 10
(3,134 Views)

Hello JSInc,

 

I think I have a couple suggestions that will help you adjust your timing so that you can get the data you want.

 

1.  When you run the DAQmx Start Task VI for the counter it will begin incrementing from its default value.  However, until your analog input task is running, none of the values from the encoder will be read since you're using the analog input sample clock as the counter sample clock as well.  This brings me to my second point:

 

2.  The behavior of your analog input task is fundamentally different when you configure a start trigger and an analog window trigger.  Since I'm not sure which you actually want, I'll describe the behavior of both.

a. Start trigger:  When you use a start trigger, calling a DAQmx Start Task VI puts the task into the state of waiting for the start trigger--at this point the sample clock is not running because the task hasn't been started.

 

b. Analog Window Trigger:  This is a reference trigger and determines which values to save.  When using this type of trigger the DAQmx Start Task start the sample clock and the task is continually acquiring samples.  With this type of trigger the task uses a circular buffer with a size equal to the number of samples to acquire.  Then, when it receives this trigger is saves the pre-trigger samples and acquires enough post-trigger samples to fill the buffer.  The difference here is that the counter is continually buffering samples until the task is stopped.

Depending on what you're trying to do there may be a better way to implement triggering.  In particular it would be helpful to know the following if the above descriptions aren't clear:

1.  Do you want synchronized samples (same rate and start) from the analog input and counter input?

2.  Do you want the same number of samples from both?

3.  Relative to your external trigger when do you want these samples?  All post-trigger?  Some pre-trigger?

4.  Also, you mentioned that you do not have a digital start trigger--what type of signal is your trigger?  Square wave, sine wave, other?  What is the amplitude of the pulse/signal?

 

With this information it will be easier to provide advice.  I hope this helps, and have a great day!

 

Cheers,

Brooks
0 Kudos
Message 6 of 10
(3,115 Views)

Hello Brooks,

Thank you for your input. My answers to your questions:

1. Yes.

2. Yes.

3. If you mean external trigger is digital start trigger, these samples I want are all post-trigger, since I can set my equipment to send out the trigger signal before analog signal comes. For analog trigger, I want some pre-trigger samples, doing so I will not miss any portion of analog signal.

4. For digital start trigger, it is the close contact of a relay sent to the PFI0. For the analog trigger, it is a voltage signal, the shape of the waveform is showed in the attachment of the first post, I am attaching it again in this post, I named it as "Current" in the screenshot. The amplitude of the voltage signal ranges from 0.5 to 2.0 Volts.

Again, I really very appreciate your help.

JSInc

 

 

0 Kudos
Message 7 of 10
(3,108 Views)
Hello JSinc,
 
I think that the problem may be that you've selected an Analog Window Reference Trigger and not an Analog Window Start Trigger.  If you change this to a start trigger I would expect the behavior to be identical to using a digital start trigger.  Is this what you're asking or are you trying to do something more complicated?
 
Cheers,
Brooks
0 Kudos
Message 8 of 10
(3,083 Views)
Brooks,
 
You are right, if I use Analog Window Start Trigger, the behavior would be identical to using digital start trigger. But I will miss a portion of analog signal doing this way.
 
What I am asking is: Can we make it work with Reference Analog Window Trigger?
 
Thanks,
 
JSInc


Message Edited by JSInc on 05-22-2008 05:02 PM
0 Kudos
Message 9 of 10
(3,078 Views)

Hello JSinc,

 

It sounds like you want to acquire pre-start-trigger samples.  From what you've said it sounds like you have an analog input signal and encoder that you only want to sample when the analog input it is reading the voltages you see on the screen shots you've provided.  Essentially you want to implement a reference trigger on both measurements.  Is this correct?

 

If this is the case, I would recommend just doing a continuous acquisition and cropping your data in software.  In order to crop your data you can use the Trigger and Gate VI to implement a software reference trigger after you read all the data in.  To do this just start both tasks together and read continuously.

 

If you weren't also acquiring samples from your encoder I would recommend using an analog reference trigger to acquire the correct points utilizing the pre-trigger samples feature.  The issue with using this method in your case is that the sample clock is running during the entire acquisition so you would end up with continuous samples from the encoder and only the pre and post-trigger samples specified on the analog input and no way to know when they occurred relative to each other.

 

Cheers,

Brooks
0 Kudos
Message 10 of 10
(3,057 Views)