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

A simple question about LED

It could be a simple problem but I couldn't work it out. Please check my attached code.
My purpose is: when click the 'run' button, the LED is OFF and after all 1000 random numbers are generated, LED is ON
Thanks for your help.
0 项奖励
1 条消息(共 9 条)
3,887 次查看
Hello

There are many ways for that.
See attached you vi modified.
Cheers
Alipio
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
0 项奖励
2 条消息(共 9 条)
3,879 次查看
Thank you for your modification. I changed a little bit and it is almost what I want.
Only one thing left: after I run the program and got 1000 data, I want the LED keep ON, then I click 'run' again and LED is OFF. After I got all 1000 data, LEC is ON again.
Right now, after I click RUN, the LED just blinks and gone. I want LED keep ON before I click 'RUN' again.\\
Thanks.
0 项奖励
3 条消息(共 9 条)
3,873 次查看
Hi
Now the led keeps on until next run and the array keeps its values, too.

Cheers
Alipio
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
0 项奖励
4 条消息(共 9 条)
3,856 次查看
Sorry forgot the vi
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
0 项奖励
5 条消息(共 9 条)
3,855 次查看
Hi, alipio , thanks for your reply.
In the attached picture, where does the part (highlight with red circle) come from? I can't figure out how to get it.
It should be a easy question but I just dont' know how. Thanks.
0 项奖励
6 条消息(共 9 条)
3,831 次查看
If your on the front panel, right click the boolian indicator and choose "create>>local variable"
0 项奖励
7 条消息(共 9 条)
3,823 次查看
it is a boolean constant (FALSE) wired to a local variable.
If you ricgtclick on any control/indicator and go to crate, you can create local variables. You can read and write then as if you read/write value in terminals. They are much like C local variables.
Search for doc in this web. there are a lot about locals and globals.

In this case, I used it to make the LED false before generating numbers.

Cheers
Alipio
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
0 项奖励
8 条消息(共 9 条)
3,821 次查看
Here's a different way to do it which I believe gives the operation you desire. It is a simple state machine structure which avoids the use of local variables.
0 项奖励
9 条消息(共 9 条)
3,796 次查看