jpen_110

Newbie - Help. on Omron Sysmac S6

62 posts in this topic

Hello-


I am looking for some existing code to reference to try to troubleshoot an old machine.  It has a Omron Sysmac S6 console and I've been able to get the individual inputs and outputs to activate via the console, but the code that is in the machine seems to not be correct.  I suspect someone got in there and overwrote a bunch of the initial lines of the program.  Again, I can control the machine manually through using the console, but want to now automate it.  I've done the program checks and have a whole host of errors, including double coil errors, a missing IL error and circuit errors.  

Ideally, I'd like to see what the code looks like to "start" the machine with a button (input 9) as an example and also see how that input can keep one output "ON" or running constantly (output 27) while then activating several outputs in sequential order, individually for a set period of time or until they activate a certain sensor (as an example input 6). 

 I've mapped out and am attaching what I believe the process flow to be.   I am also attaching the code as I pulled it off the machine.  Again, I don't believe the code to be correct.  Thank you for reading this.

Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites

@jpen_110  Programs are different from machine to machine, so sample code may not help.  Also, the code is not attached.

Share this post


Link to post
Share on other sites

Your code would help. S6 had a habit of scrambling the first instruction.  Please post your mapping and code as pulled off the machine. 

Share this post


Link to post
Share on other sites

Here you go. 

Step

Function Logic Time
000 TIM 4 000
001 TIM 5 010
002   6 010
003   1 010
004   2 030
005 AND   68
006 AND   0
007 __LR KR 7
008 __OR LD  
009 OUT   27
010 __LD   15
011 __OR   14
012 AND NOT 8
013 OUT   24
014 __LD_NOT_CNT   0
015 __OR   65
016 AND NOT   67
017 AND NOT   66
018 AND   68
019 __OR   19
020 TIM 7 040
021 __LD_NOT  KR 7
022 __IL_END    
023 __LD_NOT   11
024 AND_NOT   81
025 AND_NOT   82
026 AND_NOT   66
027 AND   65
028 AND_CNT   0
029 AND   19
030 OUT   25
031 _LD_NOT TIM 7
032 AND   19
033 OUT   26
034 _LD    11
035 AND_NOT KR 7
036 _LD_TIM   7
037 AND KR 0
038 _OR LD  
039 AND_NOT TIM 1
040 AND_NOT   81
041 _IL    
042 TIM 0 005
043 _LD_TIM   0
044 AND_NOT KR 7
045 OUT   12
046 _IL_END    
047 _LD_NOT   2
048 _LD_NOT   28
049 _OR_LD    
050 AND   81
051 AND   4
052 _LD   2
053 AND   28
054 __LD   109
055 __OR LD  
056 _KR   0
057 _LD_TIM   1
058 AND_NOT   82
059 AND_NOT KR 7
060 OUT   13
061 _LD   16
062 _OR   17
063 _OR   23
064 _OR   25
065 _OR   23
066 AND NOT   15
067 OUT   21
068 _LD   15
069 OUT   22
070 _LD   6
071 _OR   7
072 _LD   3
073 _OR   15
074 AND__LD    
075 AND   81
076 AND NOT   4
077 AND_NOT TIM 1
078 AND_NOT KR 7
079 OUT   15
080 _LD TIM 1
081 AND_NOT   3
082 AND   82
083 AND NOT KR 7
084 OUT   14
085 _LD   4
086 AND   81
087 _LD   64
088 _OR__LD    
089 AND_NOT   67
090 OUT   64
091 _LD   64
092 TIM 1 010
093 _LD   3
094 TIM 2 030
095 _LD_NOT TIM 2
096 AND   3
097 OUT   67
098 _LD   9
099 _OR   68
100 AND   0
101 OUT   68
102 _LD   3
103 AND_NOT   75
104 OUT   74
105 _LD   3
106 OUT   75
107 _LD   74
108 AND   77
109 _LD_NOT   74
110 AND   76
111 _OR__LD    
112 OUT   76
113 _LD   74
114 AND_NOT   76
115 _LD_NOT   74
116 AND   77
117 _OR__LD    
118 OUT   77
119 _LD   76
120 AND_NOT   17
121 AND_NOT   6
122 AND   27
123 AND   3
124 AND_NOT KR 7
125 OUT   16
126 _LD_NOT   76
127 AND_NOT   16
128 AND_NOT   7
129 AND   27
130 AND   3
131 AND_NOT KR 7
132 OUT   17
133 _LD   74
134 _OR   80
135 AND_NOT TIM 3
136 OUT   80
137 _LD   80
138 TIM 3 020
139 _LD   80
140 _LD   9
141 _OR_NOT   10
142 _OR_NOT   0
143 _OR   109
144 CNT 0 002
145 _LD_TIM   5
146 LD_TIM   6
147 OR__LD    
148 AND_NOT KR 7
149 AND   27
150 OUT   18
151 _LD   1
152 OUT   20
153 _LD   76
154 AND_NOT   6
155 TIM 5 010
156 _LD   77
157 AND_NOT   7
158 TIM 6 010
159 _LD_TIM   5
160 _OR_TIM   6
161 OUT   66
162 _LD   31
163 AND   10
164 _LD   109
165 _OR   9
166 _OR_NOT   10
167 _KR   7
168 _LD   12
169 AND   5
170 _LD   81
171 AND_NOT_TIM   1
172 _OR__LD    
173 OUT   81
174 _LD   13
175 AND   5
176 _LD   82
177 AND_NOT   3
178 _OR_LD    
179 OUT   82
180 END    

Share this post


Link to post
Share on other sites

Thanks for the feedback.  The code was manually recorded into an excel file which I posted above.  Thanks again.

Share this post


Link to post
Share on other sites
Number Class Description
0 Input Hopper Low Level Sensor
1 Input Hopper High Level Sensor
2 Input Pre-Press Cylinder Down Sensor
3 Input Main Cylinder Retracted Sensor
4 Input Main Cylinder Pressure Sensor
5 Input Pre-Press Cylinder Pressure Switch
6 Input Tool Left Sensor
7 Input Tool Right Sensor
8 Input Main Cylinder Bypass Pressure Switch
9 Input Start Pushbutton Switch
10 Input Stop Pushbutton Switch
11 Input TD-1
12 Output Pre-Press Cylinder Extend
13 Output Pre-Press Cylinder Retract
14 Output Main Cylinder Retract
15 Output Main Cylinder Extend
16 Output Tool Cylinder Left
17 Output Tool Cylinder Right
18 Output Fault Light
19 Output TD-1
20 Output Hopper Full Contact (115 VAC 2 AMP Max)
21 Output Diverter Solenoid Side A
22 Output Diverter Solenoid Side B
23 Output Open
24 Output Main Cylinder Bypass Solenoid
25 Output Auger Motor
26 Output Agitator Motor
27 Output Hydraulic Motor
28 Input Main Cylinder Extended Sensor

Share this post


Link to post
Share on other sites

I have started the analysis but will not finish until Monday due to other commitments.  It is my belief that someone deleted only the first few lines of code.  The rest looks proper,

Share this post


Link to post
Share on other sites

Also what is the set value for CNT 0?

Share this post


Link to post
Share on other sites

Wow.  Great to know.

The line with CNT has a 0 and then 002.  Is this what you are asking?

 

Share this post


Link to post
Share on other sites

Yes

Share this post


Link to post
Share on other sites

Merry Christmas! I'm back,

Spent two long sessions in the dialysis chair analyzing your data.

First, there must be a switch or voltage connected to Input 31.  It is referenced in the program related to StopMode KR7.  Therefore I have put Input 31 in the first line of your program.

Second, there are references to Output 23 but there is no coil in the program for Output 23.  Is there anything connected to Output 23?

Third. There are contacts for 64 but no coil in the program,

Fourth, I converted the program to C20K which is the closest upgrade to S6 so that I could print ladder from the statement list.

There is a txt file with the old S6 addresses so you can continue to analyse as you are with the machine and I am not.

Lastly there is doc file with the ladder program converted,  Please print in landscape,

S6.txt

PRINT.docx

Share this post


Link to post
Share on other sites

WOW JAY.  Incredible.  Thank you for all of this.

Let me check on the input 31 and output 23. I do believe they are both open, but given your expertise and my lack of knowledge, I suspect I am missing something.  I also don't see any thing for 64, at least not as a hard output.  I will check this as soon as we get back.

I see both the ladder diagram and the S6 file.  I don't see the program code converted into statement code, however.  That will be awesome to have as I am still trying to wrap my head around how this code works.

Jay-I am super grateful for what you've done here and would love to get your address.

Cheers!

James

 

 

 

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites
Quote

I also don't see any thing for 64, at least not as a hard output. 

64 is an internal bit, so don't look for a wired connection.

Share this post


Link to post
Share on other sites

Checked machine.  No wires are hooked up to either output 23 or input 31.  I reviewed the 64 and 65, and it doesn't seem to be coded to anything as when I try to force set them to being on, nothing happens. Would it be to bold at this point to:

  • wipe out existing code
  • load up new code into S6, as written
  • Turn key to RUN
  • Press the "start button" (input 9) and see what happens?

Thanks again Jay.

Share this post


Link to post
Share on other sites

Getting ready to go to another four hour dialysis session.  I will think about your next steps.  I o not think it will be necessary to clear the program and reenter it. Too much chance for mistakes. I think  I can guide you in making the changes. Let me make a punch list of changes.

Share this post


Link to post
Share on other sites

Punch list:

1. Your listing shows all of the timers at the beginning of the code. I don't believe they are there or if they are they shouldn't be. Please confirm and let's discuss.

2. We need to insert LD NOT 31 at step 000 of the code. Please review the manual on how to do this.

3. Search for Out 25. Back up 3 steps. Change to AND NOT 65.

4. Search for Out 16. Back up 2 steps. Change to AND NOT KR3.

5. Search for Out 17. Back up 2 steps. Change to AND NOT KR3.

6  Search for Out 66. Forward 1 step. Change to LD NOT 31.

Take your time. It's very easy to make mistakes. Verify with Key Switch in MON Mode.

Share this post


Link to post
Share on other sites

Thanks again Jay.  I think I got a little too excited about your progress and went ahead, before seeing this, and wiped the program and keyed in your code from the S6toCK2Code file.  Sorry.   So I have a few questions:

Should I just rekey the old code back in and follow the above steps, or better to proceed as is? 

IF the answer is proceed as is, my questions are:

1). If better to proceed as is, I ran the diagnostics and it came up with 3 errors:

  • Step 105: Coil Double Out 75
  • Step 020:  Circuit Error IL END. - When looking at the code, I entered an IL statement at step 7 so I don't understand the IL END.
  • Step 087:  Circuit Error Out 64

2). Also, when keying, I wasn't sure how to keep the command "keep" (step 49).  I keyed it as KR 7.  This occurs again at step 160.

3).  Your above post comments that we should add a LD NOT 31 line into the old code, the "new code" begins with LD 31.  I assume that is OK as the old and new, while doing similar things get there in different ways.  Just wanted to check.

4).  In order for the machine to "run", with your code, can you specify what inputs (sensors) need to be on or maybe better, off? I can't really tell if the status Hopper Full makes it "run" or makes it "stop".  Hopper Full, I think, is a status where the machine should run (meaning there is enough materials in there to begin processing).

Share this post


Link to post
Share on other sites
  • Step 105: Coil Double Out 75
  • Check Step 112 for Cut 76.
  •  
  • Step 020:  Circuit Error IL END. - When looking at the code, I entered an IL statement at step 7 so I don't understand the IL END.
  • Check Step 19.  Delete LD NOT KR7.
  •  
  • Step 087:  Circuit Error Out 64
  • Check Step 85 for OR LD 
  •  
  • Also, when keying, I wasn't sure how to keep the command "keep" (step 49).  I keyed it as KR 7.  This occurs again at step 160.
  • That is correct.
  •  
  • Your above post comments that we should add a LD NOT 31 line into the old code, the "new code" begins with LD 31.  I assume that is OK as the old and new, while doing similar things get there in different ways. 
  • Change LD 31 to LD NOT 31
  •  
  • I can't really tell if the status Hopper Full makes it "run" or makes it "stop". 
  • Is Input 0 on when there is material in the hopper.?

 

Js

Share this post


Link to post
Share on other sites

Thanks Jay.  Great actionable feedback. You are a wiz!

  • Input 0 is when there is material in the hopper.  When it goes OFF, then presumably there is either not enough material in the hopper, or somehow the material has "bound up" and keeps the hopper high sensor on, while a air bubble of sorts gets created below, so again - no material available in the right place to process.

Confirming comments above:

  • Step 000:  Change from LD 31 to LD NOT 31
  • Step 112: Change from LD 75 to LD 76 (clearly a keying error as that is what is should have been)
  • Step 085:  Change from TIM1 to OR LD
  • Step 019:  Will delete this step entirely (this should then adjust all the step numbers I presume, so I will do this last)

Share this post


Link to post
Share on other sites
  • Step 085:  Change from TIM1? 'to OR LD?
  • LD 4 
    AND 81
    LD 64
    Insert OR LD  
    AND NOT 67
    OUT 64
     

Share this post


Link to post
Share on other sites

Are you documenting the current code?  If so, post text file.

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