MarkusAurelius82
Member
Hi, I'm new to the forum. My company works exclusively with Allen-Bradley products. I need help with programming roll-over code for this module. Again, I'm using a 1794-ID2 Flex Incremental Encoder module with a SLC 5/05 CPU. The encoder module is on an RIO rack. I have already programmed the configuration for the module with BTW/BTRs and I'm seeing an input from it. I understand the basic concept of the math involved in getting the counts to roll over properly. Let me explain: I made the preset of Ch0 32000. So when the counter reaches 32000, the counter automatically resets. I made some logic that did work at first using a GEQ (Greater Than or = to) instruction to keep track of how many times I rollover. I take this value and multiply by 32000 and ADD this result to what the counter is currently at to get my total counts... I hope this makes sense. But, the problem is that whenever the pulses come in fast, the PLC doesn't scan fast enough for my GEQ to work and keep track of how many times I've rolled-over.
I discovered that the encoder has a "PresetReached" bit that triggers when, you guessed it... when the preset is reached. So... I used this PresetReached bit in place of the GEQ and this took care of the scan issue. But the PresetReached bit latches ON and can only be reset by the "PresetReset" bit which is part of the configuraton block. So I called Rockwell support to see if they could help me out. They said to execute another BTW when the preset is reached to activate the PresetReset bit. And also to use the same control block as the first BTW. It seems rediculous to have to go through this much trouble and execute 2 BTWs per channel to get the module to rollover. I haven't had a chance to test out what Rockwell told me yet.
Does anyone have any experience or code using a 1794-ID2 Flex Encoder module in conjuction with an SLC 5/05? If so, please help.
Thanks in advance.
I discovered that the encoder has a "PresetReached" bit that triggers when, you guessed it... when the preset is reached. So... I used this PresetReached bit in place of the GEQ and this took care of the scan issue. But the PresetReached bit latches ON and can only be reset by the "PresetReset" bit which is part of the configuraton block. So I called Rockwell support to see if they could help me out. They said to execute another BTW when the preset is reached to activate the PresetReset bit. And also to use the same control block as the first BTW. It seems rediculous to have to go through this much trouble and execute 2 BTWs per channel to get the module to rollover. I haven't had a chance to test out what Rockwell told me yet.
Does anyone have any experience or code using a 1794-ID2 Flex Encoder module in conjuction with an SLC 5/05? If so, please help.
Thanks in advance.