取消
显示结果 
搜索替代 
您的意思是: 

Boolean to increment a counter

已解决!
转到解答

I want a VI that would increment a counter every time a boolean gives a true value. In other words, every time a switch is pressed, the counter should increment to the next whole number and so on.

0 项奖励
1 条消息(共 15 条)
7,858 次查看
This should be a pretty trivial exercise. Have you taken any of the free tutorials. Do you know what a shift register is or an event structure. No one here is going to do your homework for you do please attach whatever you have written so far so you can get some help.
0 项奖励
2 条消息(共 15 条)
7,841 次查看

I am new to LabVIEW and just have a basic knowledge of it. Although i'm aware of shift register, im not accustomed to event structure... im enclosing a rough idea i made to vi..

0 项奖励
3 条消息(共 15 条)
7,835 次查看
Can you attach an image of the block diagram? I'm posting by phone.
0 项奖励
4 条消息(共 15 条)
7,832 次查看

i dont think this works, let me look up event structure

0 项奖励
5 条消息(共 15 条)
7,828 次查看
You've got everything backwards. The whole loop should be the outer most structure with the case structure inside that. The event structure is a more elegant solution though.
0 项奖励
6 条消息(共 15 条)
7,812 次查看
解答
已被主题作者 karthiksudhir80 接受

 set mechanical action of your button to switch until release, if you want yor increment is every click is increment by 1

 

 

counter boolean.png

 



Thank you & Best regards
syrpimp

=======================================================
“You must continue to gain expertise, but avoid thinking like an expert." -Denis Waitley
0 项奖励
7 条消息(共 15 条)
7,810 次查看

i liked the idea of event structure, implemented it with some local variables .. it works fine

0 项奖励
8 条消息(共 15 条)
7,792 次查看
解答
已被主题作者 karthiksudhir80 接受

thanks for your support, i used event structure and local variables and implemented this application which increments the counter when swittch 1 is pressed and decrements the counter when switch 2 is pressed, and glows a light when the value of the counter is greater than 0.

0 项奖励
9 条消息(共 15 条)
7,787 次查看
No. Do not use local variables. Use a shift register and have another event for the stop button.
0 项奖励
10 条消息(共 15 条)
7,778 次查看