LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Counting integer from button press inside of a loop

Solved!
Go to solution

Hello all,

 

I am currently working on a training gui. I am fairly new with labview and would appreciate any feedback.

My main problem is located in the bottom left corner of the main loop. I hope to increase an integer up one number for each press of the button "Logging_EDACS"

I am having issues with main loop getting stuck. I have been experimenting with the stop loop condition (I do realize that the way it is setup now will not work) 

 

Again, I believe that the main problem is with the loops.

 

Any assistance would be greatly appreciated.

 

Many Thanks,

Kevin

0 Kudos
Message 1 of 6
(3,746 Views)

Can you post a screenshot or save back to 8.5 and I'll help you out. I'm surprised no one else has, as this seems like a very basic question.

 

Edit: in the mean time here is an example

 

0 Kudos
Message 2 of 6
(3,730 Views)

Here is the png of the block diagram. The attempt at the increment is the in lower left hand corner. 

 

I am going to give your solution a go right away. Thank you for the quick reply.

 

--Kevin

0 Kudos
Message 3 of 6
(3,714 Views)
Solution
Accepted by topic author Buffalo960

First and foremost, you need to read some tutorials. That said, I see what your problem is. Every time your big loop iterates, the smaller one's shift register is reset to 0. so you are always doing 0 + 1 = 1. In reality, you don't even need that "smaller" while loop, you just need shift registers on the large one.

 

Run with highlight execution on and you will be able to see what is happening.

Message 4 of 6
(3,706 Views)

Thank you very much for your help. I eliminated the loop and added the shift registers to main loop. It is now working perfectly. This is one of my first labview programs and I have gone through a few tutorials to get the hang of it. Did you have any in particular to recommend to me?

 

Thanks again,

Kevin

0 Kudos
Message 5 of 6
(3,682 Views)

Not in particular if you have done the 3 hour and 6 hour ones. If not just search for them and I'm sure you can find a link on these forums. People have posted them many times before. Also read about different architectures, producer consumer, master slave, state machine etc.

 

The thing that helped me the most, more than tutorials, was just staying active here. Read lots of posts even if you do not fully understand them. This helped me because so many times I have run into problems and remembered reading a thread about it on here. Because I already had some background knowledge in how to go about solving it, life was much easier.

 

Use clusters to your advantage to group things together. This makes your block diagram much cleaner. When you have lots of indicators of the same type (like you do) try to use arrays. This will also help to clean up your diagram. That's all I will write for now, others I'm sure will put their opinions here too.

0 Kudos
Message 6 of 6
(3,674 Views)