Using jumps and seting bits
rsdoran said:
Personally if I was going to use 4 discrete inputs for speed settings I would use a 4 position maintained switch, just one hole to cut, and then 4 lines to turn on the necessary output or one-shot move a value into a word for analog or comm output.
I do not know enough about Mitsi but for me what you are doing is confusing. I am not sure what you mean by driving the output.
With that reverse logic it looks to me like every other scan its turns on or off, I may be wrong because I do not know how Mitsi works nor the instructions available.
The logic with jumps will work with most PLC’s. Using a jump is similar to using a set or reset instruction with a one shot except that a jump sets or resets a list of bits. The jump is normally jumping the list and you scan the list for one scan. During that scan any bit instructed off goes off any bit instructed on goes on and they stay that way until that list of bits is scanned again.
There are only two states for a bit on or off there are not multiple states.
Driving the output state
A regular PLC out instruction will continually drive the output state. If the logic is true the bit will be instructed to turn on every scan of the PLC. If the logic is false the bit will be instructed to turn off every scan.
This is fine for straight relay logic but for more advanced programming set-bit and reset-bit must be used. The set-bit and reset-bit instructions can be used in multiple places in the program. For example you can set up a calculation in a subroutine and call that subroutine any where in the program by just setting a bit with the set bit instruction.
If control of the machine is with an HMI the HMI cannot change the state of bits that are being continually driven in the ladder logic.
What if there is a three position selector switch for “Manual Mode”, “Auto Mode” and “Setup” Mode?
When the machine is initially started you want the machine to be in Manual mode. You do not want the machine to start running instantly in Auto mode when the power is turned on. Typically to be safe the operator should turn on the power and nothing should happen until the operator does something else to start the process running.
If you are using a selector switch you cannot change the switch position in the program. I would use three lighted push buttons. Then when the machine is powered up it will be instructed in the logic to always be in Manual Mode.
The same thing would be true for the speed selection if the machine should always start in slow speed.
If you have multiple control stations around your machine don’t use a selector switch use lighted push buttons. Then when auto mode is selected on one station all stations can be in auto mode.
I love simple code and using jumps is a powerful tool in your tool kit that enables you to write compact code. I have seen a lot of PLC programs written without jumps that had relays operating relays operating relays that were practically unintelligible so you don’t have to use jumps to make the program incomprehensible.
Doug Hylton