From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

Real Time Analysis of data from DAQ assistant

 

Hello, 

I'm using USB 6009 with the DAQ assistant to acquire my data. I use 2 channels on the USB 6009, Channel 1 is a square wave that goes from -5 to +5 V (2.3 Hz, 5k sampling rate; 1000 samples); Channel 2 is a bio-potential that is being recorded (5k; 1000 samples).

My channel 2 data is dependent on the transition of the square wave from -5 to +5 or vice versa. (i.e - every time a sign change occurs in my square pulse - a change occurs in my bio potential)
My goal is to detect this sign change and its corresponding change in the bio-potential (Ch2), ultimately leading to a matrix of "chopped windows" of bio-potentials (i.e - each sign change in channel 1 = 1 column of bio-potential in matrix built).

 

Approach: 

I managed to identify the indices of sign change form positive to negative and vice versa and put it in a queue. I want to access the bio-potential at the indices obtained above, in order to chop a 1000 point window of  bio-potential - i.e biopotential(index -250:index+750); and ultimately populate a matrix. 

But am unable to do that.

Issues:

1. How do I consume channel 2 queue while consuming channel 1

2. Consumed data in queue did not seem to match the input order. 

3. I think the way I am synchronously running multiple loops is incorrect - As I don't see what I am expecting to see. 

4. How do I keep track of channel 2 index while consuming it from a queue?

5. Is there a better approach for all of this? - Am I missing something?

 

- Labview Version 2012; DAQ is replaced by Simulate signal for testing purposes. 

 

Attached is my VI. Help is much needed and appreciated!

Thanks!

 

0 Kudos
Message 1 of 2
(3,899 Views)

1. How do I consume channel 2 queue while consuming channel 1

What exactly are you having issues with? It looks like you are de-queuing from each respective queue in the loops. Can you clarify what functionality you hope to achieve?

2. Consumed data in queue did not seem to match the input order. 

Queues work as a FIFO buffer; meaning that the first element you enqueue will be the first element de-queue. Is this not the order you are seeing?

3. I think the way I am synchronously running multiple loops is incorrect - As I don't see what I am expecting to see. 

What are you expecting to see?

4. How do I keep track of channel 2 index while consuming it from a queue?

I am not sure what you mean by the channel 2 index. However, the iteration index of the loop can tell you how many times the loop has run; Effectively telling you how many elements have been de-queued

5. Is there a better approach for all of this? - Am I missing something?

Once we have a better picture of what you are trying to do, we may be able to help you set up a better architecture

0 Kudos
Message 2 of 2
(3,851 Views)