Setp 7 counting problem.

NoName

Member
Join Date
Sep 2003
Location
Domžale
Posts
273
Hello ppl.

I'm makeing a machine that slit's metal into several lines.I am working with a C7 635 OP.

And ofcourse I measure how much metal was slit. I use an incremental encoder with 512 impulses per revolution for this measurment. But the problem is that the measrument isn't correct. My program doesn't register all the signals that are comeing from the encoder. I know this beacouse I connected an external counter of impulses to the encoder. The diference beatwen the external counter and my counter is over 10000 impulses!!!!

This is how I made the counter of Impulses:
I've made a counter with an ADD_Real function with posivite edge detection. And then I devide the whole amount of impulses by 487.6 to get the distance in meters. But unfortunatley this method doesnt work, beacouse the loss of the impulses.

So I'm thinking:

This OP has an onboard counter but I don't know how to implement it in to the program... Could someone please give me some pointers on how to do this...

Any advice would be great!!!

Thank you.
Regards
>Ales<
 
Hi

may be the reply is a little bit late
i think your problem is that the input frequency is higher than the allowed frequency for the input channel , either you reduce the frequency (by using other pulser or using of gearing) or use a fast counter
 
I read this manual Jesepr...

And in the manual it is mentioned that you can configure the counter with an hardware interupt... what benefits would that bring???
In which cases do you guys use this configureing option???

Thanks for resurrecting this thread :p
 
I am not sure but I think that the inputs can be configured as either a regular input, or as an input with interrupt, or as a counter input.
I dont think that it can be setup as both counter and interrupt at the same time.

What you are after is probably to use the input as a fast counter.

An input with interrupt functionality can be used for many things. The interrupt will trigger a special interrupt OB. In this OB you program the functions that must be triggered by the interrupt.
 
So basicly if I set input I0.2(this digital input is also used as an reference signal of the incremental encoder) in the hardware manager to have the function of hardware interupt it will execute OB40 every time the input raises from 0 to 1 that is on every revolution of the encoder.
So in order for the counter to work properly I would have to implement the SFB 47 Count block in to OB40.

If I program my project like this will the counter count the impulses of the incremental encoder to the pulse exactly or will there be any deviation. So far I have had the SFB 47 block in OB1 and I wasn't realy pleased with the results. I have measured the impulses on the incremental encoder and I evaluated them with the value that I got from the counter, and there was a deviation of about 100 to 150 impulses where the range of the measurment was 5000.

I hope that what I wrote makes any sence... any input on this would be great.
 
No you dont have to put SFB47 in the interrupt OB40.
Just start the counting with a call to SFB47 in a regular cyclically scanned FC or OB1, with SW_GATE turned ON.
The counter will then run in the background.

I can think of three reasons why there are differences between the counted value and the real value:

1. The sensor misses items, or it "bounces". Have you tried to attach it to a hardware counter ?

2. The impulses are too short or too fast for the input. Check the specifications for the counter input.

3. The count value is correct, but the user program reacts too slowly or in a wrong way. This means that either there is a "tail" of items that are not counted, or the counter is stopped or started at the wrong time.

Try to run your proces real slowly, so that you can follow the count value item by item. Then try to speed it up slowly and see if you can detect where it goes wrong.
 
The interrupt that the manual refers to, is an interrupt that the counter triggers when the count value reaches the set value.

In that way the user program can react very fast when the count value is reached.
 
HI NoName

when you program a high speed counter the high function should be at the start of your program. you also have to enable the input with a handshake flag from the cpu. also check the cable termination as the wires that come out of the high speed counter are useually pretty small i had similar problems and found a broken wire from the unit. hope this helps

shaun:ROFLMAO:
 
So basicly the internal counter isn't afected by scan cycle times if I am right and the counter doesn't have to be in an interupted function...

It's a shame that I can't do anything anymore beacouse the machine is on site and I can't just show up and say can I try something :)
 
NoName said:
So basicly the internal counter isn't afected by scan cycle times
Thats right. Once started, it works by "it self" in the background.

NoName said:
and the counter doesn't have to be in an interupted function...
Right again. The interrupt for the counter mentioned in the manual is an output from the counter, not an input and also not meaning that SFB47 must be put in an interrupt OB.
To trigger an interrupt when the counter value is reached is an option.
 

Similar Topics

Hello I am looking for tips on how to count the duration of a given function and then how to display it on the hmi panel in the hh:mm:ss format...
Replies
4
Views
1,706
Guys, I know it will be silly but can't get my head around it. I have 3 conveyors, every one on a separate servo drive, and 2...
Replies
25
Views
3,516
The 1734-IB8 has no hardware counting function correct? I am trying to find something to substitute in for a 5069-IB16F (since lead times are...
Replies
3
Views
1,419
Been scratching my head at what I thought should be a relatively simple task. I need to count how many rows a .csv file has, so I can later read...
Replies
6
Views
2,561
Hi All, I need to count my Contactor switching times. There are lots of them so I created a template logic with local variables in FC2000. Now I...
Replies
10
Views
2,141
Back
Top Bottom