02-16-2016 05:41 PM
Hello forum,
I have a program that when executed, asks for he username, then monitors 4 individual inputs. When the STOP button is pressed, the file is saved. This part of the code works well.
I am trying to modify the code so instead of asking for the username when executed, the user has to press the RUN button (same button as STOP), then execute the code as normal.
When the user presses the STOP button, the button will change back to RUN and wait for the next time it is pressed. Any help will be greatly appreciated.
Solved! Go to Solution.
02-16-2016 05:46 PM
I can't view your code as it is a later version, so if you could save for an earlier version or post a snippet that would be helpful.
But what you want is very possible, Either simply through the use of button that when in the true state enables the program to run and in the false state returns to the waiting state, using feedback node it could possible to compare the current and past state to spot changes and trigger your initialisation and saving of the data.
02-16-2016 05:58 PM
I saved it for Ver 10.0.
02-16-2016 08:33 PM
there is several trick for that
this vi is one of that
also some part of your code need to be fix
to work well I cry to correct some part of them
but you have to work on agian too
best regard,
Hatef
02-16-2016 11:56 PM - edited 02-17-2016 12:06 AM
@hvazquez wrote:Hello forum,
I have a program that when executed, asks for he username, then monitors 4 individual inputs. When the STOP button is pressed, the file is saved. This part of the code works well.
I am trying to modify the code so instead of asking for the username when executed, the user has to press the RUN button (same button as STOP), then execute the code as normal.
When the user presses the STOP button, the button will change back to RUN and wait for the next time it is pressed. Any help will be greatly appreciated.
OK, you missed a few things in that code.
FIRST:
you have an "Infinate Loop" There is no way for that "FALSE" Constant to become True and stop the loop so, the DAQ Assistant Data is just going to accumulate on the Shift Register (Get this!) the data on the SR is not used! Since, the loop cannot be stopped anyway, what is the point of the down-stream loop? Trying to write the last string of data to a file that cannot be accessed? he second loop cannot start until the first loop (that cannot be stopped stops.)
What is going on with the "boolean data" on the feed back node?--- I could use a paragraph on how that ?1-0 (Coerced to array of I32 from four bools ) is supposed to work.
Your code makes little sence untill you tell us what you want it to do----
LabVIEW is a "Dataflow paradigm" language. Structures cannot run until all of their inputs are ready. Structures may run (in any order) when all of the inputs are ready..Nothing outputs anything until all processes are completed. Dataflow 101
OR, stated otherwise- you have confused the functions of Shift Registers and an Auto indexing Tunnels and, I won't mention the local variable abuse- You might want to go through the LabVIEW toutorials again or edit the self-paced online CORE I class