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

Reply
 
Thread Tools Display Modes
Old May 14th, 2020, 10:33 AM   #1
pauly
Member
Wales

pauly is offline
 
pauly's Avatar
 
Join Date: May 2002
Location: South Wales,U.k
Posts: 237
Multiple subroutines in Logix 5000

We have an application where we need to indicate a piece of machinery needs maintenance. I have created a routine which resets a value of "days left" when maintenance has been performed and starts counting down the days until the next is due. The maintenance interval, days left etc are part of a UDT, which is passed as a parameter to the subroutine. There is a separate UDT for each bit of machinery.
The problem is, the customer has specified 600 ish pieces of machinery with separate maintenance intervals. This would mean 600 ish subroutine calls which is a bit(?) overwhelming.
Can anybody think of a cleaner way of accomplishing this? The customer didn't want to use AOI's
__________________
Pauly
  Reply With Quote
Old May 14th, 2020, 10:46 AM   #2
_Dock_
Member
United States

_Dock_ is offline
 
Join Date: Sep 2015
Location: KY
Posts: 194
Your customer is probably not going to like my answer but with that many items all probably having their own variables that is not a task for a plc. That is a task for a asset management software that runs on a pc.
  Reply With Quote
Old May 14th, 2020, 12:35 PM   #3
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 792
#1 _DOCK_ is correct: spend every effort to convince the customer to do the the right way.


#2 if they remain unconvinced, charge them through the nose, then do this:


  • make a file, or several files, of these UDTs
  • maintain an index, which may be include a file number as well as a numerical index
  • on each scan
    • call the subroutine once in the scan
      • the subroutine checks UDT[index] only
    • increment the index; roll over from 599 to 0
I am sure I got the syntax wrong, but some form of that approach should be possible.
  Reply With Quote
Old May 14th, 2020, 02:33 PM   #4
Aabeck
Member
United States

Aabeck is offline
 
Aabeck's Avatar
 
Join Date: Feb 2013
Location: Detroit
Posts: 1,796
First - they have a single PLC for 600-ish machines? How many HMI screens would be needed to display upcoming maintenance needs - that could be hundreds weekly.

I think each machine would have its own PLC and if so a single routine can be copied onto each of the machines and run locally. Then have the PLC's message _DOCK_'s system, or better have _DOCK_'s system message reads from all the PLC's.
__________________
Never underestimate the quality of idiots that will be running your machines
http://aabeck.com
  Reply With Quote
Old May 14th, 2020, 09:05 PM   #5
JLand
Member
United States

JLand is offline
 
Join Date: Apr 2019
Location: Madison, Wisconsin
Posts: 9
I agree with drbitboy/dock, but to add I would seriously consider bring an economic argument to the customer's aversion to AOIs. Do they have a maintenance team that is unfamiliar with AOI? Let the customer know you can train them in (at a cost, of course). Even with this training time, the ability to use AOIs for this will still result in fewer work hours for this project alone.
  Reply With Quote
Old May 15th, 2020, 06:48 AM   #6
pauly
Member
Wales

pauly is offline
 
pauly's Avatar
 
Join Date: May 2002
Location: South Wales,U.k
Posts: 237
Thanks for the replies

DRBITBOY

make a file, or several files, of these UDTs
maintain an index, which may be include a file number as well as a numerical index
on each scan
call the subroutine once in the scan
the subroutine checks UDT[index] only
increment the index; roll over from 599 to 0

What do you mean by a file? I was using an array of UDT's is that what you mean?
__________________
Pauly
  Reply With Quote
Old May 15th, 2020, 07:50 AM   #7
BlueAltezza
Member
United States

BlueAltezza is offline
 
Join Date: Nov 2012
Location: Cleveland, OH
Posts: 239
I agree with dock and drbit - not what a plc is best suited for.
JLand brings up a great point that's often overlooked - long term and end user ownership.

Implementing a dedicated system to do what the customer wants will be way less costly over time to set up, install, modify, etc. Sure they have to buy some extra hardware/software now, but the cost of development time will be cut significantly.
  Reply With Quote
Old May 15th, 2020, 10:05 AM   #8
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 792
Quote:
Originally Posted by pauly View Post
DRBITBOY

make a file, or several files, of these UDTs
maintain an index, which may be include a file number as well as a numerical index
on each scan
call the subroutine once in the scan
the subroutine checks UDT[index] only
increment the index; roll over from 599 to 0

What do you mean by a file? I was using an array of UDT's is that what you mean?



Yes, "file" = array, so you are already there. The point is that the code does not need to check every UDT on every scan cycle; if the code checks one UDT per scan cycle, a typical PLC would run through all 600 UDT in a few seconds, and several times per minute, which I expect would be enough for this application.



Re: "file." Sorry, my experience is mostly A-B, so I have started using the A-B jargon and assuming I was normative*, used word "file" instead of array or memory.



* one of humankind's biggest mistakes, and one that i keep repeating; d'Oh!
  Reply With Quote
Old May 15th, 2020, 10:09 AM   #9
pauly
Member
Wales

pauly is offline
 
pauly's Avatar
 
Join Date: May 2002
Location: South Wales,U.k
Posts: 237
Thanks for the replies

Thanks for the reply. Have a good weekend, as good as you can anyway
__________________
Pauly
  Reply With Quote
Old May 15th, 2020, 10:21 AM   #10
mad4x4
Member
United Kingdom

mad4x4 is offline
 
Join Date: Mar 2009
Location: ST CYrus
Posts: 79
Quote:
Originally Posted by pauly View Post
Thanks for the reply. Have a good weekend, as good as you can anyway


I agree with above not the ideal job for a pure PLC (aka rockwell) , what about coding this on a codesys PLC like beckhoff which can handle file management far better and still run down at the sub 10mS time frame in Realtime
  Reply With Quote
Old May 15th, 2020, 03:07 PM   #11
janner_10
Lifetime Supporting Member
United Kingdom

janner_10 is offline
 
Join Date: Dec 2014
Location: Tewkesbury
Posts: 987
He's counting 'Days Left' - I hardly think getting a scan time to 10ms is going to help much.

Displaying days left until maintenance for 600 machines, is just a daft job for a plc.
  Reply With Quote
Old May 22nd, 2020, 03:26 PM   #12
twocozz
Member
United Kingdom

twocozz is offline
 
Join Date: Jul 2007
Location: Doncaster
Posts: 73
To answer the question.

I think you just need a pulse once per day and a couple of arrays. One to count down the time for each machine and perhaps another one to signal that Maintenance is required.

Something like...

if PulseOncePerDay Then
For X := 0 TO 599 Do
if MachineTimeToMaintenance[x] > 0 then
MachineTimeToMaintenance[x] := MachinesTimeToMaintenance[x] - 1;
if MachineTimeToMaintenance[x] = 0 then
MaintenanceRequired[X] := 1;
end_if;
end_if;
end_for;
end_if;

or the ladder equivalent.

“ MachineTimeToMaintenance” is an array of 600 double integers
“MaintenanceRequired “ is an array of 600 Booleans


The whole for – next loop is executed in one scan (once per day). If this was a problem then don’t use a loop, just increment x every scan.

I suspect you would have an array of UDT’s with the maintenance period of each machine. On the HMI you could have an edit box linked to a DINT register in the PLC for the machine you wanted to say you had serviced. And a button to say reset the service time. These could be called “MachineToReset” and “ButonPressResetService”




In the PLC
If ButonPressResetService and MachineToReset >= 0 and MachineToReset < 600 then
MachineTimeToMaintenance[MachineToReset] := UdtMachineDayaArray[MachineToReset]
MaintenanceRequired[MachineToReset] := 0;
End_if;
Or ladder equivalent

Last edited by twocozz; May 22nd, 2020 at 03:32 PM.
  Reply With Quote
Old May 23rd, 2020, 10:14 AM   #13
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 1,567
Quote:
Originally Posted by JLand View Post
I agree with drbitboy/dock, but to add I would seriously consider bring an economic argument to the customer's aversion to AOIs. Do they have a maintenance team that is unfamiliar with AOI? Let the customer know you can train them in (at a cost, of course). Even with this training time, the ability to use AOIs for this will still result in fewer work hours for this project alone.

I think they have a process that can't be stopped and don't want trash that isn't being used left behind in the PLC program. I totally understand their point of view and aversion to use of AOI's.
  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
Studio 5000 logix Designer CliveBaker LIVE PLC Questions And Answers 2 April 11th, 2016 03:31 PM
GSV Wall Clock in RS Logix 5000 - Compact Logix L32E alive15 LIVE PLC Questions And Answers 11 February 3rd, 2016 02:17 PM
Logix 5000 install problem smiller LIVE PLC Questions And Answers 16 May 26th, 2015 10:47 PM
Is RS Linx still on and loaded with the RS Logix 5000 CD ? Rob S. LIVE PLC Questions And Answers 5 October 21st, 2014 04:24 PM
RS Logix 5000 training exercises bmw_apprentice LIVE PLC Questions And Answers 4 April 9th, 2008 10:27 AM


All times are GMT -4. The time now is 06:34 AM.


.