Sign in to follow this  
Followers 0
OkiePC

[PLC Sample Code] - Generic Sequencer

3 posts in this topic

File Name: Generic Sequencer File Submitter: OkiePC File Submitted: 30 Apr 2009 File Updated: 29 Nov 2012 File Category: PLC Sample Code This program is used to construct a sequencer with both input and output sequencing. The excel file is used to design the sequencer and includes features to update the user selectable files in a PLC using DDE. The PLC program sequences the inputs meaning that the input pattern for each step determines when the sequencer advances. A mask file is used for the inputs so that those that are irrelevant for a particular step can be ignored. This program does not use the classic sequencer instructions but uses MEQ and MOV instructions with indirect addressing instead. This leaves the end user more flexibility for controlling the step number. Update r002: Added CLR instruction to the diagnostic word so that it does not hold "old data" as the sequencer advances. EDIT: Added a beefed up version* for a real world machine (OK International 220 Servo bag inserter.) This program is not fully polished, I think the version here was after a few hours of refinement, and then stripping it down for speed. Today, I hit a full 17.5 bags per minute replacing logic that was running at 14.5 bags per minute. I ended up removing another input conditon for the seal bar timer, finding that it doesn't need to inhibit the opener from opening. I need to put in a discharge timer to keep the belt running long enough to send the last box out when finished even when the downstream is blocked, but continue to hold back the input clamps. it would be handy to cycle stop and have the machine empty itself too. My main next goal on this particular machine, is to find out why the Ultra drive is not ready and homing quickly enough. I think my reset times are worse than the old logic! It seems I have to wait 5.5 seconds after the drive is ready before I can send it a successful home trigger. Today, I tried keeping logic power applied, and it did well until someone had to physically move this linear device and caused regeneration which triggered a non-recoverable (must power cycle)... E41...So, I can't cheat with two black wires unless I add a shunt or an output contactor to dodge this hard fault. The extra effort will be an amazing improvement in recovery times when they have to open the doors. Now it take almost en seconds sometimes to reset and then reset. I must be sequencing the output logic to the Ultra drive incorrectly,.but I have altered it several times with little improvement. There will be more trial and error with the wiring and perhaps a DB to get this right. *The 2nd file includes a rate calculation (boxes per minute in this case) as well as a programmable minimum and fault timeout for each step, multiple modes (auto, manual, single step, bag only). Known limitations: I have realized the need to add a macro button to the xls sheet which would read back the PLC sequencer data and populate the bit fields in the sheets. I also still need to lock the references so you can move the raw data without hosing up the references on other sheets. For use as-is, just don't drag the raw bit data or insert data, copying and pasting is fine to move steps forward and backward. I also need to add to the excel sheet some columns for minimum time in step, and fault times so they can be edited from the workbook too. Click here to download this file

Share this post


Link to post
Share on other sites
Wow, I really need to update this thing. I can't even open it at home though. I need to write r003 for the Micro Starter Edition of RSLogix500, and make it 64 bits wide too, with a Crimson 3.0 emulator washing machine with crazy extra I/O added...I didn't even go into doing thing like bit packing a drive with eight presets driven by 3 ditigal inputs into a sequncer output file from an HMI list object with eight values listed for him, or talk about input state trace tables which would be an easy addition. This can tell the end user in high speed applications exactly which devices are the last to go true for each step for example....Yes, the generic sequencer pdf file shows outputs mapped to slot 30? but no inputs mapped? Yep, I need to back up and punt this thing into something more widely demonstrable. Edited by OkiePC

Share this post


Link to post
Share on other sites
I found a use for this sequencer to replace some tuurd logic from an OEM... I added time recording to the millisecond level for this ML1500 program attached. If you happen to have a OK International OK220 SL servo bag inserter you can probably remap the I/O and run it for your self. The HMI code is not complete, now that I have repegged it and tuned the machine up (112% throughput with my program after two days of testing and adjusting). The output control logic diverts the flow of cartons to two different chutes using air nozzles to blow empty boxes from one conveyor to another. The nozzles are relatively high in cfm consumption (about 5-6 scfm) but only run for about 10% duty cycle. Plus, there are no pinch points and zero actuator maintenance compared to a "box kicker" or gate. I had no input onto the layout of these little toy conveyors they bought...I just had to make it work. I have two older non servo OKI 200 machines that are going to get this logic applied. They have 5/02 processors and no HMI, but I have two of the old model G304Ks on the shelf needing a good dusting off. This thing is suffering from preset speed VFD control with a fixed time for feed length control. It is begging for a stepper or at least some PLC smarts + analog card. It also could use a film jam sensor, which I do intend to carry out and update the file here sometime soon. Edited by OkiePC

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0