login about faq

This is my first time programming a PLC or Smart Relay and normally I am an embedded systems programmer.

I am trying to build the circuit using WindLGC to determine direction. I have six photobeams.

If Photobeam 1 is ON, then I open the gate and start a timer. If photobeam 2 is ON, photobeam 1 is OFF, then I reset timer for closing since I know that someone is coming through. However, the difficulty is for back-outs. If photobeam 1 is off, photobeam 2 is on, then photobeam 1 is on and then off, then I close the gate (as long as no one is on safety beam). The problem is determining direction using the circuit. How do I do this?

Do I use a counter to increment and decrement ? Should I rely on the timer so that when it hits the timer it closes rather than immediately on back-out? It seems it should be closed immediately on back-out.

I know how to do this in code, but circuits are new to me. The logic on paper makes sense but designing the circuit in the program is a little difficult.

Any help anyone can provide would be really appreciated.

asked Jan 21 '10 at 21:21

Roboto's gravatar image

Roboto
111


What you need is an internal coil (bit) to hold the state of the logic, and at that point you have a classic state machine.

Start by drawing out your states and counting how many there are. Assuming you don't have hundreds, resist the urge to represent the state with an integer because that will make it harder to understand the logic later. Just define one bit per state. Then write the logic in the PLC to make those states turn on in the right sequence. Use a sealed in rung to hold the state, or you can use an SR (set/reset) instruction if you need to hold the state through a processor reset.

Therefore if you're in state 3, you can define transitions to state 2 or state 4, depending on the inputs, etc. That's how you can easily program your "back-out" logic.

Also, avoid the temptation to use a sequencer.

link

answered Jan 25 '10 at 12:50

Scott%20Whitlock's gravatar image

Scott Whitlock ♦♦
635113

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×8
×1
×1
×1

Asked: Jan 21 '10 at 21:21

Seen: 767 times

Last updated: Apr 05 '11 at 07:22