ML1100 and HSC

gosenbach

Member
Join Date
Jul 2006
Location
Everett
Posts
102
Question about using the HSC with a ML1100. when the program is running, does the value of HSC:0.ACC update only at the beginning of the scan or is the current value grabbed any time you reference HSC:0.ACC? For example, my scan time is 10ms. I have a function at the top of the program reading HSC:0.ACC and one at the end. Will both values be the same or will the one at the end be slightly higher? Assume that there are sever counts on the encoder durring the scan.

Unfortunatly I can not test this as the machine I am programming is not arriving here for several more days. Thanks.

Greg
 
Wow, how many posts in the last week about ML1100 HSC's??
(Yes including all mine!)
I am reading them all trying to pick up as much as possible :)

PS. Sorry I cannot answer your question!
 
The ACC is updated only once per scan so your value will be the same on both as long as you don't manupulate the ACC in between the instructions
 
TWControls said:
The ACC is updated only once per scan so your value will be the same on both as long as you don't manupulate the ACC in between the instructions

Tim, If I correctly interpret the 1100 instructon set reference manual page 5-2, the HSC can be updating in parallel to the program scan. Is there something somewhere else that says otherwise, becasue I can't find it? If it doesn't update independently of the scan then I may have given bogus advice on another forum.

Gosenbach:
One nice feature of the HSC function file is that you can assign an interrupt subroutine to execute the immediatly opon satisfying a certain conditon - so depending on what you are doing, you might want to consdier using an interrupt routine instead of looking at the ACC in various parts of the program.
 
Last edited:
The HSC runs in parallel to the program as far as the interrupt for sure...but I can't find anything either way on the ACC or other status bits. I may be wrong. Anyone know a page in a manual that will say?
 
The only thing is the HSC instruction makes note of an "image accumulator" and a "hardware accumulator. It looks like with the UA bit set, the ACC will update continuously as Alaric has described. Without the bit set, the ACC will update as I have described except it will update at the instruction position instead of the beginning of the scan.

So does the HSC Function File operate similar? The fact that it doesn't have an equivalent of a UA bit, I'm going to have to take a wild guess and say that Alaric is correct. I'm only basing this off having this feature disabled in the newer function files seems like it would be a step back

I would still like to know for sure even though I can't think of an instance that it would have mattered in any of my programs, unfortunately I have no hardware to test on anymore. Anyone else up to it?
If 1 the OTE is enabled to update the instruction image accumulator value with the hardware accumulator value. The HSC instruction also performs this operation each time it is evaluated as true or false.
 
I will have the machine in my shop next week. I'll have to set up a test to see.

With the program I am currently working on, I do not think that it really matters all that much. However I am going to be starting a program next month where it will be critical so I am trying to determin if I can just read the ACC directly or if I will need to move it to a N7 at the beginning of the scan so all my math works out.

One section of the program I can use the stable (update once per scan) and the other portion I can use the more real-time interupt. I have a feeling that every millisecond is going to count with this one.
 
gosenbach said:
...so I am trying to determin if I can just read the ACC directly or if I will need to move it to a N7 at the beginning of the scan so all my math works out.

That is what I advised on the thread I refered to earlier - the first thing to do immediately before starting calculations is to copy HSC:0.ACC to another register. Please note that the HSC:0.ACC is a long integer, therefore I do not recommend using a 16 bit N file. Use L9 or other Long file and use 32 bit math. See the thread in another forum for how to deal with HSC roll over if needed.


One section of the program I can use the stable (update once per scan) and the other portion I can use the more real-time interupt. I have a feeling that every millisecond is going to count with this one.
Also keep in mind that a timed interrupt routine can be used to read HSC:0 elements at specific intervals.
 
gosenbach said:
One section of the program I can use the stable (update once per scan) and the other portion I can use the more real-time interupt. I have a feeling that every millisecond is going to count with this one.
With this next application being so time critical, are you sure the Micrologix still fits the bill? It's hard to say for sure with what we know about your application, but don't try to use the Micrologix in place of a motion controller
 
That is a good point I should think about. I should have thought about it last night. I have a baby girl that was born on Dec 31 and she only let me get 2 hours of sleep last night. Not quite on top of my game at the moment. This next application is using a either a compact logix or a control logix (it escapes me which it was right at the moment). Can anyone clue me in on how the HAC functions may behave differently that in a ML controller? And antoher question comes up, I will need to have 2 encoders/high speed counters, anything I should watch for?


Cheers.
 
Apparently although the ML1100 has 4 high speed inuts, there is only 1 HSC that can be allocated to any of them! I dont know for sure (not used one yet) but more than one person has said this!
 
That is true.
Althought I don't know if that applies to the compat/control series.

I had a programing project about 6 months ago where the guy who designed the machine thought that since there were 4 inputs, you could use mulptible encoders with a ML1100. Lets just say that it was a mess. The machine was designed to use 2 encoders. However it was a great lesson in creative programming to be able to do it with just one. Althought it would have taken about 1/10th of the ammount of time spent on it if the designed had realized this right off the bat and used a differant controller.
 

Similar Topics

It's been a long day and i didn't need an error code that says "HSC instruction is not valid on the currently selected processor -- 1763...
Replies
16
Views
3,907
Hi all, I need to implement a flow meter via HSC in an existing machine. The flow meter provided is a hall effect NPN unit, which needs to connect...
Replies
3
Views
3,841
I'm looking to implement a low-cost, efficient method of communicating some integer values to an R30iB robot from a Rockwell 1100 PLC. I am not...
Replies
8
Views
1,721
Hello all, I am trying to setup my MicroLogix 1100 as a modbus RTU master for a modbus network containing multiple modbus RTU slaves. I currently...
Replies
7
Views
3,913
We have a machine that keeps losing its program at random intervals; sometimes 2x-3x in a shift, sometimes will go over 1wk without issue. I had a...
Replies
9
Views
2,923
Back
Top Bottom