You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old February 5th, 2018, 07:26 AM   #1
btaaa
Member
United States

btaaa is offline
 
Join Date: May 2012
Location: Metro Detroit
Posts: 16
Logix Riddle - Indexing

I've been programming for a long time, and for some reason I'm stumped on this. I have an indexing over/under slat conveyor. There are 36 total pallet tops, with 18 operator stations. Obviously, there are always 18 on top, and 18 on the bottom return. When we have a jam up issue that requires us to reverse and reset the system, I have to go in and update each station's pallet value. I've been trying to create logic as so I only have to enter one station's number, and the rest will automatically update. Any ideas?

For example:

If we were to update lets say, station 14, with a pallet ID of 22, then station 15 would automatically update to 21, 16 to 20, etc. . . with the premise that the number starts back over at 36.

Thanks for any help

Logix5000
  Reply With Quote
Old February 5th, 2018, 07:42 AM   #2
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,380
Can't you just trigger logic that makes each station's pallet equal to the previous station's -1.

You might need to tell the logic where to "start", in your example station 14, so the logic doesn't update values it doesn't have to.

Or you might be able to use a FOR loop. I'll have a play....
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Old February 5th, 2018, 08:11 AM   #3
kvogel
Member
United States

kvogel is offline
 
Join Date: Jan 2011
Location: Colorado
Posts: 63
I use a scheme where each station has an "offset" assigned to it. The offset is the number of stations away from a "home" station. All that needs to be kept track of is the current pallet at the home station and then use the "home pallet" number and the offset to calculate the "station pallet" for each station. A function block or modolo calc takes care of this for each station. Makes it easy to reset or commission as you only need to enter the number of the pallet at the home station. Makes short work of a lot of other "pallet location" housekeeping as well.

Cheers

Ken
  Reply With Quote
Old February 5th, 2018, 08:33 AM   #4
btaaa
Member
United States

btaaa is offline
 
Join Date: May 2012
Location: Metro Detroit
Posts: 16
Quote:
Originally Posted by kvogel View Post
I use a scheme where each station has an "offset" assigned to it. The offset is the number of stations away from a "home" station. All that needs to be kept track of is the current pallet at the home station and then use the "home pallet" number and the offset to calculate the "station pallet" for each station. A function block or modolo calc takes care of this for each station. Makes it easy to reset or commission as you only need to enter the number of the pallet at the home station. Makes short work of a lot of other "pallet location" housekeeping as well.

Cheers

Ken
thanks. Will try this.
  Reply With Quote
Old February 6th, 2018, 06:49 AM   #5
btaaa
Member
United States

btaaa is offline
 
Join Date: May 2012
Location: Metro Detroit
Posts: 16
Quote:
Originally Posted by daba View Post
Can't you just trigger logic that makes each station's pallet equal to the previous station's -1.

You might need to tell the logic where to "start", in your example station 14, so the logic doesn't update values it doesn't have to.

Or you might be able to use a FOR loop. I'll have a play....
How do you handle this with pallet numbers exclusively 1-36? For instance, lets say I enter a value of 2 in station 18. The value in station 15 would be the value of station 18 minus 3, which would then equal -1. I know that with a ton of ladder I can accommodate this, but I'm not seeing anything simple for this.
  Reply With Quote
Old February 6th, 2018, 07:27 AM   #6
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,380
Quote:
Originally Posted by btaaa View Post
How do you handle this with pallet numbers exclusively 1-36? For instance, lets say I enter a value of 2 in station 18. The value in station 15 would be the value of station 18 minus 3, which would then equal -1. I know that with a ton of ladder I can accommodate this, but I'm not seeing anything simple for this.
Let me requote the problem, and see if I am understanding the issue....

You have 18 operator stations numbered 1 to 18

Each operator station has a pallet on it, pallets are numbered 1 - 32.

So you could have ....

Code:
Station:  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18
Pallet :  6  5  4  3  2  1 32 31 30 29 28 27 26 25 24 23 22 21
Is this correct ?

You want to be able to "Reset" the system by entering just one pallet number into any one station ?

EDIT : Would it be acceptable to always update station 1 with the pallet number on it, and the rest will re-number automatically ?
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem



Last edited by daba; February 6th, 2018 at 07:31 AM.
  Reply With Quote
Old February 6th, 2018, 07:48 AM   #7
btaaa
Member
United States

btaaa is offline
 
Join Date: May 2012
Location: Metro Detroit
Posts: 16
Quote:
Originally Posted by daba View Post
Let me requote the problem, and see if I am understanding the issue....

You have 18 operator stations numbered 1 to 18

Each operator station has a pallet on it, pallets are numbered 1 - 32.

So you could have ....

Code:
Station:  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18
Pallet :  6  5  4  3  2  1 32 31 30 29 28 27 26 25 24 23 22 21
Is this correct ?

You want to be able to "Reset" the system by entering just one pallet number into any one station ?

EDIT : Would it be acceptable to always update station 1 with the pallet number on it, and the rest will re-number automatically ?

Yes, 18 stations, 36 total pallet tops. It's an over/under slat conveyor, so only half the pallets are on top at any given time, while the other half are returning underneath. I don't care whats returning underneath. Example:

Station 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Pallet # 32 33 34 35 36 1 2 3 4 5 6 7 8 9 10 11 12 13
Under# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14

I would like to enter a number into station 18, and then have stations 1-17 update automatically, without a hundred rungs of logic.
  Reply With Quote
Old February 6th, 2018, 07:51 AM   #8
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,380
Quote:
Originally Posted by btaaa View Post

I would like to enter a number into station 18, and then have stations 1-17 update automatically, without a hundred rungs of logic.
I've written the code so you can update station 1, and the rest will follow - will that help you ?

EDIT : Modified so you can update Station 18 as you requested..... just 2 rungs of code
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem



Last edited by daba; February 6th, 2018 at 08:14 AM.
  Reply With Quote
Old February 6th, 2018, 08:48 AM   #9
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,380
Here is the code - all working....

The rung without the branch triggers the "Update_Pallets" "FOR-NEXT" loop
Attached Images
File Type: jpg 2018-02-06_142938.jpg (19.0 KB, 26 views)
File Type: jpg 2018-02-06_142958.jpg (18.3 KB, 18 views)
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Old February 6th, 2018, 09:22 AM   #10
btaaa
Member
United States

btaaa is offline
 
Join Date: May 2012
Location: Metro Detroit
Posts: 16
I'll give her a try.
  Reply With Quote
Old February 7th, 2018, 06:17 AM   #11
btaaa
Member
United States

btaaa is offline
 
Join Date: May 2012
Location: Metro Detroit
Posts: 16
Quote:
Originally Posted by daba View Post
Here is the code - all working....

The rung without the branch triggers the "Update_Pallets" "FOR-NEXT" loop
The code actually works and updates the data correctly, but I get a Major Fault every time I enter the number.

(Type 4)Program Fault
(Code 20) Array subscript too large, or CONTROL data type POS or LEN invalid
Main Task
Main Program
Update_Pallets
Rung 1 (your CPT and SUB rung)

I have all addresses referenced as DINTs.

I have both rungs in separate ladder files (Putting both rungs in same ladder file Major Faults automatically)

Again, only faults out when I update the pallet number - although the data updates correctly.
  Reply With Quote
Old February 7th, 2018, 06:50 AM   #12
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,380
Quote:
Originally Posted by btaaa View Post
The code actually works and updates the data correctly, but I get a Major Fault every time I enter the number.

(Type 4)Program Fault
(Code 20) Array subscript too large, or CONTROL data type POS or LEN invalid
Main Task
Main Program
Update_Pallets
Rung 1 (your CPT and SUB rung)

I have all addresses referenced as DINTs.

I have both rungs in separate ladder files (Putting both rungs in same ladder file Major Faults automatically)

Again, only faults out when I update the pallet number - although the data updates correctly.
I have it working here, no problem.... tried it several times and no major faults.

Are you using an 18-element array for your stations ?

Have you modified it to use array indexes 1 to 18 to match the station numbers ?

I suspect you might have put a JSR to the Update_Pallets routine. Not needed, the FOR instruction calls this routine the required number of times...
Attached Images
File Type: jpg 2018-02-07_125955.jpg (125.4 KB, 5 views)
File Type: jpg 2018-02-07_130016.jpg (122.0 KB, 6 views)
File Type: jpg 2018-02-07_130035.jpg (125.2 KB, 5 views)
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem



Last edited by daba; February 7th, 2018 at 07:02 AM.
  Reply With Quote
Old February 7th, 2018, 07:25 AM   #13
btaaa
Member
United States

btaaa is offline
 
Join Date: May 2012
Location: Metro Detroit
Posts: 16
Quote:
Originally Posted by daba View Post
I have it working here, no problem.... tried it several times and no major faults.

Are you using an 18-element array for your stations ?

Have you modified it to use array indexes 1 to 18 to match the station numbers ?

I suspect you might have put a JSR to the Update_Pallets routine. Not needed, the FOR instruction calls this routine the required number of times...
Thanks, it was the JSR. I've never used the FOR command. I've never used a lot of the commands, unfortunately. Thanks for the help. This was a stumper for me. Will integrate and give her a go.
  Reply With Quote
Old February 7th, 2018, 07:34 AM   #14
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,380
Quote:
Originally Posted by btaaa View Post
Thanks, it was the JSR. I've never used the FOR command. I've never used a lot of the commands, unfortunately. Thanks for the help. This was a stumper for me. Will integrate and give her a go.
It is one that catches many....

The usual complaint that something doesn't work is due to the subroutine not being called (by a JSR).

The FOR instruction is, I think, the only other instruction that calls a subroutine, and people often forget about it, see an "un-called" sub, and slap a JSR in. That's when controllers fault....
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem



Last edited by daba; February 7th, 2018 at 07:43 AM. Reason: missed word - in red
  Reply With Quote
Old February 7th, 2018, 07:36 AM   #15
btaaa
Member
United States

btaaa is offline
 
Join Date: May 2012
Location: Metro Detroit
Posts: 16
Quote:
Originally Posted by daba View Post
It is one that catches many....

The usual complaint that something doesn't work is due to the subroutine not being called (by a JSR).

The FOR instruction is, I think, the only instruction that calls a subroutine, and people often forget about it, see an "un-called" sub, and slap a JSR in. That's when controllers fault....
Yea, I'm surprised it lets you save something like that. Pretty significant.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Control logix. Soft & Compact Logix rslogix 5000 macs_plc LIVE PLC Questions And Answers 4 June 27th, 2016 02:51 AM
Control Logix 1756 jamalshahid LIVE PLC Questions And Answers 9 May 8th, 2012 10:24 AM
Compact Logix Remote Racks The Plc Kid LIVE PLC Questions And Answers 10 September 29th, 2009 05:11 PM
Power Flex, Drive Logix and Control Logix Tim LIVE PLC Questions And Answers 2 January 4th, 2007 05:37 PM
Producer Consumer Messging between Control Logix & Compact Logix plcnovel LIVE PLC Questions And Answers 15 July 24th, 2006 10:04 AM


All times are GMT -5. The time now is 11:52 PM.


.