Correctly utilizing encoder with PLC

Again, I want EACH encoder pulse to shift the binary file.

So essentially you're looking for the encoder's input/pulse to trigger an event. I don't know if the HSC would be the best option as they like to count, be reset, etc.

You might want to look into the User Interrupts in the EII function file. You can select an EII, give it a ladder file and input just like the HSC function file.
Every time that input triggers, that ladder will execute.
 
So essentially you're looking for the encoder's input/pulse to trigger an event. I don't know if the HSC would be the best option as they like to count, be reset, etc.

You might want to look into the User Interrupts in the EII function file. You can select an EII, give it a ladder file and input just like the HSC function file.
Every time that input triggers, that ladder will execute.

And it can count at the same rate as the HSC?
 
Yeah- I don't know the exact speed off the top of my head, but I've seen an EII used with a 2.5kHz signal on Micrologix 1500's before.

How do you increase a counter in your EII subroutine? Mine won't increase, presumably because there is no detected false-true transition. I just used an add function (+1) for the time being.

I was not able to do extensive testing (as our line was running), but I seem to be getting approximately the same results using the EII.
Could this be an electrical issue? I have to use pull-up resistors with this encoder. Would this introduce any additional "lag" into the response time of the encoder?
Could my resistor value be incorrect, keeping the pulses from occurring?
 
Last edited:
To verify your input you should be able to inch your conveyor/belt and see the input go on and off.


Did you add the UIE instruction anywhere in your logic to allow the interrupt?
Looks like the 1200 uses these:
Interrupt Types
Type 0
STI (bit 0)

Type 1
HSC 1 (bit 1)

Type 2
Event 3 (bit 2)

Type 3
Event 2 (bit 3)

Type 4
HSC 0 (bit 4)

Type 5
Event 1 (bit 5)

Type 6
Event 0 (bit 6)

So if you set up your EII:0 to work with your encoder input, put a UIE 6 instruction in your logic.
In the EII function file, I'd also set the Autostart and Event Interrupt Enabled to 1.
 
I am dealing with bottles that are irregularly spaced and conveyor speeds that are never exactly the same. I am not sure what you mean by using just the photoeye; I need some way to "store" bottle position data (on the conveyor, for up to 20 bottles at a time) that would not be thrown off by a sudden shift in conveyor speed. Hence, why I am not even trying to use timers.



Inconsistent spacing and speed adds a level of complexity that is beyond me, so I'll just sit back and see what I can lean along with you.

Bubba.
 
To verify your input you should be able to inch your conveyor/belt and see the input go on and off.


Did you add the UIE instruction anywhere in your logic to allow the interrupt?
Looks like the 1200 uses these:
Interrupt Types
Type 0
STI (bit 0)

Type 1
HSC 1 (bit 1)

Type 2
Event 3 (bit 2)

Type 3
Event 2 (bit 3)

Type 4
HSC 0 (bit 4)

Type 5
Event 1 (bit 5)

Type 6
Event 0 (bit 6)

So if you set up your EII:0 to work with your encoder input, put a UIE 6 instruction in your logic.
In the EII function file, I'd also set the Autostart and Event Interrupt Enabled to 1.

I guess I am also confused as far as the correct method of utilizing an interrupt. I thought when the EII is triggered, it immediately scans the ladder file that you assign it to during set-up.
Should I skip this altogether and just place the UIE command in the main ladder file?

And I know that I can verify the input by inching the conveyor; I have already done this. My question is whether or not the PLC is able to detect the change in voltage with the rapid pulsing. I know that my resistor was selected to drop the 24V down to 14V when the encoder is pulsing....it may need to be lower.
 
The EII will scan that ladder file when triggered, but the UIE instruction tells the PLC to allow that EII to operate.

I've put the UIE for my encoder EII function in the first scan, that way it enables it on startup and will always run. Try adding the UIE instruction in your first scan routine or main ladder and see if that helps.
 
The EII will scan that ladder file when triggered, but the UIE instruction tells the PLC to allow that EII to operate.

I've put the UIE for my encoder EII function in the first scan, that way it enables it on startup and will always run. Try adding the UIE instruction in your first scan routine or main ladder and see if that helps.

Is this unnecessary if you set the UIE bit in the initial configuration for the EII?
 

Similar Topics

Hi Everyone, I am supporting a system which runs on a SLC 500 (1747-L532). A fault has developed whereby the output state of some digital outputs...
Replies
10
Views
986
Hi All, I'm planning to use Rockwell Library, and I am testing the P_AIn block and P_Alarm block for the alarming functionality. I think the...
Replies
2
Views
2,235
I have an issue in Studio 5000 where occasionally a few different tags numbers will change to an -e1.444 for less than a second. I ran the cross...
Replies
15
Views
4,754
Hi, I'm developing a routine to detect and clear a watchdog major fault in a ContolLogix PLC. The software has three tasks and six programs...
Replies
3
Views
2,446
Hi All, I had replaced the drive Kinetix 300 recently due to short within the drive but now seeing watchdog fault. The watchdog timer done bit is...
Replies
6
Views
1,754
Back
Top Bottom