Sign in to follow this  
Followers 0
Div_by_zero

Special operation bits in RS Logix 5000

12 posts in this topic

I am having trouble finding the special operators in RS Logix 5000. What I mean by "special operators" is for example a built-in always on bit, an always off bit, a first scan only bit, a 1 ms on-off bit, etc. Not 100% sure what they are called in AB software to be honest. Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
They don't exist. I made an AOI to create the things that I like to have in every program. Just delete .txt from the filename and import You can also just create the tags and use the following ST to roll your own GSV(WALLCLOCKTIME,,DateTime,CLOCK.Year ); GSV(FAULTLOG,,MinorFaultBits,Minor_Faults ); GSV(FAULTLOG,,MajorFaultBits,Major_Faults ); GSV(TASK,MainTask,LastScanTime,IO_Test_Info.Last_Scan ); GSV(TASK,MainTask,MaxScanTime,IO_Test_Info.Max_Scan ); GSV(TASK,MainTask,Watchdog,IO_Test_Info.Watchdog ); ITI.Last_Scan := IO_Test_Info.Last_Scan / 1000.0; ITI.Max_Scan := IO_Test_Info.Max_Scan / 1000.0; ITI.Watchdog := IO_Test_Info.Watchdog / 1000.0; Flash.S := CLOCK.Second.0; Flash.F := CLOCK.Microsecond.19; OFF := 0; ON := 1; ID := 0; (* PID Increase / Decrease Control Action *) II := 1; (* PID Increase / Increase Control Action *) SI.L5X.txt

Share this post


Link to post
Share on other sites
Excuse my ignorance, but what is an AOI and how do I employ it? I am very new to RS Logix and PLC's in general for the most part. Thanks.

Share this post


Link to post
Share on other sites
It's not ignorance. I just realized that I did you a disservice by not explaining AOI's AOI's are Add-On Instructions. They are little or not so little snippets of code that you can use over and over again. They can be written in any language and used, in most cases, in FB and Ladder (even if I wrote it in Structured Text, which I did). I left the one that I uploaded unprotected so you can play with it if you are licensed for Structured Text. You can add them to your program from the menu tree (left side) offline or online. Online is best if you have a running program that you can't download to without shutting your equipment down. Scroll down in the menu tree until you see Add-on Instructions. Right Click, Import, Select File, OK Now that it's part of your program you need to create a tag for it to use. Open Controller Tags and for the AOI that I uploaded create a tag called SI and choose SI for the type. Tag type SI is only available after you import the add-on. Quick note about tags. They are awesome but only if you put some thought into them. In the above example you can make your tagname ThingsILiketoUseOverandOver and then reference, for instance the Always Off tag, with ThingsILiketoUseOverandOver.OFF. Personally, I like my tags to be my friend not my enemy, so I use something short. In this case I chose SI because it's shorter than System Information. The AOI has evolved to be more than just information but rather than change it I just leave it like it is. How to add the AOI Create an empty ladder. In the menu bar above the ladder routine there are tabs. Favorites is first. Next to that is Add-On. Click the tab and then while the new ladder rung that you created is selected, click SI. It'll drop a box at the end of the rung. Double click the question mark and select the SI tag that you created. That's all there is to it. For an Always OFF in your program- Use SI.OFF. There is a flash slow and flash fast tag, Always ON tag, Scan Time info,PID Loop II (Increase / Increase) and ID (increase / decrease) tag, etc. ML

Share this post


Link to post
Share on other sites
As an added piece of advice go the the 'help' file and, under the 'index' tab sear for 'S:' (the letter 'S' and a colon). Here you will find information on several system flags.

Share this post


Link to post
Share on other sites
Michael, Thanks so much for taking the time here with that very comprehensive reply. In order to break it down for me a little further, let's say I just wanted to have an always_on bit. What would that look like exactly? Also, are the "SI" bits you mention built-in, or do they have to be written by me? Thanks again. edit: I just re-red your reply about SI only being available after I import your file. Edited by Div_by_zero

Share this post


Link to post
Share on other sites
No problem. I should've done that in the first place. I'll add a little detail to your edit- Once you install the AOI, create the tag, add the AOI to a rung (or function block, it'll work either way), and assign the tag to the AOI everything is available from the tag that you created. Assuming that you called it SI the Always On is going to be SI.ON. Even though I wrote it I sometimes still have trouble (mentally, the tag itself works great) with using SI.ON from the AOI vs creating a BOOL tag called ON and writing to it from the structured text version that I posted above with ON := 1. ON is cleaner than SI.ON but the AOI is simpler to use and everything is documented so it's less (slightly) work. AOI's are handy for things that you do repeatedly like calculations or routines. I don't think I have more than 10 written and of those I probably only use a couple per program. When I worked on the gas processing side of the oil and gas industry I used most of them. Oil pipelines are a lot simpler. I have one that's fairly lengthy that calculates gas flow through an orifice plate. The only difference between it and a full on AGA3 calc is that I chose not to include an NX19 z factor correction subroutine. I built the complete version for the Siemens S7 but in most cases it's just as easy to type in the z factor so I left it out when I ported it over to CLX. In the gas processing and transmission world it's not unusual to have a dozen or more flow calcs. The AOI makes it easy. It's a little different than the SI AOI I posted here in that there are 10 variables that have to be assigned, 3 of which should be live and one of those must be live. I do that in a short structured text routine. I've got one for surge margin in expander compressors and turbines, liquid flow through an orifice, liquid velocity in a pipe, I forget what all... they are handy.

Share this post


Link to post
Share on other sites
I am still unsure how to create a simple always"on bit. Am I correct in my understanding now that I have to write a complicated .txt file just to have a bit that is always on? What does the purple text represent in your first reply, are they built-in instructions? Does AB have these documented somewhere? Thanks again for your help. Edited by Div_by_zero

Share this post


Link to post
Share on other sites
I've been meaning to make a correction to my first response to this post. I said "they don't exist" which is not true. I should have said "I don't use them". When I was an integrator I worked with a lot of different platforms and since Always Off (Not Always Off) is a commonly used bit state it was easier to write a rung like Ron shows above than look up each vendor's "secret code" for Always Off. Then Siemens came along with the S7 and gave me the "power" (power is a term I am using loosely because power can be both constructive and destructive) to create "widgets" to speed up the process of writing a program. My billing structure was based on the installed IO point count so the less time that I spent on a project the more I made. I did a lot of 2,000 - 3,000 IO point projects for a few years so the term time is money was meaningful back then (only 3 years ago. Time flies when you're having fun). I guess the point of this is that the AOI that I made is probably not useful to someone that writes one or two programs a year or just needs to make a real quick Always Off addition to an existing program. I write 20 - 30 a year (thankfully that is tapering off. I think I'll be under 20 for 2013 but the year is young so who knows, I just added 6 more PLC's to build and the engineer says we have 2 more projects coming) and I use every tag in the AOI. More importantly for the job I'm in now, every tag is identical in every program. I have to write in such a way that the guy that maintains the hardware that we have scattered all over south TX can understand what he is looking at and doesn't have to relearn anything. Side Note: I'm headed to Newell, West Virginia for some meetings in a few weeks. We are building a terminal near Wellsville, OH. We will be hiring for some positions (not sure exactly what positions other than Terminal Manager and operators). I'm being a little self serving but if there is an experienced CLX programmer (level of experience is not that important to me) that is interested in signing on with a really good company PM me. You may not be hired as a programmer but you could certainly start somewhere and evolve into a SCADA tech or even a supervisor that wears multiple hats. Eventually I'll need someone on the ground that can help troubleshoot the inevitable "the PLC did this when it's really a blown fuse" problem. When I do a project with PLC's it's 100% CLX these days. The Wellsville project has (5) L61's (maybe 6, we will figure that out in a few weeks). We don't use AB HMI's but that's a subject for a different day. Nothing against them, they just don't fit in our system very well. Edited by Michael Lloyd

Share this post


Link to post
Share on other sites
I see, makes sense. So say I wanted to see a list of the special bits that do exist, and use them...where would I find an Allen Bradley write-up on them....which manual do I look in? Thanks again.

Share this post


Link to post
Share on other sites
Well... I was going off of b_carlton's post above but like I said, I don't use them. I was just in the help files for CLX and I found the S (Status) bits but I didn't see anything about an Always Off bit. It could be that I wasn't looking in the right place.

Share this post


Link to post
Share on other sites
Michael, I found the section in the manual that covers the "S:" bits. Thanks so much for your help on this! I'm good-to-go now.

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