Sign in to follow this  
Followers 0
5p6d

micrologix 1100

51 posts in this topic

Excellent job showing a variety of uses for timers. They are very versatile. And the programmer is too. Byt the way ... In the examples rung 15 will reset t4:7 for a full second 60 times (once per minute) during the first hour of the day. Edited by b_carlton

Share this post


Link to post
Share on other sites
For some reason I thought I had put RTC:0.Min in there as well and looking back over it I actually thought about that. Also example 6, rungs 9 and 10 is less than ideal and won't function correctly if the push button is held down. I was going to change it but then I decided to not complicate the example and focus more on trying to get the OP to see some function and versatility and hopefully spark some imagination about possibilities. In hindsight I probably should have at least gone ahead and fixed the midnight reset with a oneshot as the midnight reset is common. A better way would be as shown. (edit to add picture) Edited by Alaric

Share this post


Link to post
Share on other sites
I'm not overly clear on why (someone gave me a very very fast crash course, this was mentioned wihtout much attention), but I drag the inputs/outputs from the Data Files list over to the corresponding element....i guess it somehow sort of assigns it at that point..... Anyways, no problem with inputs and outputs and timers, but what about latch/unlatch functions? I don't really see anything that matches...they are not hard outputs, etc...Also, usually when I 'assign' an input or output, it will turn the name of it green in the ladder and put numbers near it. I have a couple that it didn't do that on...like it didn't accept it as what I was making it, even though it was exactly like the others I did....another thing (sorry) is there an AB version of a temporary memory output? Just like an output but with no physical side.

Share this post


Link to post
Share on other sites
The bits in the 'B' files are typically used for that.

Share this post


Link to post
Share on other sites
If I understand you right those numbers are information about the physical IO point. Right click anywhere in the blank ladder area and open properties. You can turn the display of those on or off - I usually turn it off. Go ahead and explore the ladder display properties - there is a lot there - and see what each does. Try right clicking on an instruction address (make sure you get the address, not the instruction) and select edit comment or edit symbol and enter a comment or symbol. Symbols can really help you out. Try one of your inputs, for example, a start button and give it the symbol name START. Now go back to your ladder and insert an XIC, --] [--, instruction. Then click the ? and type START and hit return - viola, RSLogix will insert the right address and you don't have to remember it anymore. You can also enter comments and symbol names from the data table. Pick the address in the data table, then click the comment or symbol field at the bottom of the data table window. When an instruction turns green that usually indicates the status of the instruction/address. If you see --] [-- below I:0/1 then that means I:0/1 is on. While you are offline open the input data table and change the state of a bit. Observe the color change in your ladder. This will also illustrate that I:0/0 is not an input but it is an address in memory - a bit in the IO image table which gets a copy of the actual inputs before the beginning of a scan. Since it is memory, it is something that you can change. Edited by Alaric

Share this post


Link to post
Share on other sites
I'm not at my computer with RSLogix right now, but go to Help and then there is an item that is some thing like Instruction..... Take a look at those. It's every instruction with some good examples. That should be helpful for you while learning. It was for me! Also, I just found this. It looks very good. I've never seen it before but from a quick glance it looks like a great document. http://literature.rockwellautomation.com/i...gr002_-en-p.pdf Edited by mckeand13

Share this post


Link to post
Share on other sites
it looks like if I assign an element an address (ex: b3:0/0) then change the bit (say, from 0 to 8) the green info bar goes away, turns black and only shows the new address (as opposed to the address with the description I gave it above the address)

Share this post


Link to post
Share on other sites
Right - the name follows the address. You changed the address and the name changed to that of the new address, which presumably had no name. If you do want to change the usage of a an address and also move the description then use the 'Replace' function under 'Search'. Be sure to select the 'Move Descriptions' radio button. By the way, if you will be using a full word of bits but you don't feel that there is a need to individually name the bits then click on the word (eg B3:0) on the left hand side of the display and give the whole word a name, just like naming an integer. The individual bits when you choose them then show up as the word name '/' bit position. Edited by b_carlton

Share this post


Link to post
Share on other sites
ok, thanks....I think I need all my bits to be discrete.... I have several latching outputs that I use....the LOGO s/w has a box with a set input and reset input. (like an electronic RS latch) Since the latching outputs in the AB are seperated, do I assign the same bit to the latch output and the unlatch output? for example, a latch is set by 3 inputs in series. The same latch is 'reset' by 2 different inputs in series. Do I assign, say b3:0/0 to both the latch o/p and the unlatch o/p or would the latch o/p be b3:0/0 and the unlatch be b3:0/1?

Share this post


Link to post
Share on other sites
It would be the same assignment to both the OTL and the OTU. New people get confused about the standard output (OTE) compared to the latch/unlatch pair (OTL/OTU). They think that the latch/unlatch require some type of special bit. But it's the OTE that is doing something more complex. If the rung leading to an OTE is TRUE then Turn On the bit ELSE Turn Off the bit. (Note, two different actions depending on the truth of the rung.) As opposed to latch/unlatch: If the rung leading to an OTL is TRUE then Turn On the bit ELSE DO NOTHING If the rung leading to an OTU is TRUE then Turn Off the bit ELSE DO NOTHING These are actually simpler actions compared to the OTE. And on the pre-scan (a preliminary scan on power up or transition from Program to Run), the complete program is scanned (even normally non-called subroutines) and all rungs are interpreted as if FALSE. So the OTE target gets turned off. Nothing happens to the targets of OTL and OTU commands since that is the normal response to a false rung.

Share this post


Link to post
Share on other sites
Have you explored this site much beyond the forums? There are tons of articles and examples. For example, this article on how to program with symbols should be useful to you and germane to the current discussion http://www.mrplc.com/kb/index.php?article=25 In the project tree on the left hand side in RSLogix 500, if you look down towards the bottom of the tree you will see Database. Expand it and click Address/Symbol. Now you would be able to see any address comments and symbols you may have added. You can easily change them from here or you can change them at any instruction that has that address or you can change them in the data file. If you have a bunch to change its sometimes easier to do it from the address/symbol database. You can also import symbols and comments from an excel spreadsheet but that is a more advanced topic - instead keep it in mind and as you become more proficient you might want to explore that someday. Here is an article on how to to that to refer to when you are ready http://www.mrplc.com/kb/index.php?article=22

Share this post


Link to post
Share on other sites
ya, I understand the difference between an output and a latch, I'm just a little confused with all the addressing and bit assignments....this software is a little lower level (more detail) and I haven't had to deal with it using seimens or directlogix...

Share this post


Link to post
Share on other sites
Thanks for bearing with me, I'm reading what I can when I can....couple more questions then I'll try to stop asking such stupid questions: I had a function called a 'softkey' in the logo s/w that allowed a parameter to be switched on/off on the plc (buttons on plc were 'hmi' to lcd screen) I could use a NO or NC contact in my ladder based on the setting of that parameter.....can this be done somehow in RSLogix? I'll try and look up the other questions, this is just so much faster! Thanks again!!

Share this post


Link to post
Share on other sites
You can choose any bit in your PLC and program an XIC --] [-- or XIO --]\[-- addressed to that bit without programming any way to set the bit. In RSLogix500 you can right click on the address and select toggle bit to change the state of the bit, or you can go to the data table and change the bit. It will stay in that state until you change it. I sometimes put in bits like that so that I can switch parts of the program on/off during debugging and start up. The bits could also be set/cleared from an external device such as a panel view or any device that communicates with the PLC. The ML1100 and ML1400 have a small keypad on the front. Among other things, you can use the keypad to set/clear up to 48 bits. You define what bit file is used - I recommend creating a dedicated bit file that is at least 6 words long if you want to use this feature but its up to you. In address LCD:0.TBF you store the name of that bit file. If you created the file B10 you would put a 10 at LCD:0.TBF. Then you can access the first 48 bits in the targeted bit file. The next 48 bits in the target bit file (48 to 95) are used to define the read-only or read/write privileges for the first 48 bits. There is more information about this feature under Using the LCD in the ML1100 manual. Once you have a targeted bit file defined use any of those 48 bits as you would any other input bit.

Share this post


Link to post
Share on other sites
I've been reading about the LCD...very confusing...here's my most basic need: I need to put an on/off switch as a parameter on the LCD for the end user (no pc, no program, etc) to be able to use. Basically, it will say something like 'mode with/without' then allow the user to toggle between 'with' and 'without'. This of course will need to close a NO XIC in the program (with = XIC closed; without = XIC open) I would think L2 source A would be a string "In mode:" (I had to define the ST data file type) L2 source B would display the (mode) data string "with" or "without" based on the input..... L3 source A would be something like "change?" L3 source B would be the answer to 'change?' L4 source A would be 'with' or 'without' which would be a string sitting at an 'ST' defined address L4 source B woudld be the that string (from L4sA) value Not having used one of these, I'm not sure how the thing handles user interfaces...I saw how you can change values, but don't really see how to do an on/off type input. It seems like I need to put a string address in as string data... Edited by 5p6d

Share this post


Link to post
Share on other sites
Hey I want to print your example program, but the preview shows it as a new page for each section.....is there a way to cram it all on a page or two? None of the print setup pages offer options for 'fit to pages'...

Share this post


Link to post
Share on other sites
On each rung which has it clear the "Page Title". Then try printing.

Share this post


Link to post
Share on other sites
This is half right. The above is approximately how the RTO and TON timers operate. The phrase "when it equals" isn't right. It actually happens when the timer accumulator equals or exceeds the preset. This becomes important with high resolution timers and long scan times, and with timer precision. What does precision have to do with it? Let's say you want to use a timer that times for 1 second and you have a choice between a time base of 1.0 seconds and 0.01 seconds. With the 1.0 second timer, it will time for between 1.0 and 2.0 seconds again depending on random luck. The reason is because the PLC uses it's internal time base to calculate the fractions of a time base while the scan is running. Usually you will get something close to 1.0 seconds but not always. If you drop down to the 0.01 second time base, you get MUCH closer to 1.0 seconds since now you will trigger between 1.00 and 1.01 seconds. How to choose? If you need to time for less than a couple minutes, use the high resolution timer. If you need longer, use the low resolution one. If you need to time over more than 8 or so hours (32,767 seconds), either rig up the real tme clock or else make your own accumulator supplemented by an "infinite timer". It is completely inaccurate with TOF, which is the least understood of all the timers. It is so little understood that I hardly ever see anyone using it, and I used to take steps to eradicate it simply to make the logic more clear. However once you understand it, it is a great function that solves a lot of things that you need a timer for, and it does a great job of simplifying a lot of conditional logic where you have to check for a set of conditions OR the timer. With TOF, you can simply check the timer's DN (not done) bit. TOF is a bit different. The DN (actually should be ND..."not done") bit is a 1 as long as the rung is true OR as long as the timer is timing. This type of timer starts timing when the rung conditions go false. So the "DN" bit reflects "not done"...it is a 1 as long as the rung conditions are true OR the timer is timing. Thus the DN (not done) bit is great if you want to energize for just a bit longer, extending some condition with a slight delay before the timer elapses such as holding the output of a one-shotted event where you want a pulsed output for a specific time interval. There is a fourth instruction to be aware of, RES. This function RESets both TON and RTO timers. It can be used on TOF instructions but since the way it works is by blanking the timer status bits and the ACC, it can result in nonsensical values for the TOF instruction and so it's use is discouraged. There are two useful timer idioms to be aware of, the "free running timer" and the "infinite timer". With a free running timer, place an XIO timer.DN in front of the timer. This causes the timer to count up to it's preset and then self-reset. The DN bit then triggers for one scan at a rate equal to approximately one scan plus the timer preset value. It's not accurate (relatively speaking) but does provide the needed pulses. The infinite timer is a bit more complicated but gives you much more precise timing pulses. Use a timer which is basically never going to expire (no need for conditions on the rung at all). Set the PREset to twice what you want to time for. So if you need 1.00 seconds, set it to 2.00 seconds. Then on each scan, check if timer.ACC is greater than your actual desired timer PREset. If so, subtract the PREset from the timer. The reason for subtracting and not zeroing is that then you are taking advantage of the PLC's own internal clock and fractional timing mechanism. Your subtraction rung (and/or anything else you trigger) will have a timing of say 1.0 seconds plus OR MINUS one scan. There is some timing jitter (sometimes the timing is a little long, sometimes a little short) but the average trigger rate is EXACTLY equal to your intended preset within the limit's of the PLC's on board crystal oscillator. This solves the imprecision problems of using a free running timer when you need to do things like operate totalizers where totalizers that run for 24 hours or more have obvious accuracy issues with significant errors.

Share this post


Link to post
Share on other sites
paulengr WOW!!, my simple brain just doesn't go where you go. I have never given any of the above a second thought. Interesting stuff, thanks.

Share this post


Link to post
Share on other sites
In one of the examples I see that you move a value into the preset of the timer. Can I also move the value of an N integer that is being written from a panelview into the timer. For example if the customer wanted to adjust from 1-120 seconds and could input it on the touchscreen and it writes to n7:0 and i then move that to t4:4.pre is that acceptable. It just seems too simple for all the other things I have had to go around and around with.

Share this post


Link to post
Share on other sites
Yes you may move an integer into the preset of the timer. Be careful that the number is not negative as moving this into the timer preset will fault the program. Some programmers test the 'N' register for system minimum and maximum limits and not being negative as I noted before moving it to the timer preset.

Share this post


Link to post
Share on other sites
Paul! Nice timer summary! You mention the TOF. I dont really use that much as it gets me blank stares from some of the guys having to troubleshoot the systems I program. It does make things simple in some instances. My mantra has always been program to your audience. Since, as you mentioned, you rarely see them people rarely know what to do with them. Maybe I just need to send my clients to my video on the TOF and make things easy for myself. A little business cross pollination. I like your infinite timer. I dont think I have ever seen this in a program and I know I have never used it. I usually just use an STI for totalizers, but I like how your infinite timer works. Thanks for the post.

Share this post


Link to post
Share on other sites
Thank you I just wanted to be sure. With the panelview I can exclude numbers outside the range I am looking for so unless there is a data glitch I should be OK there. I like what you have done with some of those examples, I could have used one about a year ago....

Share this post


Link to post
Share on other sites
Sounds like there is some confusion here on many levels. First off, understand how a PLC (all except ControlLogix...we'll come back to that) works. A PLC has 3 steps in it's sequence: 1. Write the data in the output image table (O...) to the physical outputs. 2. Read inputs into the input image table (I...). 3. Solve the ladder. Rinse, repeat. There are some other housekeeping things too like updating the timer stuff, handling communications, processing block transfers or message blocks, and so forth. But the basic 3 steps are pretty much what EVERY PLC does. The exception at least in the AB lineup is the ControlLogix. In this case, it has a separate I/O processor that updates the input and output data tables asynchronous to the processor that solves the ladder. There are also ways to change this basic procedure (like interrupts) but the basic concept remains the same with almost every PLC. During ladder solving, the PLC scans from top to bottom, and from left to right. So your program does NOT, get this, NOT, directly interact with I/O. All that it does is interact with a bunch of data tables. Some such as a B data file are simply internal memory and don't have any special meaning. Some such as I, O, RTC, and S have special meaning to the PLC. When your ladder is executing code, it's just data. BUT, the PLC is hardwired to interpret some of that data as having a physical representation. Realize the implications of this. You can do something like this: XIC (some conditions) OTE (an output) XIC (some stop conditions) OTU (an output) This is an example of "assigning one bit to two outputs". In the relay world, this is totally illegal. It's also dangerous with physical outputs with a ControlLogix PLC (remember...asynchronous IO). But it is somewhat common practice to do something like this in many cases, especially with latches (OTU/OTL) which usually come in pairs. The PLC scans top to bottom, left to right. So in this case, the first rung sets up the output based on the input conditions. Then the second rung FORCES the output to zero (unlatches it) based on some other conditions. Perfectly legal but confuses some people because out in the relay world, you'd never wire the coil of a relay to two different rungs. You can easily create additional data tables as well, or change the lengths of the existing ones. Right click on the data table list icon itself (not the individual data table) and select "New...", or "Properties". This can only be done in offline programming however (except with ControlLogix). So it's good practice with the older PLC's especially to either lengthen the size of the existing data tables or add new ones. Except for the B and N tables, the defaults are very small, and you don't get some of the optional ones like ST (strings) any other way. I realize that with many other PLC's, the data tables are fixed and you can't change them or you have to make limited changes. And each and every data table has some kind of special meaning. Simply not true with AB PLC's. So get that notion completely out of your head and you'll be fine. When this concept came out back in the late 70's with AB PLC's, it was considered both revolutionary and heresy. Now with even more modern PLC's that have completely user definable tag names (ControlLogix among others), the idea of even relatively fixed data tables and symbols has been completely stood on it's head. It's sort of like the difference between Fortran (if you have been tortured into learning this) and C, Pascal, or Java. Certain variables in Fortran can or do have very specific meanings. With those others, a variable is a variable. Second, it is helpful to understand how you edit programs with an AB processor. The ladder sides are important and the symbols that you see there (green highlights or not, R's, I's, etc.) have special meanings. Some of this only applies in offline, online, or test mode. In online and test mode programming when you first enter a rung, it will be inserted with no green highlight. This means that it is not part of the executable code. You can verify the code at this point. Logix will check it over and let you know if there are any errors before it actually inserts it into the PLC's code. Note that Logix can only detect syntax errors. It isn't smart enough to detect bugs such as using indirect addressing with nonexistant memory or negative timer presets that will fault the processor. You have to find these yourself. When you "ACCEPT" it, it becomes an inserted (I) or replacement ® rung. When you attempt to accept it, Logix will also check over your work if it was not previously verified. Once you accept it though it is in the code, but it is not active. Step 2 is to TEST the code. Placing it in test mode means that all the new and replacement rungs become active and all the rungs that are being replaced become inactive. At this point the PLC starts executing the test code. If you realize that it isn't right, you can UNTEST it or simply cancel all of it in one step. Step 3 is the assembly process. At this point Logix deletes the original and now dead rungs and makes the test code active. It is also called "finalizing" depending on the version of Logix you are working with. Now in offline mode, there is only verified and unverified code. Once you verify it, it goes straight into assembled code. Note that some AB PLC's (Micrologix 1000 for instance) do not support online programming, but the vast majority do. Now the formatting of your data locations follows one of two standards for bits. They can either be shown as B3:1/1 for instance, or B3/17 to represent the same bit. The Bx:y/z syntax represents the data file, word (16 bit), and bit number. The Bx/y notation represents the data file as one bit long string of bits and ignores the words. Either way works, and you can configure it to display either way. The second point is that some people prefer to show the bit number below the instruction and some above. It's simply a matter of preference. Third, getting back to the thing about online/offline mode. It will also show you the value in the data location as Logix interprets it at some point in time. Logix will also highlight a bit instruction if it evaluates to "true". Again...at a given point in time. However since you may be seeing something asynchronous to what is happening in the PLC, do NOT rely on this. This is especially true with latch/unlatch instructions. And it's also true when you run into programmers using JSR/JMP commands because the code you are looking at might not even be active. So go ahead and use this as a useful troubleshooting tool because that's what it is intended for. But do NOT assume that it is always accurate. Again, I can't reiterate enough. Get both the user manual for your PLC and the instruction set reference. These are invaluable to understanding what is going on. AB makes these free. literature.rockwellautomation.com. No support contract is necessary to download manuals, unlike the tech notes library which is roughly 50/50. Study them heavily. The cheat sheets for instructions in Logix are OK but no substitute for the actual manuals. I suggest you at least skim them cover-to-cover.

Share this post


Link to post
Share on other sites
I have no demo unit to work with and with AB's little supply issue it will be some time before my 1200 is here to work with so I am programming without a tester. In my Eaton and Directsoft work I have noticed that the done bits on timers are on even when the rung is not true, does AB use the same gates in their timers. Would I be in trouble if I were to expect a rung to be true only when a timer was done timing. I thought that would be true with a directsoft 06 program and on startup it was enabling a rung before the timer was enabled because it toggled the bits some wierd way.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0