From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-23-2021 05:49 AM
i am new to labview.I want to run the loop continuously. and i used the for loop with auto indexing input.it should run with respect to the array input.and it should ask for repeat after giving repeat it should run again.and when giving stop button it should stop.i have attached the image.how i have to include the repeat botton..
1
2
3
if repeat is given then it should run like again
1
2
3
stop.it should come out of program
Solved! Go to Solution.
06-23-2021 05:53 AM - edited 06-23-2021 05:59 AM
Hi gokila,
@gokila11 wrote:
it should run with respect to the array input.and it should ask for repeat after giving repeat it should run again.and when giving stop button it should stop.i have attached the image.how i have to include the repeat botton..
1
2
3
if repeat is given then it should run like again
1
2
3
stop.it should come out of program
Sounds like you want to run a FOR loop within a WHILE loop: the FOR loop always autoindexes all aray elements (1…3), then the user can decide for repeat/stop, then the (outer) WHILE loop either iterates again or stops…
On the other hand this also can be a great start to learn about statemachines!
@gokila11 wrote:
i have attached the image.
No, there are no attachments…
@gokila11 wrote:
i am new to labview.
Did you notice those "Training resources" offered at the top of the LabVIEW board?
Btw. it helps when you obey usual grammar and spelling, like using proper capitalization and leaving a space after the end of a sentence. Also LabVIEW uses a special kind of spelling…
06-23-2021 06:09 AM
Yes,I want to run the for loop within the while loop. Array(1 2 3) input is given as the input to the for loop.As I am using the while loop it runs continuously like 1 2 3 1 2 3 1 2 3 .But what I need is like ,after 1 2 3 then it should ask for repeat or stop accordingly it should act.So here what logic I have to use.
06-23-2021 06:15 AM - edited 06-23-2021 06:17 AM
Hi gokila,
@gokila11 wrote:
after 1 2 3 then it should ask for repeat or stop accordingly it should act.
Then you need to implement that question (aka dialog) so the user can choose:
Btw. you should get into the habit of cleaning up code immediately! It helps to create readable code…
06-23-2021 07:28 AM
Hi,
I am using for loop within the while loop and the input of for loop is array which is autoindexed. Here I have two button(boolean control)for continue and stop.If continue is pressed , for loop should execute again and if stop is given then the program should be stopped.Help me to complete this.
06-23-2021 08:57 AM
It's hard to help without a vi so that we can see what you have. From your description I would make a state machine. Have you reviewed the training materials at the top of this page?
06-23-2021 09:07 AM - edited 06-23-2021 09:08 AM
You might be better off using a Two button dialog as the input for the while loop if it going to halt after each iteration of the FOR loop. Make one button 'Continue' and the other 'Stop' for the Two button dialog. It should appear after the completion of the FOR loop.
The other option would be to use the Boolean Radio Button.
My $0.02
06-23-2021 09:40 AM - edited 06-23-2021 09:41 AM
Hi sanjay,
@sanjay92 wrote:
Help me to complete this.
Why don't you talk with your classmate gokila when you get the very same task as homework? Atleast (s)he was quicker in providing an approach with an image of code - more than you did to solve the homework…
(I merged your threads!)