Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital I/O Event Driven Programming?

Dear forums,

 

I want to move a pneumatic cylinder, until a digital input pin detects the final state(proximity sensor). From then, the cylinder should stop moving immediately.
My first attempt is checking the state of the Input pin in a while loop. When TRUE is detected, the cylinder will be stopped.
But thats not a nice solution(polling). I think an event will be much better.

 

However, I cant really connect my "ReadDigitalPin"-Vi with an event loop. So I dont know how detect a change on a certain Input Pin as an event. (How) Is that possible?

Any help will be highly appreciated.

 

Best regards,

Arvel

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

Some devices support state-change detection on PFI port. If you can configure some PFI line that way you should be able to receive some notification about your proximity sensor detecting the cylinder in your program.

 

You could also:

1. wire the proximity sensor output through some simple hardware logic circuit to cylinder controller, stopping it as soon as sensor detects the cylinder (extremely fast, software free hence very reliable)

 

2. Configure the selected PFI line input as trigger for selected DO or AO line and controll the cylinder controller that way.

 

If you can skip software decission making that would be best. There's not much to 'compute' in order to stop a motor when sensor reports proximity 🙂

Message 2 of 3
(5,580 Views)

Thank you very much for for reply!
I see a problem with the logical circuit solution. Once the proximity sensor is activated, the cylinder is blocked all the time. I needed additional things again. Also, the cylinder is moved by several solenoid valves that work together. Wiring everything up seems to be alot of work. Also, it doesnt have to be instantly. If the reaction takes about 10-50ms, thats totally fine since the cylinder is rather slow anyway. I can just move the proximity sensor a bit to compensate the delay.

 

The PFI-Line solution sounds more suitable, but I have no idea how it works. Can one PFI Input Line trigger more than one Output Line. Thats important because of the several Solenoid valves.

 

Another idea I came up with is configuring an occurence, but im not familiar with this yet. Might this be a solution?
Or a user event somehow?

 

Best regards

 

Arvel

0 Kudos
Message 3 of 3
(5,573 Views)