S7 Counter/encoder question

Werner

Member
Join Date
Apr 2005
Location
IJsselstein
Posts
336
I need to program a machine what must do the following:

1 Motor with encoder. On this conveyor I have several machines. (Cutters/sprayers/fillers). The speed of the conveyor is fixed per product but can be different for other products. The position of the cutters/sprayers/fillers is known.

A spot depositor drops a filling on the conveyor. A cutter downstream cuts the product to a fixed length with the drop exactly in the middle. The lenght of the products is adjustable per product. So product A can be cut to 100mm and another product B can be cut to 80mm.

My question. I know how to use an encoder that is nulled once every cycle. (By proximity switch or so) But in this case there is no zero signal. The encoder just keeps on counting. How can I use this counter value to determine when to cut/spot deposit?

What happens if a counter overflow happens? Does this affect the cut/spot deposit?

Any tips on how to do this?
 
You must have some method of knowing when the product is either placed or cut and this must serve as your encoder zero signal.

Here's the code I use for dealing with encoder rollover (I use the ET200s counter module). Note that:

iLastCountA is a STAT integer
iCurrentCountA is the value read from the counter
iPulsesA is the pulse count this scan
diPosition is a STAT double integer
bZeroPosition is a boolean used to reset the position to zero

Code:
	  L	 #iLastCountA				//get last count (from last cycle)
	  L	 #iCurrentCountA			 //and current count
	  T	 #iLastCountA				//save last count (ready for next cycle)
	  TAK   
	  -D								//Calc (Current-Last) counter wrapped around ?
	  JPZ   NWP0						//if so then negative answer
	  L	 L#65536					 //so adjust
	  +D	
NWP0: T	 #iPulsesA				   //and then update pulse count
	  A	 #bZeroPosition   //zero position ?
	  JCN   noze			//no - then update count
	  L	 L#0			 //else set position to zero
	  T	 #diPosition
	  JU	end
noze: L	 #iPulsesA	   //get pulse count this scan
	  L	 #diPosition	 //get stored position
	  +D					//add to give new position
	  T	 #diPosition
noze: NOP 0
 

Similar Topics

Hi all, I am working with an incremental encoder (ABZ signals, 360 ppr (so 1440 counts per rev)) to replace the existing "manual" encoder wheel I...
Replies
51
Views
2,616
Working on delaying running a program in Fanuc robots by a distance (encoder counter). I can delay the program using the encoder counter but there...
Replies
3
Views
1,243
Hello! We have a drum rotation machine controlled by a AB SLC 500. The drum rotation inputs comes from a encoder into a 1746-HSCE. We are using 2...
Replies
0
Views
1,134
Hello! We have a drum rotation machine controlled by a AB SLC 500. The drum rotation inputs comes from a encoder into a 1746-HSCE. We are using 2...
Replies
5
Views
2,248
Hello, is there a possibility to obtain count of revolutions in PF525? VFD is in velocity mode but I also need count of revolutions to fill some...
Replies
8
Views
5,378
Back
Top Bottom