annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

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 Kudos
Messaggio 1 di 9
3.927Visualizzazioni
Hello

There are many ways for that.
See attached you vi modified.
Cheers
Alipio
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
0 Kudos
Messaggio 2 di 9
3.919Visualizzazioni
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 Kudos
Messaggio 3 di 9
3.913Visualizzazioni
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 Kudos
Messaggio 4 di 9
3.896Visualizzazioni
Sorry forgot the vi
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
0 Kudos
Messaggio 5 di 9
3.895Visualizzazioni
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 Kudos
Messaggio 6 di 9
3.871Visualizzazioni
If your on the front panel, right click the boolian indicator and choose "create>>local variable"
0 Kudos
Messaggio 7 di 9
3.863Visualizzazioni
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 Kudos
Messaggio 8 di 9
3.861Visualizzazioni
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 Kudos
Messaggio 9 di 9
3.836Visualizzazioni