LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic Shutoff

Solved!
Go to solution

Hello, I want to make an Automatic shutoff for my program when my cycles stop going up (i.e. when my specimen fails). I was thinking if I were to have the indicator of the previous while loop equal the current then I could include that in a stop condition, however I also will l have a count of zero cycles during the startup phase; would an elseif work here?

 

My main question is if it is possible to take a reading from a previous iteration (say 3 seconds ago) of the while loop and compare it to a current reading.

 

I have attached my VI file for closer analysis. I also wanted to preface that I am using MCC devices here, but I do not think it should impact the ability to create an automatic stop.

 

Thank you.

0 Kudos
Message 1 of 5
(503 Views)
Solution
Accepted by topic author Ferg1052

hi Everything is possible, depends on how you implement to get what you want. 

You need to store the data from 3 seconds ago in a circular buffer (one way to do is use a while loop with non initialized shift register ) to compare with the current value. If you save your file for labview 2020 I will be able to see your code. 

RKO
Message 2 of 5
(480 Views)

You should really look at this as more of a state machine:

  1. Entry
  2. Startup Conditions (Continue or Jump to step)
  3. Started (Continue or jump to step)
  4. Normal Run Conditions (Continue or jump to step)
  5. Slowing Conditions (Continue or Jump to step)
  6. Stopping Conditions (Continue or Jump to step)
  7. Exception Handling (Continue or Jump to step)
  8. Exit Conditions (Continue or Jump to step)
  9. Rerun (Continue or Jump to step)
  10. Report (Continue or Jump to step)
  11. Done (Close vi)
Help the Community (and future reviewers) by marking posts as follows:
If it helped - KUDOS
If it answers the issue - SOLUTION
Message 3 of 5
(460 Views)
Solution
Accepted by topic author Ferg1052

It's not really clear to me what you are asking.  However:

  • Your 2nd while loop makes no sense.  It will either exit after the 1st iteration, or run forever.
  • Data doesn't come out of a loop every iteration, it only comes out when the loop is finished (look into channel wires)
  • You don't need to unbundle errors to feed them to a boolean: paul_a_cardinale_2-1715640504849.png  <- Same -> paul_a_cardinale_3-1715640524724.png

     

  • You can use shift registers to get data from previous iterations of a loop.

 

Message 4 of 5
(441 Views)

You're right, I just got it working properly! Thank you so much to everyone trying to help me!

0 Kudos
Message 5 of 5
(394 Views)