STL code problem

userxyz

Member
Join Date
May 2002
Location
any
Posts
2,768
Hi,

problem I have is... I have a step program, and in step 60 I get a break of a few seconds, while everything seems to be good... I did not write the code myself and have some questions about this step, here is the code:

Code:
M153: A	 "DB aanvoer1".Stappen[60]
	  JCN   S120
	  AN	"DB aanvoer1".toestemming
	  JC	M154
	  S	 "DB ponsbank1 uitg".EVP200in
	  R	 "DB ponsbank1 uitg".EVP200uit
	  S	 "DB ponsbank1 uitg".EVP201in
	  R	 "DB ponsbank1 uitg".EVP201uit
	  R	 "DB ponsbank1 uitg".EVP202in
	  S	 "DB ponsbank1 uitg".EVP202uit
	  R	 "DB ponsbank1 uitg".EVP203in
	  S	 "DB ponsbank1 uitg".EVP203uit
	  S	 "DB ponsbank1 uitg".EVP204in
	  R	 "DB ponsbank1 uitg".EVP204uit
	  L	 "DB ponsbank1 pos".P[2]
	  T	 "DB ponsbank1 uitg".motorsend
	  L	 "DB aanvoer1 pos".P[7]
	  T	 "DB aanvoer1 uitg".motorsend
	  A(	
	  CALL  "Comparer avec Marge"
	   IN1  :="DB aanvoer1 pos".P[7]
	   IN2  :="DB aanvoer1 uitg".motorres
	   Marge:=5.000000e-003
	  A	 BR
	  )	 
	  JNB   M156
	  CALL  "Comparer avec Marge"
	   IN1  :="DB ponsbank1 pos".P[2]
	   IN2  :="DB ponsbank1 uitg".motorres
	   Marge:=5.000000e-003
M156: A	 BR
	  A	 "FC200-"
	  A	 "FC201-"
	  A	 "FC202+"
	  A	 "FC203+"
	  A	 "FC204-"
	  A	 "DB scherm".stapknop
	  R	 "DB aanvoer1".toestemming

M154: A(	
	  CALL  "Comparer avec Marge"
	   IN1  :="DB aanvoer1 pos".P[7]
	   IN2  :="DB aanvoer1 uitg".motorres
	   Marge:=5.000000e-003
	  A	 BR
	  )	 
	  JNB   M157
	  CALL  "Comparer avec Marge"
	   IN1  :="DB ponsbank1 pos".P[2]
	   IN2  :="DB ponsbank1 uitg".motorres
	   Marge:=5.000000e-003
M157: A	 BR
	  A	 "FC200-"
	  A	 "FC201-"
	  A	 "FC202+"
	  A	 "FC203+"
	  A	 "FC204-"
	  JCN   S120
	  R	 "DB aanvoer1".Stappen[60]
	  S	 "DB aanvoer1".Stappen[300]
	  L	 61
	  T	 "DB scherm".stapaanvoer1

Ponsbank and Aanvoer are set in positions 2 and 7. From "DB aanvoer1".toestemming until label M154 there is action code and step/step compares, to work in step/step (test mode). When running automatically "DB aanvoer1".toestemming is high, so in automatic mode we jump over code into label M154, this means that the problem should be found there...

Is the and function of the 2 compares well written ???
 
My guess is that the compares are comparing demanded position with actual position and the step holds until the position error falls below the value coded in the compare blocks. If it is a small threshold, everything may appear to stop for a short time, but, something is just moving very slowly getting into final position.
 
Code:
	  A(	
	   CALL  "Comparer avec Marge"
	   IN1  :=MD0
	   IN2  :=MD4
	   Marge:=5.000000e-001
	  A	 BR
	  )	 
	  JNB   _001
	  CALL  "Comparer avec Marge"
	   IN1  :=MD8
	   IN2  :=MD12
	   Marge:=5.000000e-001
_001: NOP   0


this peece comes from ladder..., A BR behind it, and we get result after the 2 compares...

but still, why does my the code breaks a few secs, is there something wrong ?
 
hey

I don't see the BR bits change, but maybe they change, but I cannot see this because, when these are okay the code goes to the next step... ?

Maybe I'll have to try to change my compares a little bit... ?

L D[AR2 said:
My guess is that the compares are comparing demanded position with actual position and the step holds until the position error falls below the value coded in the compare blocks. If it is a small threshold, everything may appear to stop for a short time, but, something is just moving very slowly getting into final position.
 
...

I changed marge in the compare

it's all good now, I was comparing 0,005 mm precisely, now I changed this to 0,5 mm
 

Similar Topics

Hi, I've got this code and want it in ladder. My biggest problem is what the first line means L B#(52, 1) CALL FC 58; T MW 60 Thanks...
Replies
2
Views
1,651
FUNCTION "Auto_Weergave2" : VOID TITLE =Grafische weergave van de cyclusverwerking VERSION : 0.1 VAR_OUTPUT i1 : INT ; i2 : INT ; u1 ...
Replies
3
Views
2,982
Hi I have problem to understand this code? can anyone explain this code for me? L B#16#3 L #OBJ_NR SLW LAR1...
Replies
1
Views
2,471
Hey everyone, In the middle of deciphering STL code in S7 plc and I'm confused. I interpret the following code to be load the register "#Step"...
Replies
11
Views
2,078
Hi, Anyone know why this network is not longer shown in LAD format but only in STL ? O "RB 20878".EinfV O "RB 20878".EinfR...
Replies
11
Views
2,576
Back
Top Bottom