LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Notifier not received when other code in while loop exists

I am attempting to improve my logging code to be separate from the main UI/logic.

 

I was hoping to implement a 'Send Notification' upon my trigger, to start logging in a separate while loop.

To test this, I tried the following. When my trigger goes True, a notification is sent and my 'Notification received' boolean goes True.

 

notification1.PNG

 

When I wire anything to the while loop, this no longer works:

 

notification2.PNG

 

Can someone tell me why? I was hoping to put my logging logic into this while loop to grab data from the waveform wire (brown) to log my data.

 

Thanks!

 

 

0 Kudos
Message 1 of 25
(3,138 Views)

Where is that waveform data coming from?  If it is direct from another loop, then that loop must finish before this logging loop can even run.  DATA FLOW.

 

You should use a queue to send the data to your logging loop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 25
(3,131 Views)

It is indeed coming from another loop.

 

I see what you mean by using a queue, yes, I then receive data in my logging loop..My issue is:

 

How do I have the waveform be sent for as long as I need it to be, in order to log?

 

The wavefrom data I am receiving is 100 samples. I need 1 sample every 1ms. If there is a 'delay' of 1second, i need 1000 samples. if there is a 'delay' of 2 seconds, i need 2000samples.

 

I cannot use finite sample measurement because I need to update some graphs continuously so i have 'continuous samples' chosen for DAQmx Timing and DAQmx is set to -1 for the 'number of samples per channel'

0 Kudos
Message 3 of 25
(3,119 Views)

What is the purpose of the incoming wave form wire? It is not accessed in the loop.

0 Kudos
Message 4 of 25
(3,098 Views)

I was simply showing what I wired that led to the notifier not being read..?

0 Kudos
Message 5 of 25
(3,096 Views)

If you're going to do data logging in the loop, then you must somehow receive the data to be logged.

As mentioned in another post, the loop will execute after the data on that wire is received, but the data on that wire will not be refreshed and passed into the while loop again.

The original incoming value(s) persist through the lifetime of the loop. That single waveform wire acts like "one bucket full of data" that goes into the loop, and you can use that data inside the loop as you choose.

The while loop runs on its own thread with its own local data, until its exit state occurs, if ever.

 

You won't get another "bucket of data" until you explicity call the VI that contains the loop again, passing a new value on the waveform wire.

 

0 Kudos
Message 6 of 25
(3,085 Views)

belopsky wrote:

How do I have the waveform be sent for as long as I need it to be, in order to log?


You just make a queue of type Waveform (or if multiple channels use Array of Waveforms).  You read from the DAQ and then just write into the queue.  The logger loop will then just read data from the queue as it comes in and log it.

 

Just look into the Producer/Consumer if you need any more help on this.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 25
(3,074 Views)

Thanks, that is what I was trying, I finally got my 'trigger' to work properly..

 

The issue I have now is that only the first time the element is enqueued does it work..the next time nothing gets enqueued...Not sure why.

Hope this snippet helps to troubleshoot

 

Thanks!!

 

queue_2.PNG

0 Kudos
Message 8 of 25
(3,060 Views)

I question why you are limiting the number of loop iterations.  And why aren't you logging the data?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 25
(3,051 Views)

The limit is currently to just get exactly 1000 samples for testing (100 samples every iteration)

 

I cropped the logging logic out in that snippet. It is to the right.

0 Kudos
Message 10 of 25
(3,046 Views)