LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with my project

Solved!
Go to solution

another question, I need add an undo button which will undo the last command and remove the from event log, can you give me some suggestion for the program logic?

0 Kudos
Message 31 of 34
(1,101 Views)

Some other comments:

 

  • You don't need the case structure inside the reset event. Since the button is latch action, the event can only occur with a TRUE. The FALSE case can never occur.
  • You have a constant file path, so there is no need to build it every iteration. Building the path belongs before the while loop.
  • You should clear the indicators when the VI starts. This is most easily done by changing "VI properties...execution..clear indicators when called".
  • It would probably make more sense to initialzie the array at fixed size (Before the loop and in the reset event) and replace with valid data in the defined locations using "replace array subset". This guarantees that the order of elements will never change. You would only need a scalar DBL 1D array, because the strings are no longer needed and can be kept as a seperate 1D array string diagram constant.
  • The right upper output tunnel (the turned on time) in the stop event is not wired to the same tunnel. You are creating an extra tunnel that goes nowhere. (move the upper tunnel to see!)
  • Does it make sense to overwrite the file with every iteration of the while loop? Shouldn't you wait until all data is available?
0 Kudos
Message 32 of 34
(1,094 Views)

@zqz51911 wrote:

another question, I need add an undo button which will undo the last command and remove the from event log, can you give me some suggestion for the program logic?


You only keep one entry in the event log because you seem to overwrite the file every time. A "remove" would just clear the file unless you store previous values in a shift regsiter and overwrite the file and indicator with them. In any case, you would just add another event case and manipulate the data in any way you want. That's what programming is for. 😄

0 Kudos
Message 33 of 34
(1,085 Views)

That Is help are lot Smiley Embarassed

Spoiler
 
0 Kudos
Message 34 of 34
(1,078 Views)