HSCE saving possition on power loss

roxusa

Lifetime Supporting Member
Join Date
Nov 2008
Location
NJ
Posts
994
I have been using HSCE for a while but was recently told
there is a way to load the last possition from PLC back to the HSCE on a first scan at power up. Assuming nothing was moved during power loss this would keeep from re referencing machine.
I believe the N file associated with the HSCE is just a mirror of the M FILE.
If it is possible to load the M file with the last known possition can anyone clarrify. Thanks
 
IIRC, to use the module, store the count value somewhere safe (like an N file), then on power up, copy that value to the counter reset value (M0:slot.34), and initiate a counter reset.

I gave up a long time ago using any features of counter modules like that myself though. My procedure is perhaps a bit more complicated, but much more flexible in the long run:

Dedicate a couple registers:
Old_Counter
Delta_Value
Total_Count
and some bools:
cmd_Enable
cmd_Reset

Now, every scan, if the enable bit is NOT set, move the counter value to the Old_Counter register, and clear the Delta_Value. If the enable bit IS set, subtract the Old_Counter from the actual raw counter value, and put it in Delta_Value.

Also, every scan, add the Delta_Value into the Total_Count and store it back in Total_Count.

Reset simply clears Total_Count.

The above method works in every PLC that I know of, and eliminates having to figure out weird reset and preset sequences for every different kind of hardware.

There can be an oddity on Logix platforms, due to the (oddball) 24bit counter register, but pass that through a PMUL instruction with a word size of 12 to 16 bits, and you get a proper delta value even through rollover.
 

Similar Topics

I'm trying to set up a ring counter - one that transitions from 3599 to 0 (and 0 to 3599 in the reverse direction). My counter insists on...
Replies
2
Views
359
I had a 1746-HSCE go suspected bad. have to swap the card in the morning. Other than dip switch settings is there any configuration to do?
Replies
1
Views
1,024
Hi there, I have a machine where was a servo with extra encoder. That encoder had resolution 100ppr/5V. We did replace complet servopack (...
Replies
0
Views
948
Hello, First I looked at Manuel and Plctalk but I did not find or maybe not understand. How I can connect ''HTL / Push pull-24 volt encoder'' to...
Replies
4
Views
2,524
I have a SLC 5/05 processor and I am trying to reference an output from a High speed counter card to be used elsewhere in the PLC. The output...
Replies
1
Views
1,639
Back
Top Bottom