dronai
  •  dronai
  • 53.79242% (Neutral)
  • Newbie Topic Starter
2020-04-29T21:59:20Z
This was the logic I was describing when talking about a Flip Flop. The enable bit uses this address to accomplish this task. C5:0.ACC/0

It used the accumulated amount from the counter. Someone else showed me how to do this. .ACC did the trick, I don't really understand this address, but I see the result.



I was wondering how to alternate two outputs with one push button using another method ?
Guest
2020-04-29T22:18:43Z
Ok, Im not sure what you are doing with a counter to create a flip flop. I can explain the addressing. I assume you have watched the vids on counters and are familiar with the accumulator or .ACC register. Keep in mind that any integer (which the ACC register is) in the SLC is made up of 16 bits. by addressing .ACC/0 you are selecting the first bit of that integer. The result being that the bit will alternate between 0 and 1 every time the counter increments. Ahhhh, now I understand the flip flop function. The definition of a flip flop being the toggling of the output based on the transition of the input to the circuit or the logic in your case. I've never seen a counter used that way, but that will work. With this method, you would simply take the addres C5:0.ACC/0 and use it for an XIC or normally open contact in the first rung driving output 1 and use the same address in an XIO on the next rung driving output 2. Alternatively you could use the address for output 1 in the XIO for the second rung.

Now as for an alternate method to achieve this, I am sure there are many. Since you are a student here trying to learn PLC programming, I would suggest you first make an attempt at the logic and ask quesitons on direction and problems that come up. It would be better to be directed and nudged the right direction than to be given the solution. That said, I can hint that there is a away to do this with a single rung that would drive an output to replace the ACC/0 bit you are using above. It involves using a oneshot, latch, unlatch and standard OTE output all on one rung. Take that info and see what you can do with it.
dronai
  •  dronai
  • 53.79242% (Neutral)
  • Newbie Topic Starter
2020-04-29T22:25:06Z
Ha !!! You want to torture me OK you are right. We do learn better by a little suffering first, and a big feeling of accomplishment when we succeed. I will take on the challenge, and try the hints you have given me. Ohh that One Shot function again !!!
Guest
2020-04-29T22:28:37Z
That's my job! torture-r-us. Don't get hung up on the oneshot. It is a very simple instruction. All it does is limit the logic after it to seeing a 1 for just one scan. So every time the logic before it changes from 0 to 1, it allows a 1 to be available for just one scan after it. Enter the add logic shown in the video and play with that to understand it better. Enter a rung without the oneshot - test it. Then add the oneshot and see the difference. Also, use the ONS in the micrologix. The OSR has a different setup and adds nothing to what you get from it. Basically it's a useless addition.
Users browsing this topic