LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing signals coming from 2 analog input channels

Hello, 

 

DAQ hardware: USB 6009.

 

Problem: Synchronizing signals coming from 2 analog input channels

 

I am using 2 analog input channels on the USB 6009, one channel recieves signal from a function generator. (a square pulse with set amplititude and variable frequency). The square pulse acts as a trigger as a result of which the second signal is obtained.

 

Every rise and fall in the square pulse results in a signal being generated (from the second channel) that is, a signal is generated for the rising edge and a signal is generated for the falling edge) 

 

Goal: My goal is to acquire data at each of this rising and falling transactions of the function generator. 

How do I synchronize this?? so that I can get the data that is specific for every transition?? 

The acqusition is done for 50 such transitions of the square pulse. I figured, as the time taken to complete the 50 transactions depends on the frequency of the square pulse - using the timing of sample clock VI would not be efficient?

I did look into the trigger VI, it allows me to pick only one of the edge, either falling or rising. I want at both, falling and rising. How do I go about this?

 

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

This discussion is a sub set of a project, that is being discussed at this page.

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

I think that your hardware doesn't have the triggers that you need to acquire data in this form.

 

1 Alternative is to post process the data looking for the edge and grabbing that sample.

 

Your alternative is a https://www.ni.com/en-us/shop/model/usb-6341.html Which might hurt your budget.

 

You can trigger all sorts of things.

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 3 of 11
(3,678 Views)

Hello Timmar, 

 

Thanks for the reply, but I dont quite understand by - hardware not having trigger. 

Post processing data would mean I wont be acquiring it it real time. or there will be a delay - which might result in a timing issue. Wouldnt it?

 

The alternative sounds like a good idea as well, but I wanted to keep that as my last option. 

 

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

The Data acquisition modules have uses timers and triggers, some are native some are external sources.

 

The Low end devices are notorious for not supporting these features.

 

In a higher spec device you would wire your sig-gen into a digital PFI line which would clock or trigger your analogue subsystem.

 

The advanced devices also have an "APFI" line that you can set up a treshold trigger (uses a DAC and a comparator) to start/trigger/clock data samples.

 

iTm.

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
Message 5 of 11
(3,646 Views)

Hello, 

 

I had a question Regarding the topic of discussion, Based on my understanding I tried to generate a block diagram, I wanted to know if I am thinking in the right direction. - My Hardware is still the USB 6009. 

Attached is the VI, The goal is to acquire a signal generated  (channel 2) corresponding to the rising and falling edge of each transition of the function generator (coming in through channel 1). 

 

Is my use of the trigger function correct?
Can I wire 2 Trigger Functions as shown in the VI - Labview did not give out any error. If I cant, the can I use a case structure (presuming the use of my Trigger function is correct) to acquire the signal at each edge

 

Please Help,

 

Thank You

0 Kudos
Message 6 of 11
(3,593 Views)

https://forums.ni.com/t5/Counter-Timer/How-to-connect-Trigger-USB-6009-on-a-flowmeter/td-p/1072600

 

This any help?

 

It hints that you can use a PFIO line to trigger the start of an activity, but not as an external clock source.

 

What is the time between pulses?

 

 

I don't have LV2013 so I can't see your code.

 

The best I can offer is Analogue acquisition, single sample, using a dual edge Digital trigger -  The analogue sample will need to be configured as re-reiggerable (Requires a property node I think).

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 7 of 11
(3,585 Views)

https://forums.ni.com/t5/Multifunction-DAQ/usb-6009-reference-trigger-using-loops/td-p/2701111

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 8 of 11
(3,584 Views)

https://www.ni.com/docs/en-US/bundle/usb-6008-6009-feature/page/introduction.html

 

Page 15 has an interesting note about how to use the Digital Trigger,

 

Says only 1 edge.

 

Is it possible to double the frequency of your sig-gen to get the same polling requency on one edge only

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
Message 9 of 11
(3,583 Views)

Hello Timmar, 

 

Thank you for your reply, I did look into the links - they did confuse me a little but from what I gathered this link deals with generating a trigger using the PFI0, that is not supported by the USB 6009. 

 

Pg. 15 of the datasheet of USB 6009 - tells me how make the Hardware trigger. In my case I want to make sure my external trigger and the data I am acquiring from the channels are aligned- that is, I am not writing the crap data but the data that is generated at every rising and falling edge of the pulse alone. 

This link however I feel is closer to what I am looking for. Point 2 in the accepted solution  suggests what you did earlier - to post process the data.

In my case my function generator pulse is the trigger, the point where I am lost is, I want to accquire data at both the rising  AND falling edge of the function generator signal.  How do I do that.? Can I use a marker to detect both the rising and the falling edge of the function generator and store the data acquired at each edge as suggested in point #2?? 

 

The VI's available in labiew - the DAQmx Start trigger, the basic level trigger detection VI only show detecting either the rising or the falling edge but not both. is it possible for me to use a case structure or a stacked sequence to execute rising and falling edge??

 

I have attached screen shots of my Block diagram 

 

Thank You

0 Kudos
Message 10 of 11
(3,542 Views)