Hi
I have a question regarding the title of this post.
I’m using an Omron CJ2M with an MD212 high speed input expasion and offcourse CX programmer for programming.
I have a working incremental encoder input that increments up until a value that I determine and then resets to zero before incrementing again.
Now, I want 36 of them. I have a transport chain with pushers every 22 inch, these pushers transport products that I want to follow induvidually. So at any given time there are 36 products on the machine, at the end of the line they exit and the pulse counter from that particulair product can reset to zero.
Having only one High_speed_counter_PV that I can refer to, I can only follow one pusher position or the whole chain as it goes round.
My question is, can I for example use a function block to increment pulses or will this be too slow for a high speed encoder input, due to the cyclic execution of the fuction block.
Example:
Var (BOOL) Encoder_A_in
Var (BOOL)Encoder_A_flank
Var (INT)Increment _puser1
Var (INT)Increment_pusher2
Etc..
Var (BOOL) Insert_product1
Var (BOOL Insert_product2
Etc..
IF Encoder_A_in AND NOT Encoder_A_flank THEN
__IF Insert_product1 THEN
____Increment _puser1:= Increment _puser1+1;
__ENDIF;
__IF Insert_product2 THEN
____Increment _puser2:= Increment _puser2+1;
__ENDIF;
ENDIF;
Encoder_A_flank:= Encoder_A_in;
IF Increment_pusher1 >= 360000 (or whatever)THEN
__Increment_pusher1:=0;
__Insert_product1:= FALSE;
ENDIF;
IF Increment_pusher2 >= 280000 (or whatever)THEN
__Increment_pusher2:=0;
__Insert_product2:= FALSE;
ENDIF;
Would this work and/or is there a better way of doing this? Basicly I just need a lot of High speed counter PV’s.
Thanks in advance for any help.
Greetings from Holland,
Andy
I have a question regarding the title of this post.
I’m using an Omron CJ2M with an MD212 high speed input expasion and offcourse CX programmer for programming.
I have a working incremental encoder input that increments up until a value that I determine and then resets to zero before incrementing again.
Now, I want 36 of them. I have a transport chain with pushers every 22 inch, these pushers transport products that I want to follow induvidually. So at any given time there are 36 products on the machine, at the end of the line they exit and the pulse counter from that particulair product can reset to zero.
Having only one High_speed_counter_PV that I can refer to, I can only follow one pusher position or the whole chain as it goes round.
My question is, can I for example use a function block to increment pulses or will this be too slow for a high speed encoder input, due to the cyclic execution of the fuction block.
Example:
Var (BOOL) Encoder_A_in
Var (BOOL)Encoder_A_flank
Var (INT)Increment _puser1
Var (INT)Increment_pusher2
Etc..
Var (BOOL) Insert_product1
Var (BOOL Insert_product2
Etc..
IF Encoder_A_in AND NOT Encoder_A_flank THEN
__IF Insert_product1 THEN
____Increment _puser1:= Increment _puser1+1;
__ENDIF;
__IF Insert_product2 THEN
____Increment _puser2:= Increment _puser2+1;
__ENDIF;
ENDIF;
Encoder_A_flank:= Encoder_A_in;
IF Increment_pusher1 >= 360000 (or whatever)THEN
__Increment_pusher1:=0;
__Insert_product1:= FALSE;
ENDIF;
IF Increment_pusher2 >= 280000 (or whatever)THEN
__Increment_pusher2:=0;
__Insert_product2:= FALSE;
ENDIF;
Would this work and/or is there a better way of doing this? Basicly I just need a lot of High speed counter PV’s.
Thanks in advance for any help.
Greetings from Holland,
Andy
Last edited: