How to build your own ring counter with bits.

Doug,

Obviously a bit only has two states.
When there are multiple jump instructions, there are multiple ways of controlling that state. As you said, you can leave the bit high when leaving the jump & the state doesn't change. While this is a fine use of the jump, it tends to leave my technicians feeling a little lost in the dark as to what put the machine in that state in the first place.

Your point about a machine starting when powered up is a good point, but I prefer to use a hard wired master control relay that feeds a state to the PLC as well. Upon power down, the sealing circuit is broken, & the physical outputs causing action are broken, as well as the PLC recognizing the MCR being in an off state.

I know ladder can be made overly difficult to follow without jumps, but that isn't the point. The point is that the jumps make it difficult to follow.
 
....that had relays operating relays operating relays
Many of us old-timers started out with control systems that operated exactly like that, with relays operating other relays. It only seems "normal" to write a PLC program the same way. Program "Jumps" were not invented until computers were invented.

It depends on where you place your priority: Making an "elegant" program, or making one that is easy to understand and easy to modify for ALL those who must come in contact with it. If you were programming on the moon and you are the only one who will ever see it, then sure, those jumps are great.
 
If I may weigh in.....

I have one (1) machine type (out of 60 or so) in which I use a "jump" instruction.

For the most part, I don't like them for all of the reasons listed so far.


The case in which I DO use one is a machine that TRULY has 2 distinct operating modes. The two different modes are: "normal operation", and "recharge". When in "recharge" the machine behaves totally differently from "normal" mode. The timing is different, the reasons to start and stop pumps are different, and there are extra devices and indicators to manage.

In this situation, I have basically written two different programs. I determine which mode applies, and JUMP all of the logic associated with the other mode.

I can imagine a system with several operating modes, requiring more JUMPS, BUT to perform standard, ladder operations in some tricky way with jumps, is IMHO just asking for trouble. Can a good programmer understand it? Sure. Will it work? Sure. Do I recommend it? No.

Stationmaster
 
Stationmaster said:
If I may weigh in.....

I have one (1) machine type (out of 60 or so) in which I use a "jump" instruction.

For the most part, I don't like them for all of the reasons listed so far.


The case in which I DO use one is a machine that TRULY has 2 distinct operating modes. The two different modes are: "normal operation", and "recharge". When in "recharge" the machine behaves totally differently from "normal" mode. The timing is different, the reasons to start and stop pumps are different, and there are extra devices and indicators to manage.

In this situation, I have basically written two different programs. I determine which mode applies, and JUMP all of the logic associated with the other mode.

I can imagine a system with several operating modes, requiring more JUMPS, BUT to perform standard, ladder operations in some tricky way with jumps, is IMHO just asking for trouble. Can a good programmer understand it? Sure. Will it work? Sure. Do I recommend it? No.

Stationmaster

When programming a machine that has multiple different operations, I prefer seperate subroutines for each different operation. These subroutines are activated using some Seperate selection logic.

Physical Inputs turn on different bits for each routine based on the selection logic, and bits inside the routines turn on their respective output. That way everything is seperate and easy to understand. If you want to see the ladder for Normal you click on the subroutine for normal, and same for the Recharge.

I'd rather have a slightly larger program (Which you would have) than a program that just jumps around like crazy to try and reduce the number of rungs or data tables.
 
Tharon said:
When programming a machine that has multiple different operations, I prefer seperate subroutines for each different operation. These subroutines are activated using some Seperate selection logic.

Physical Inputs turn on different bits for each routine based on the selection logic, and bits inside the routines turn on their respective output. That way everything is seperate and easy to understand. If you want to see the ladder for Normal you click on the subroutine for normal, and same for the Recharge.

I'd rather have a slightly larger program (Which you would have) than a program that just jumps around like crazy to try and reduce the number of rungs or data tables.

I agree. The program I described is one I have been developing since BEFORE I had "subroutines" as an option. The point IS: I was trying to lay out at least ONE situation where one might make a good excuse for a "JUMP". (I like to look at both sides of an issue).

With your surgical elimination of THAT excuse, I guess now there are none.

: )

Stationmaster
 
I tried to get a demo version for Mitsi but had to settle for a programming manual, once I knew what the instructions did then I could follow the logic. The -/- that inverts logic is a neat little instruction to have, with the speed setting code I can see a small advantage in it decreases scan time using the Not logic and Jump.

I am still not sure we have the same understanding about how a program cycle works.

I have noticed there are a few ways of thinking by programmers. You have those that started out learning or being software programmers and you have those that think "electrically" per se. The latter usually program it so techs etc. can follow the line of reasoning from an electric point of view while the software program will write code from a software point of view. Nothing wrong with either way but sometimes what one person thinks is simple can make things complicated for others.

If the code works then use it but I doubt I would because it does not follow my electrical way of thinking. I hope that you document it well for those that may have to deal with it later.
 
Personally, unless there is an exceptional need to use a JUMP instruction in logic, I consider them a symptom of poor design, and lack of understanding.

Not to mention that JUMPS leave the inclusive outputs in whatever state they may have been in. This can be bad, and absolutely disasterous if somebody else comes in, and starts trying to modify logic to 'fix' a non-existant problem.
 
Using the jump instruction is like religion

There are some people who believe that a man should only eat vegetables and that meat and the jump instruction are unclean. There are other people who love eating meat and use all the tools god has given them.

I believe its wrong to go into the house of a man who refrains from eating meat and only eats nuts and berries and then offer him a Big Mac and say “You must eat this and use jumps in your program”.

It is also wrong to go into to a mans house who eats meat and tell him what you are doing is unclean and a sin.

All things come from god including the jump instruction. All things are clean it is only what you think is unclean that is unclean.

Doug Hylton
 
Doug Hylton said:
There are some people who believe that a man should only eat vegetables and that meat and the jump instruction are unclean. There are other people who love eating meat and use all the tools god has given them.

I believe its wrong to go into the house of a man who refrains from eating meat and only eats nuts and berries and then offer him a Big Mac and say “You must eat this and use jumps in your program”.

It is also wrong to go into to a mans house who eats meat and tell him what you are doing is unclean and a sin.

All things come from god including the jump instruction. All things are clean it is only what you think is unclean that is unclean.

Doug Hylton

Well, I won't argue with that.
 
jeebusmn said:
Like what Einstein said, [size=-1]"Everything should be made as simple as possible, but not simpler."
[/size]
LITTLE KNOWN FACT:
Einstein's death was the result of a mob hit...

The reason: He knew too much.:eek:
 

Similar Topics

M8, I'm planning to build my personal PLC trainer. I would appreciate if you can provide me schematic diagram and set-up. I will be using...
Replies
4
Views
8,402
A couple people have asked me about my PLC Trainer, so I thought I would throw it up on the Web for all to see. Hopefully it inspires those not...
Replies
5
Views
6,585
Hi, I would like to assemble a simulator/practice booster pump system that uses PID to maintain steady water pressure under various outlet demands...
Replies
0
Views
82
We are considering dropping our UL membership because most of our customers do not care if we are a 508A shop. However, there may be times when a...
Replies
8
Views
396
I'm looking for some clarification if anyone here is familiar with UL698a panels. Panel is out of zone/class'd area. with thermocouples extending...
Replies
0
Views
119
Back
Top Bottom