HSC help needed on AB micro 1100

jeb974

Member
Join Date
Oct 2022
Location
South Carolina
Posts
2
Is it possible to write to the high speed counter function file "high speed preset" on an AB micro 1100. I have the HSC set up with a MOV instruction . I am using a EA9 HMI and want to be able to change the encoder preset from there. Everything I have tried does not work. However, I am fairly new to programming so that also could be why I can not figure it out. Any help would be greatly appreciated. Thanks.
 
Thanks for the quick reply. I kind of don't understand all of what is going on in the screenshots you provided. As I mentioned I am still a beginner. Is there any way you could explain in steps how to do it?

The process is explained in that link (click here) to the Rockwell 1763-rm001 PDF document.

Everything you need is in Rung 0002. That is where the value in 32-bit Long L9:0 is CoPied-by-Word to the HSC:0.HIP (HI-Preset).

When the program is running, the HSC:0 object contains a PLC-local copy of the counter hardware parameters, i.e. that object does not contain the actual parameters used by the counter hardware.

In order to write the HSC parameters to the actual hardware, you need to copy (or move?) the parameter values into the HSC:0 object, then have HSC:0.SP make a 0-to-1 transition.

On my Rung 0002,

  • on any scan when L9:0 is the same as HSC:0.HIP,
  • the [NEQ L9:0 HSC:0.HIP] instruction's output rung will evaluate to False,
  • so the MOVe will not write to HSC:0.HIP,
  • and the OTE will write a 0 to boolean HSC:0.SP;
  • since HSC:0.SP is 0, nothing will be written from the HSC:0 object to the counter hardware.
Again on my Rung 0002,

  • On a scan when the value of L9:0 changes,
  • the [NEQ L9:0 HSC:0.HIP] instruction's output rung will evaluate to True,
  • so the MOVe will write the value of L9:0 to HSC:0.HIP,
  • and the OTE will write a 1 to boolean HSC:0.SP;
  • since HSC:0.SP is 1 on this scan and was 0 on the previous scan, that is a 0-to-1 transition, so the HI-Preset in HSC:0.HIP, along with some subset of the parameters in HSC:0, will be written to the counter hardware.
In my code on Rung 0001,

  • the value of L9:0 altenates about every 1.6384s,
    • from a value of around 1-10,
    • to a value above 2,000,000,000
    • and back again
  • In the top image, you can see that
    • the value of L9:0 (and HSC:0.HIP) is 2,000,000,000+
    • the value of the counter accumulator, HSC:0.ACC is 5
    • the value of F8:0 is 0.0 (more about this later)
    • so the .ACCumulator value has not reached (i.e. is less than) the .HIP (high preset).
  • In the second image, taken a bit later, you can see that
    • the value of L9:0 (and HSC:0.HIP) is 1, as it has been changed by Rungs 0001 and 0002, including the 0-to-1 transition of HSC:0.SP that triggered passing the high preset parameter to the counter hardware
    • the value of the counter accumulator, HSC:0.ACC is 0
      • because when the high preset was changed to 1, the previous accumulator value of 5 was interpreted by the hardware as having reached the new high preset,
      • so the accumulator value was reset to 0 because the counter was in mode 0 (HSC:0.MOD is 0; see this link).
    • the value of F8:0 is 1.0, incremented by 1.0 from 0.0 by the interrupt logic of LAD 3 (small window in lower right of the image),
      • LAD 3 was called on the interrupt because HSC:0.PFN is 3 (Program File Number),
      • The interrupt was triggered because HSC:0.UIE is 1
Note that what I did is probably more complex than it needs to be; it looks like the HSL instruction (see this link) can set the presets and some other values directly without directly causing a HSC:0.SP 0-to-1 trigger.
 

Similar Topics

Hi everyone, I have a Micrologix 1400 using an HSL instruction (High Speed Counter Load). This instruction is used in junction with an encoder...
Replies
1
Views
803
Hello all. I am having trouble setting up my HSC to count pulses from a prox switch. I have it wired to the prox and I see the .InputStateA0...
Replies
3
Views
1,369
So I have to encoders with A,B and Z pulse 360 encoder wired up to A0+, B0+ and Z0+ and the - pulses wired to common 24vdc. I can see the inputs...
Replies
0
Views
1,036
Hello All, This is my first time working with encoders and I am a little lost. I have a 1769-HSC/B card on a Compactlogix L32E controller running...
Replies
6
Views
2,989
I am having trouble utilizing a MicroLogix 1200 HSC to trigger an event. I have the HSC mode set to 0, because I want to trigger an event every...
Replies
2
Views
1,951
Back
Top Bottom