LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

push button problem

OOF, that is one BIG VI. I second what Ravens said. May I also suggest more subVIs (one's you create! Not just ones from the drivers)...it will make troubleshooting these things much easier.

0 Kudos
Message 11 of 25
(1,555 Views)
Actually it works perfectly fine. I understand what you said. But I circumvented the problem by making the second event structure execute when the tab control is activated only thing it executes a false Boolean to the while loop.
The saving works fine too. It just that sometimes the button gets stuck like this.
0 Kudos
Message 12 of 25
(1,550 Views)

I understand sometimes there are time crunches on the job and you just have to get something done and working even if it means having not-so-great code. But, if you have some free time, I would suggest rewriting this with a better architecture (such as a queued state machine) so that you can learn to write more scalable code for future knowledge. Like Ravens said, if you have two event structures in one while loop, whether it works or not, you have a bad architecture.

0 Kudos
Message 13 of 25
(1,535 Views)

@thentangler wrote:
Actually it works perfectly fine. I understand what you said. But I circumvented the problem by making the second event structure execute when the tab control is activated only thing it executes a false Boolean to the while loop.
The saving works fine too. It just that sometimes the button gets stuck like this.

I don't know how you can say it works perfectly fine when "sometimes the button gets stuck like this."

 

If everything was working perfectly fine, you would have never needed to post this question in a message thread.Smiley Tongue

Message 14 of 25
(1,522 Views)

I thought about using notifiers, but notifiers is mostly used to pass one or few data types (string, int etc.. ) 

I have huge chunks of data that I pass to the other part of the code. I read that using notifiers in such a case can lead to time out errors.

 

0 Kudos
Message 15 of 25
(1,506 Views)

Where did you read that?

 

You can create any datatype you want to use for a notifier.  It is just a matter of creating a cluster that contains whatever data you want to send.

0 Kudos
Message 16 of 25
(1,503 Views)

@thentangler wrote:

I thought about using notifiers, but notifiers is mostly used to pass one or few data types (string, int etc.. ) 

I have huge chunks of data that I pass to the other part of the code. I read that using notifiers in such a case can lead to time out errors.

 


I think you misunderstood.  Notifiers can only contain 1 value.  So you could lose data if you write to it again before the first value was read from the other loop.  If you have to process every value, you should be using a queue.


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 17 of 25
(1,495 Views)

I have 3 arrays containing about 500 elements each coming from different measurements from the first loop. 

So would I then have 3 "send notifications" in the first loop and  3 "wait on notification" codes in the next loop to parse the 3 arrays? 

0 Kudos
Message 18 of 25
(1,492 Views)

@thentangler wrote:

I have 3 arrays containing about 500 elements each coming from different measurements from the first loop. 

So would I then have 3 "send notifications" in the first loop and  3 "wait on notification" codes in the next loop to parse the 3 arrays? 


As was stated, use queues for this. Here are two methods. One method would wait for all data and queue it all up together in a cluster. This cluster would have 3 array elements, one for each channel.Or, you could queue them up one at a time with an enum that specificies which measurement's data is being sent. The first method works best if all your data is acquired at the same rate. The second is better for continuous acquisition or different data rates, when sometimes some data will be ready at a different time than the other data.

 

 

0 Kudos
Message 19 of 25
(1,484 Views)

Ahh, Thanks guys, 

I see now. And like you said, the second method is proably more conducive to my usage. But how do I get the enum in an array? 

And also I would still have 2 event structures one to run the measurement and another to save it, only thing I would put the dequeue in the event structure that does the saving right?

0 Kudos
Message 20 of 25
(1,472 Views)