Basic Programming

cougar440

Member
Join Date
May 2017
Location
Pennsylvania
Posts
5
HI Folks:
I am new to PLCs, teaching my self with the Koldwater course, SLC-500. I am studying the Jump / TND and LBL commands.

In writing a PLC program is it a bad idea to use the same I/0 address in both the main ladder and the area bounded by the JMP and TND. I have the same question for inside the main ladder program and inside various subroutines. My thought for using the same I/O addresses is that it may be easier to follow with fewer addresses to consider.

Thanks in advance
 
Welcome to the Forum!

Generally the answer would be yes, that is a bad idea. In terms of trying to follow along with what the program is doing it will make it more confusing because you will have to be watching very closely to see if a bits status is having an effect on the JMP/LBL, sub-routine, or main routine. It is much easier if you can use separate address for each situation. There are certainly cases where this is not possible, but when you can use a different bit , it is probability best to do so.

Bubba.
 
Thanks Buba, I am currently writing a routine to start 3 vs 6 conveyers and stop them. The 3 vs 6 routine are separated via the jump /JMP command. I will use new different addresses.

Cougar440
 
One thing you CAN do in a situation like you described is to use permissives. It works like this:

You have some logic that determines if bit1 should have a 1 or zero in it's bitbox
You have your other subroutines determine if bit2 should have a 1 or zero in it's bitbox

You use another rung elsewhere in the program that evaluates all of your permissive bits to actually turn on the output. This way each bit and output is only used ONCE in the program as an OTE or OTL. Most importantly, your output itself is only used ONCE as an OTE or OTL. This eliminates confusion and gives you the flexibility to have conditions for that output wherever you need.
 
Don't use LBL/JUMP, like, ever.

It confuse the heck out of people who will have to support the program.

I completely agree if you are writing a program for equipment that will actually get used. But in terms of learning in a classroom environment, it is good to learn what the JMP/LBL does and how. Even if it is just to find out why they should be avoided like the plauge.


Bubba.
 
Updated Program Incorporating Sugestions

HI Folks:

I updated my program as recommended. But I get strange behavior when I run it, only the code outside the JMP - TND sections will work properly unless my output section is at the top of the program. Let me give some specifics.

I am using a Koldwater simulator for the AB SLC-500 to run this. The object of the program is to use the JMP, TND & LBL commands to run a 3 or 3+3 = 6 conveyer system using the JMP to bypass the 3 conveyer code. Each conveyer comes on at a different time and shuts down at a different time and in reverse order of start up. This is one of the projects in the Koldwater training.

I replaced all of the outputs between the JMP - TND and LBL - End sections with internal relays so as not to refer to the same output in two places. Then I associated the internal relay with an output. I have three control switches, Start, Stop and the jump switch.

When the output section is between the bottom of the LBL instructions and the program END (after rung 32 but before 33), only the 6 conveyer section works in setting the outputs (rungs 16 to 32), and when I place the output section Above where the JMP command rung is positioned (as shown in the attachment) both the 3 and six conveyer sections work fine.

In trying to troubleshoot the program behavior when the output section is after the 6 conveyer code, I can see that the bit status is working fine, in both the 3 or 6 conveyer system, but even though the internal relays (B3) is directly connected in the output, the output does not energize. Maybe this is a simulator bug - not sure, but wanted to get any comments folks have.

I will enclose my working program where the output section is placed first so that my descriptions are more clear. The output section is shown as rungs 0 through 5. So the code is as shown works fine, when the output section is placed starting after rung 32 it does not work. Since I am training my self, any comments on program approach are welcomed.

Thanks in advance for any comments folks have.

Cougar440
 
Last edited:
I would need to see the program in its "not working" state to give any sort of educated guess. Your question does however reinforce the basic concept that the JMP/LBL instructions are a much bigger PIA than they are worth. So if nothing else you are learning how not to do things. That alone makes the lesson worth doing.

Bubba.
 
Thanks Bubba for your response. The non working version just places the output section at the end. I will enclose it for clarity.

Thanks again for all the comments I got.
Cougar440.
 

Similar Topics

Hello there, I'm practically new to the PLC world, I'm quite familiar with Siemens TIA Portal but I'm currently tasked to program Schneider PLCs...
Replies
5
Views
1,854
Hello, I am new to plc programming. I am trying to program a flow meter (E&H promag 50) in somachine basic to achieve the following: 1...
Replies
5
Views
2,393
Dear experts, I am want to program RS view32 with help of Microsoft visual basic (visual basic editor). But how to start I don't know,please...
Replies
10
Views
2,369
Hello all, i am planning to start basic plc and programming classes online if anybody is interested mail me
Replies
3
Views
1,396
Hello All, I am learning how to convert RSLogix 500 programs to Studio 5000 programs and I have run into a problem that is quite basic. Whether I...
Replies
12
Views
3,044
Back
Top Bottom