LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to send arrays through notifiers

Solved!
Go to solution

Hello,

 

I am trying to simultaneously collect data (in a while loop) and process it (in another while loop). In order to not interrupt data collection with the processing I am sending all the data in the form of an array to a separate while loop through a notifier. I have the send notification in a case statement to only send a notification when necessary. When I feed the array into the case statement and put an indicator on the inside I can view the whole array. When I feed the array into the case statement and connect it to a notifier, I use a probe to see the array has shrunk to only the first element. Is there a way to send arrays through a notifier?

0 Kudos
Message 1 of 9
(259 Views)

@SuperFastSquirrel wrote:

Is there a way to send arrays through a notifier?


Yes it is possible.

Please attach your code (.vi file).

If you use a LabVIEW version greater than 2021, please down-convert using menu File -> Save for Previous Version... -> 21.0

 

Regards,

Raphaël.

0 Kudos
Message 2 of 9
(237 Views)

This works just fine for me.  Which makes me think you did something wrong in your code.  If you can share any of your code, even a snippet, it could help us help you.


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
Message 3 of 9
(218 Views)

First of all, maybe a notifier is incorrect for your purpose, for example if you read the notifier too slowly (e.g. due to processing), you might lose chunks of data. Unlike a queue, a notifier does not buffer. so maybe for the last read, only an array with one element sits there.

 

Second, to send an array through a notifier, the datatype needs to be an array of course.

 

As has been said, your problem description is way too vague to help. We don't even know your LabVIEW version. To probe an array, I recommend to use the Conditional array probe, which also tells you the array size (not available for all arrays, such as CDB).

 

Please attach a simplified version of your code so we can troubleshoot and understand your problem.

0 Kudos
Message 4 of 9
(211 Views)

I am using LabVIEW 20. The first while loop waits for the Trigger to be in range of the trigger value. The next while loop will send a notification every time the trigger is in range. I am aware that none of the while loops have a delay which is intentional. I need a precise value that may be missed with a delay. I also tried using an array constant for the initial value of the shift register as well as sending the arrays in separate notifications instead of a cluser. Please ignore the unwired stop buttons as I gutted my code for the post.

SuperFastSquirrel_0-1713989171721.png

 

0 Kudos
Message 5 of 9
(187 Views)

Why do not create simple VI with simulation?

tn.png

and then check it:

tn.gif

may be your trigger continuosly in range, therefore you have always one elementh.

0 Kudos
Message 6 of 9
(175 Views)

If I plop a probe right before the case statement on the array, I can see the array values I am looking for (there are thousands of values). If I plop a put a probe inside the case statement, only the first value makes it through even though the first probe says there should be more values.

 

I like your remake of my code

0 Kudos
Message 7 of 9
(171 Views)
Solution
Accepted by topic author SuperFastSquirrel

@SuperFastSquirrel wrote:

If I plop a probe right before the case statement on the array, I can see the array values I am looking for (there are thousands of values). If I plop a put a probe inside the case statement, only the first value makes it through even though the first probe says there should be more values.

 

I like your remake of my code


Thank you! Yes, exactly this happened, when trigger goes from high (and was here several cycles) to low. You should check last update time stamp - its simply not updating any longer:

Screenshot 2024-04-24 23.02.17.png 

It looks like you may need "on change" detection, then you need additional boolean shift register, then fire notification only once, and then lock next until you're in range. Then you will see multiple elemenths inside case.

Message 8 of 9
(161 Views)

Thank you! I added the on change detector and that worked

0 Kudos
Message 9 of 9
(114 Views)