LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CLD - property booleans

HI

 

I am fairly new to Labview (Around 6 months experience of assisting someone in a cRIO project) and taught myself from NI site and textbooks. Was trying to solve one of the CLD problem scenarios- car wash and am having trouble dealing with property nodes of booleans.

 

Those of you who are not familiar with the car wash scenario, it has 2 wash selections and each selection goes through different number of cycles and 3 proximity sensors indicate if the car is out of position.

 

I used a state machine in the main vi and am sending the references of the clusters to the sub vis and invoking value change property nodes on them to update them, and used the pausable elapsed time example to keep track of time and pause the time when the vehicle is out of position. 

 

Attached is my attempt, and it worked just perfectly satisfying all the conditions until I tried to send the stop boolean to the sub vi to stop it. After reading lots of posts on the discussion forums, even tried changing the mechanical action to switch than latch and still the boolean property node throws an error. The sub vi has a case structure in a while loop and I am assuming everything runs in parallel (Am I correct?) 

 

Can anybody please suggest a way to deal with the stop button and why it is throwing an error ?

 

Please please ignore my error handling and the missing documentation. I promise I will work on it 🙂

 

--dee

0 Kudos
Message 1 of 5
(3,171 Views)

I tried to read the stop using a global variable but still it takes a little time to stop. Before that I still want to know why the ref number to the boolean is misbehaving

 

Thanks

--dee

0 Kudos
Message 2 of 5
(3,163 Views)

Look at your "my car wash.vi" : The stop button reference is wired in case "Underbody Wash" but not in the others so you get error 1055 "object reference invalid" when you call "Keep time.vi" from these cases.

Message 3 of 5
(3,138 Views)

OMG ! yes ! That was plain dumb. thank you so much ! maybe the exam nerves are getting on to me. 

 

Can anybody please tell me why the global variable is taking time to execute ?

 

--Dee

0 Kudos
Message 4 of 5
(3,121 Views)
Well, the stop button in your toplevel VI is read once in a loop cycle. When you press stop while "Keep time.vi" is running it takes time until the SubVI finished before the "stop" control can be read and your global is written. If you pass the reference of "stop" to your SubVI it can read the control value at any time, independent of the toplevel VI. A hint for less headache on debugging: If you wire references to a SubVI make them "Required" on the connector pane. Thus you never can forget to wire them.
0 Kudos
Message 5 of 5
(3,088 Views)