04-26-2017 12:04 PM
Hi all,
Can you help me?I want to increment one value whenever the Ok Button is clicked.On the same time i want to generate a random table with values when click on this Button.I want to increment values before Stop button is clicked, but now, all i have is a button Ok which increment one value and a button Stop who generate table.
Thanks in advice.
Solved! Go to Solution.
04-26-2017 12:11 PM - edited 04-26-2017 12:12 PM
04-26-2017 12:18 PM
@altenbach wrote:
Try placing the for loops inside the event case.
Think dataflow!
Or, even better try out the Producer-Consumer (Events) template from File>>New...
04-26-2017 12:30 PM - edited 04-26-2017 12:31 PM
04-26-2017 01:09 PM - edited 04-26-2017 01:14 PM
@ben64 wrote:
And wire the shift register through all event case (right now you're using use default if unwired).
If the only other event is the stop event, it does not really matter since the final value is not used anywhere. However, the numeric indicator (should be blue!) belongs before the event structure so it correctly resets when the program is started and no button has been pressed yet.
04-26-2017 01:26 PM
@altenbach wrote:
@ben64 wrote:
And wire the shift register through all event case (right now you're using use default if unwired).
If the only other event is the stop event, it does not really matter since the final value is not used anywhere. However, the numeric indicator (should be blue!) belongs before the event structure so it correctly resets when the program is started and no button has been pressed yet.
We can't tell if the terminal is wired. It may be that the value is meant to be retained on a "User Abort" case where only the stop button is pressed.
I doubt that that is the case but, without a specification I can't tell if it is desired behavior or a bug.
04-26-2017 01:42 PM
This is my code.I tried to put for loops but i don't know how to set N iterations and how to connect.
04-26-2017 03:48 PM - edited 04-26-2017 03:49 PM
04-26-2017 03:54 PM
In table i need to fill first column with number from 1 to 8 .I need 3 column with random numbers.In last column, on each row( because don't know other option) i want to put the number of times i clicked start button(i try to make an unique id for each generated table).Thanks a lot.
04-26-2017 04:09 PM
@Claudinho18 wrote:
In table i need to fill first column with number from 1 to 8 .I need 3 column with random numbers.In last column, on each row( because don't know other option) i want to put the number of times i clicked start button(i try to make an unique id for each generated table).Thanks a lot.
What is an ID for a table and where do you want to show it? Where do you want to put the number of times? Do you want to incrementally build the table, one added row for each button click?
See if this gives you some ideas. To incrementally build the table, put it in a shift register and append a new row. remove the FOR loop.