Reset the module 1746 HSCE

zaranet

Member
Join Date
Apr 2009
Location
Marrakech
Posts
15
dear ,
I want to reset my module 1746 HSCE with value non zero, then i use instruction copy to copy the value in my counter but my counter don't reset with this value
 
Hi there
I believe what you need is preset and not reset.
So to preset the counter with value say 777 search for Local:X:C.Ctr0Preset under controller tag and then put 777 there.
Then in program you need to set the bit Local:X:O.Ctr0SoftPreset whenever you require to preset the counter with this value.
 
Well, he's talking 1746, so SLC, not Logix.
Even so, you can configure a reset value word for that counter, if it is in LINEAR COUNT mode. Write to the M0:e.34 location your desired reset value, then issue a reset command.


I find it much easier to let the counter just free-run, and roll over, and then do my actual counting elsewhere where I can control it easier.

Let the counter free-run, and every program scan, take the difference between the current counter value, and the last scan value, store it in an integer. Add that difference value to another integer, (or float, if you like), then copy the current value into the last scan value.

Now you have an integer (or float) register you can use in the program as a counter, which can be reset, preset, paused, at whim, without worrying about module programming.

*** This technique works on all plc's that have SIGNED integers, and handle integer math that can roll over.

For Logix series PLC's, use the function block diagram PMUL instruction to generate the delta count, and the processor won't give all those annoying minor faults for overflow.
 
excuse me for my english,
The word M0:e.34 we permet to reset the counter; the this counter begin by Zero but for my application, for exemple, i enter 30000 in the word M0:e.34 when the counter accur this value i want that the counter begin by the value different the zero
my module is 1746 HSCE Allen Bradley
 
First, is the counter set up as a LINEAR counter? (M0:<slot>.1/13 = 0? This can only be set during configuration or when the "Function control bit" (M0:<slot>.1/12 is 0.

In Linear mode (only), the value in M0:<slot>.34 is written to the accumulator whenever the counter is reset. Note that the module has several reset modes, controlled again through advanced configuration, or by disabling the counter, and setting bits M0:<slot>.1/5 to M0:<slot>.1/7 for your desired reset mode.

This is covered in Chapter 4, of AB Publication number 1746-UM006B
 
the Reset mode is by RS(button) , so if I appuye this button i want that my accumulated count I:e.1 reset to a value other than zero (0)
if its impossible i think that I add value # (0) to my accumulated
 
could he not set up a rung where when he presses the "reset" button it does a "move" command and moves a pre-determined value into the accumulator of the counter instead of actully "resetting" the counter -so instead of resetting it - you are just overwriting the accumular with whatever number you want - (could be a value that he entered in from a numeric entry device or a numeric dail perhaps?)
 
The answers you have received are both correct in a round about way. The truth of the matter is if you are using some type of pulse encoder with the very high speed counter module. You must on a regular intervals reset the encoder at a given measured point, this because it is not an absolute encoder and will get off after being run back and forth after sometime and this can vary for the reasons why and can be worse on one day or another. Always reset, but if you read up on the application in the AB info there is also a way to load this preset value in a table and this is what the encoder resets to when it returns to home or reset position (The measured known point)
 
could he not set up a rung where when he presses the "reset" button it does a "move" command and moves a pre-determined value into the accumulator of the counter instead of actully "resetting" the counter -so instead of resetting it - you are just overwriting the accumular with whatever number you want - (could be a value that he entered in from a numeric entry device or a numeric dail perhaps?)

No, you must use the Linear mode, and the "Reset Value" word in that module. There is no direct access to the accumulator (it's a hardware counter... were it not, it could not count properly through scan time).

Which, is exactly why, I no longer use the "Features" on hardware counter modules, unless I specifically need to use one as a cam switch, directly controlling it's own outputs.

(At home now, so going off of memory, logic may be a bit off)

For the SLC counter, (well, ANY counter, in almost ANY PLC that supports full signed integer math):

Assume that CTR_RAW is the actual, raw value you read in from a counter module. CTR_Mine is the actual counter accumulation value you want to use, CTR_Old is a holding value, CTR_Delta is a delta value. Going to add in CTR_ResetVal as the reset value, and CTR_MyLast as the Last count value at reset. Here (all INT, DINT, whatever you like). Bools (bits) will be CTR_Reset.

This first rung, calculates the delta count every scan of the PLC: (whether cyclic, periodic, interrupt, whatever)

SOR BST SUB CTR_RAW CTR_Old CTR_Delta NXB MOV CTR_Raw CTR_Old BND

This rung maintains my "Internal Pseudo Counter Value", by adding the delta every scan:

SOR ADD CTR_Delta CTR_Mine CTR_Mine BND

This rung would be the "Reset Rung":

SOR XIC CTR_Reset ONS CTR_Reset_OS BST MOV CTR_Mine CTR_MyLast NXB MOV CTR_ResetVal CTR_Mine

This rung is (here I forget the bit I think) for SLC-500's, to deal with overflow fault at end of scan:

SOR OTU S2:5/0


I do get a little more complicated on my counters, in general, but that basic technique allows you 100% full control over counters, WITHOUT worrying about trying to deal with wierd counter module issues or programming. Another nice thing about it, is just taking that one delta count, I can maintain dozens of running counters from a single encoder. Think perhaps "Current_Footage", "Batch_Footage", "Shift_Footage" for example.

Additionally, I use other scan-delta comparisons after scaling the raw count to Engineering units count to trigger one-shots for times I need to, oh, say, shift a FIFO with data based on actual footage. In Logix CPU's, I can shift every foot almost all the time, or every inch, or every whatever. In slower processors, I might trigger that one-shot shift every 10 or 100 <units>.

Why? I used to have to deal (as a SI) with "Whatever the Customer Wanted PLC", and dealing with 30 different kinds of counter modules really sucked, so I worked it out to a way that I could just take the raw count, and run my own counters inside, without worrying about resets, or anything really.

The only caveat, is that it requires a module that runs in SIGNED INTEGER(any length, 8 bit, 12 bit, 24 bit, 189 bit) mode. For UNSIGNED integer counters, or ones that won't roll over, you still have to deal with that, but those seem to be less the norm then the signed int format.

It works, simply because signed integer math (while it may generate an overflow) will 'Wrap around' properly. That is to say (16 bit counter), if the last scan had a count of (2's compliment) 32767, and the counter rolls over exactly 1, the current scan will have a count (2's compliment) of -32768. In signed integer math (16 bit) -32768 - 32767 = 1.
 
Sorry for the (LONG) digression, but I feel we are moving this topic a little beyond what the original poster wanted (though, the technique posted above works perfectly well, if the counter is in RING mode).

And mryoung482749, I'm sorry, I missed it if the OP was looking for some "Absolute Position" value, I got not that impression. But still your comment triggered another thought...
As long as he's not using any of the "Range Triggerred Outputs" on the module, he could just take the accumulated count from the module, add his desired offset to it, and use that summed value. Then upon resetting the module, it would come back to 0 (hardware) + desired_Offset (programmed) to yield a value that went from "desired_offset" and incremented from there.
 
I can tell you that I see rdrast is a very smart programmer, but I am not one to get very technical unless it is needed. This is why I try to keep it like an instructor taught me a long time ago. "Keep it simple stupid" (KISS) this means for me to try and explain in as simple of terms as posible to get my point across and not to make who ever feel that it is so complicated they will never get it. But this is not to insult rdrast because his post is very correct with a wealth of information from lots of hard work and experience. This said, to keep it simple, I have been programming for many years, and I could barely comprehend your very sophisticated post. So therefor if the person did not know the answer and needed to post the question. What should be the level of the response? This I ask with due respect.
 

Similar Topics

I'd like you to meet my IO_Link Block, Fred. There are a couple of SSVs outside of Fred's AOI whose main purpose in life is to prevent me from...
Replies
2
Views
140
We have a remove PLC rack that is being used to collect data from older equipment via a 1756-DHRIO module. This module occasionally faults out...
Replies
1
Views
409
Hi all! I need help help with my delta module. Model : DVP-06XA-S Firmwire : 4.08 When i was setting my Rs485 parameter i...
Replies
0
Views
899
I am facing an issue module 1756-OF8 is showing the minor fault = recoverable in the module info.How can i reset it?
Replies
0
Views
1,746
Does anyone know how to do this via MSG or SSV? All I want is the "Reset Module" type of command that one can find in the third tab of the generic...
Replies
1
Views
2,315
Back
Top Bottom