Micrologix 1500 scan

boyd_man

Member
Join Date
Oct 2002
Location
South Carolina
Posts
39
I have just wrote a program in RSLogix and I have a couple of questions. First I have six different files, on the first file which is number 2 by default is my main file at the beginning of this file I have all my JSR to the other files all of them are active all the time except the last file, I have a bit to keep it inactive till the operator goes to a certain screen on the panel view. The thing is I’m not really sure how the scan works. I have noticed that if I put the same bit in file number seven that activates that file it will not recognize that bits state. I want to scan my program in the most efficient way so say while I’m stepping thru the program file three it will activate a fault in file four as soon as possible. The next thing is I want to leave a not that is very important about three of the timers that anyone will see when they first open the program. The processor is a Micrologix 1500 LRP
 
You may want to post your program so we can look at it

the scan starts with the first rung in you 'main' (2) then goes down from there stopping at each rung you have a JSR (another rung being called)..then returning to rung 2 (main) until it reaches then end of rung 2

that is the down and dirty...you can post you code then ask your question it will make it easier
 
The way I have wrote this program how will it scan. The weld cycle is the actual part that runs the machine but I need it to know as fast as possible when a fault accurse or the cancel push button has been pressed and react to it
 
Typical Scan:
Scan_1.jpg


What is the bit your having trouble with. If it is being controlled by file 7 then it will not change state unless file 7 is run. It will remain in its last state until file 7 is run again.
I don't understand your timer questioned.
Why would you want to only run a subroutine when a certain screen is showing on your HMI. I personally don't like conditional subroutines, if I don't want something to operate I'll write that in the logic. But its your machine, I'm sure you have your reasons just curious.
 
I think you might be misunderstanding the program scan. It doesn't set there and wait for the next thing to happen -- it's all the time running the whole program, evaluating IO, etc. It scans the whole program (unless it not JSR'd) every time, every 10ms or so. If there's an alarm, it will process the appropriate code based on the conditions on the next scan -- at approx 100 times per second.

Study the page that Mickey shows above - it explains it very well.
 
boyd_man said:
but I need it to know as fast as possible when a fault accurse or the cancel push button has been pressed and react to it

For fast... look at IIM, IOM and INT

answer Mickey's question and go into a little more detail of what you are trying accomplish

is your program running? are you just trying to modify it? starting/started from scratch?
 
Ok know that I look back at my question I asked tree different ones at the same time. But the most important one was how does the program scan and will it affect the scan time for each file depending on where I place my JSR’s . I wrote this Program from scratch and it seams to be doing fine on all my test runs. The conditional subroutine is the only part of the program that an operator has there hand in the machine while it is in an active state. I was under the impression that a file would not be scanned and no logic would work in that file if the subroutine was not active. I appreciate any advice on this you all can give me. I think I understand how the scan works if there is just one file but when there are multiple files I don’t understand how it scans them. Does it scan them all at the same time are does it scan them individually by the way you have placed you JSR . Can code be activated if the JSR for that file is conditioned out?
 
boyd_man said:
I was under the impression that a file would not be scanned and no logic would work in that file if the subroutine was not active. I think I understand how the scan works if there is just one file but when there are multiple files I don’t understand how it scans them. Does it scan them all at the same time are does it scan them individually by the way you have placed you JSR . Can code be activated if the JSR for that file is conditioned out?

1. When a subroutine is not scanned it is as if the file does not exist, all outputs in that file will remain in thier last state.
2. It will scan the subroutines individually ( one at a time) by the way you have placed the JSR's.
3. No, every thing in the file remains in its last state ( last time it was scanned)
 
Ok so say I have two files one being the main file and the other being the subroutine. If I place my JSR half way down my ladder in my main file the scan will get to the JSR jump to my subroutine scan it then return to the main file and finish it, then start over again?
 
Let me put this in Anglish for ya. It will run (on AB) top to bottom, left to right, kinda like you do when writing a letter.

That said, it starts ladder scan in File 2, since your first rung is a JSR it will go through that subroutine then come back to File 2, go thru the next subroutine until all are done then finish going through File 2 then update the data tables.

That thar means ifn ya got a 10ms scan time then any output changes will be made in 10ms or so BUT there may be things ya didnt think of.

An example may be an extended cylinder, the solenoid field may take a few milliseconds to collapse and allow it to retract. In many cases people do not move to the next step until the cylinder has been detected to be fully retracted; which may take more time.

So the scans may be fast but the machines cycling could take seconds, it just depends.

If a subroutine is conditioned then it will not be active until the condition is true.

If there are critical I/O in subroutines then look at using IIM or IOM instructions.

About the JSR thing, I have not completely looked at the code, but it appears that at least parts of the machine could still auto cycle. Ifn it was me and I was going to use JSR's all that would be in File 2 is the JSR's and divide the machine actions as necessary with faults/alarms being the last subroutine involved.

An added thought, have to be careful using the MCR instruction.
 
That’s what I was trying to figure out how each of my files where going to be scanned, that really helps a lot. You mentioned the MCR could you tell me the problems I could encounter with this instruction. And I do thank all of you for the help and advice you are given. I’m taking all of it and using it to make my program work as good as I possibly can. I will make the changes that have been suggested first thing in the morning. Please if any of you look at my program and see a problem post it I want to know where my mistakes are. Thanks again
 
if a picture is sometimes worth a thousand words, then maybe this post will help ... notice the little "scan tester" ... experimenting with this in a "spare" program will often help you understand what IS and what is NOT being scanned ...

PS ... Phil changed the forum awhile back ... the [attachment] picture is still there ... it's just been relocated to the bottom of the post ...
 

Similar Topics

I'm using a Microscan MS-820 bar code scanner to scan bar codes on plastic parts. I have everything setup, but cannot get the scanner to...
Replies
1
Views
6,013
I have been working on this for a while now and I can't seem to get it. I was finally able to view the 1500 on the PanelView under the serial...
Replies
1
Views
82
Hello, I have a 1764 1500 LSP Series A that keeps failing with DTL_E_FAIL I/O error. Searching around it seems there's a weird issue specifically...
Replies
2
Views
106
Good Day i Have Micrologix 1500 LSP, and I want to get data from plc and send it through Modbus RTU slave; I have only ch0 on that plc I Order...
Replies
6
Views
917
Hello folks, Hope everyone is doing fine. I got an OMRON NS10-TVOOB-V2 hmi screen last day and planning to use it with Micrologix 1500. 1. Is...
Replies
4
Views
1,208
Back
Top Bottom