LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

obstacle sensor

Hey guys , 

A simple question but i'm having hard time to figure it out ! 

if i have a barrier and an obstacle sensor on the barrier , I opened the barrier before and i need it not to close when the car is crossing for example .. 

I was using a while loop in a sequence structure , in the first frame i used the while loop which only exists when the obstacle sensor turn off , and then it will pass to the second frame in the sequence where i put to close the barrier .

this has done the job , but i need to do it without using while loops ! 😞 

Any ideas would be appreciated ( with screen shots if it is possible ) 

thanks alot for your time 🙂 

 

0 Kudos
Message 1 of 6
(2,740 Views)

I would suggest that instead of using a sequence structure, you could construct the Simple State machine architecture, which is more flexible if required to be changed. 

 

There is a pre-built template shipped with LabVIEW, which you can build your code into.

 

For example, you could have a 'wait for vehicle passed' state which is entered when the barrier is raised, and stays there until your detection tells you the vehicle has passed, then move to a 'wait for next vehicle' or similar state.

 

Regards

Dave

0 Kudos
Message 2 of 6
(2,720 Views)

hey , thanks for your reply ..

but my problem is that i can't just say that if the obstacle sensor is off , then i close the barrier ..

because the obstacle sensor is off in the first place , so i need to say that if the obstacle sensor is on and after that it is off , close the barrier .. 

how is this possible ? 

0 Kudos
Message 3 of 6
(2,712 Views)

so, you are looking for a negative going edge transition on your obstacle sensor, then do something?

 

How about setting up a User Event which triggers on that transition, then you could put the barrier control in your event structure.

0 Kudos
Message 4 of 6
(2,709 Views)

Hmm i can'r really understand ur point , maybe i should include that i'm a bigginner in labview and this is my first project 

0 Kudos
Message 5 of 6
(2,701 Views)

Hi,

 

I would suggest to go for a state machine as an architecture.

An example of such an architecture can be found here: https://decibel.ni.com/content/docs/DOC-10862

Basically, you should acquire data from the proximity sensor continuously, process the data to find if you have obstacle or not take the decision of closing or not the bareer.


Let me know if you need more help with that.


Best regards,

IR

0 Kudos
Message 6 of 6
(2,675 Views)