LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Do "Stop.vi" command only once in while loop

The shift register is initialized so it will execute your stop vi every time. Delete the true constant on the left side of the shift register. But I don't understand why you cannot put the code outside of the while loop.

 

Also, it is difficult with just images, but what is in the false case of the case structure with first call? The true case is a good place to put code that you only want to execute once when your VI starts.

 

=====================
LabVIEW 2012


0 Kudos
Message 11 of 14
(785 Views)

Dear Steve Chandler,

 

First of all, thank you for all your replies. Thanks for spending your time with my problem.

 

green boolean goes through in the false case with first call.

 

i deleted  true constant on the left side of the shift register but now it does not run stop.vi  😞  So confused 😞

 

I am collecting data with DAQmx and after a value is reached i want to make the motor stop , then make only the motor wait 2 seconds and then go "move absolute value.vi", with the preset velocity  for this reason i created a case structure and i put to the case selector that if a value is smaller than "50" then it is true. If it is false it should stop and do what i say even if the value gets under "50 again".

 

While the DAQ is taking samples, the motor should move in same time because i am writing "time, motor position and load data" to the tdms file. 

 

Can i make all these outside of the while loop? So how?, i am newbie on labview and i am very confused.

 

I did not attached the file because i thought that you dont have the SMC-100 Labview drivers. Now i am attaching the whole vi. I hope you have the drivers.

 

So the latest situation's pic. is below, unfortuanetely we should change it.

 

11.png

0 Kudos
Message 12 of 14
(781 Views)

You are right, I do not have those drivers. In fact I do not have DAQ either.

 

Look at the "first call" case structure. The first time the loop executes the value will be true. This puts a false on the shift register. Since nothing modifies the value on that shift register it will always be false. The true case will only be executed on the first loop iteration if the comparison is true since the shift register is initialized with a true.

 

These kinds of problems are best solved with a state machine. There are lots of documents but here is one http://zone.ni.com/devzone/cda/tut/p/id/3024

=====================
LabVIEW 2012


Message 13 of 14
(764 Views)

Thanks for your reply Steve Chandler,

 

First i am trying to solve the problem with this side having outside of the loop.  And if it does not work again i will try to learn the "state machine".

 

As you asked before I put the true/false case outside of the loop and i had a problem already and i opened a new topic , link is indicated below:

http://forums.ni.com/t5/LabVIEW/False-True-Case-is-not-working-Please-Help/td-p/1972607

 

If you can answer to that topic too, then i would be very glad.

Thank you,

Kind Regards.

 

 

0 Kudos
Message 14 of 14
(751 Views)