RSLogix 500 - string comparison

mechanizator

Member
Join Date
Mar 2007
Location
Brzeg
Posts
16
Good afternoon to all. I'm new guy on this forum. I'd like to ask you for help with task like this:

My boss gave me a program to modification. I'm a beginner in A-B programming. I have to make interface for user management (add, deleete, modify, login) to some plc and hmi program. The user database has to be in plc program. It uses Micrologix 1100 series A controller. I'd like to ask you how can I compare string values (I created database that has in one ST file username, in second ST file passwords and in B file user level) - first I wanted to use N file for username and password, but there will be up to 60 users and I couldn't imagine how to manage this in N file. Now I would like to ask you, how in rslogix 500 can I compare two string values with one direct and indirect address. And also which function to use to move values from one ST field to other ST field with indirect address (I need indirect address to search through database). Thank you for all help.

Greetings to all.
 
Sorry I can't help with the string functions, but can't you just use N's for everything? If each of the 60 users is a number from 0 to 60, then their password is stored as an indirect address of their user number in another N file. Their access level is stored as an indirect address in still another N file. To be tricky, make them have a PW that is > 10000 (but of course < 32768)so that five numbers are required. So you have something like:

N20:0 = 0; N20:1 = 1; N20:2 = 2; ...

PW - N21:[N20:0] = 12345; N21:[N20:1] = 23456; ...

Access - N22:[N20:0] = 0; N21:[N20:1] = 1; ...

Even if your access level is binary (0 or 1) you can still store it in an integer; it takes up some more space, is all. With 60 users, you need 180 words in three files. Do you have that much room? And if your HMI is that simple that it doesn't support logon and PW, people will much more want to enter numbers on it than strings anyway I think. There is no searching required; the OPR enters a number and that is compared to the number in N21, and privledge is set by the number in N22. You need some additional tags so that you're not carrying "N22:[N20:45]" all over the program, but you would with strings too. Can it be this easy, or do you need more complicated control of users and access levels?? Or am I missing something in the requirement?
 
Sorry, I'm new in this kind of software. Until now I made only visualizations using VB.
I have been told to create user management, where username and password will be inserted as alphanumeric characters (max 8 characters - for password also 8 characters max). They told me that I could set 4 words for username, 4 words for password and 1 N file for access level. But One N file can have up to 256 elements, and for 60 users this will be 240 elements, so there could be one N file for usernames, 1 N file for passwords one 1 N file for access level, yes? How does it look, when user inserts it's name as alphanumeric? Can I assign to username box in hmi the N address? for example N9:20 ? How it will be preserved? The password will be converted automatically in N type and will be preserved in N9:20 - N9:23 (8 words)?
 
Last edited:
mechanizator,

We really need to know what kind of HMI you will be using in order to provide a solution. String data files in RSLogix are very inefficient because each element requires 80 characters of memory regardless of how many you actually need. So you will soon run out of memory as was mentioned.

If you store text data in N files (or A files on the SLC platform), typically there will be two characters per word (one ascii character = 1 byte). But this relies on your HMI being able to access the text data in that way. I do know that the Allen-Bradley Panelviews and Red Lion G3s can do it, but not sure about other brands.
 
I know only that it will be some A-B Panelview, but I'm waiting for information what model will be used. In general, if it will be A-B Panelview may I use this kind of solution:
in hmi application user will input his username and password in stringinputbox. Should I aasign to this tag as ST or N file? If it will be ST file, I can use ACI function and compare integers, or I should preserve username and password directly in N file? If for example username will be 8 char long, and I will assign to this e.g. tag as N9:20 - password will be preserved in N9:20, N9:21, N9:22, N9:23 automatically or I have to preserve it in ST file and then make ACI to change string into integer?
 
If you want to use text usernames AND a standard PanelView, your ladder program is going to be a little complicated I think. You will have to run a loop using the LBL and JMP instructions that repeats up to 60 times, and uses indirect addressing to see if the entered username is equal to each name in the database. (You may have to use 4 EQU instructions to check each word.) If the names are equal, it will then check the password and then set the access level if the pw was entered correctly. Yes it can be done.

But I would recommend doing either of the following:
1. Instead of having text usernames, give each user a user number/code between 1 and 255, and a numerical password. Then when they enter their user code, you can use indirect addressing to check the password and no looping is necessary. Makes for a much simpler program
2. Get an HMI that has these security features built-in. You didn't mention whether you're using a standard Panelview or the PV+, but if it's the Plus you may be set already. (I don't have experience with that unit but I know it is much more advanced.)
 
Thank you all for help. I did it in this more difficult way, because alphanumeric usernames and passwords will be used. I wait now for the hardware to check all function. If the all lopp will work fine, I will make then the rest of user management.

Thank you one more time.

Now I have to "fight" with RSView to the hmi application.
 
You cannot put alpha's in N registers. If you must use alpha or alphanumeric, you must use ST. And you don't have enough memory in the PLC to handle 120 ST's (One for user name, other for password for each of 60)

To do what you're wanting with an 1100, you're going to have to stick with numeric usernames/passwords or use an HMI with built-in security. I HIGHLY RECOMMEND the HMI with built-in security! It will be much, much, much easier!!
 
Oh boy. Mech, you are in the classic integrator bind; you have a requirement from the customer, no hardware, and not much knowledge of the proposed hardware and software.

I'd suggest that you first identify the HMI device that will be inputting data. It seems the MicroLogix 1100 is firm/fixed at this point, so that's the starting point. Now, as has been said, that controller is not good at string storage and manipulation (very few PLCs are; they are not intended to do it). Go to the Allen-Bradley website www.ab.com go to "Manuals & Literaure" and download "SLC 500 and MicroLogix 1000 Instruction Set Reference Manual."

You're a programmer so read it and you will find out what the architecture is in a PLC. PLC's are one step above assembler (well, ladder logic anyway) and you will find that memory, logic and data manipulation are very different than in something like VB. You should get the ammo you need here to tell the customer that putting the security table in the controller is not a good idea, and that putting a string-based security table into this controller is probably impossible.

Then you have to identify the HMI. A PanelView Plus will do everything you need and more in the HMI; that's one of the functions of an HMI. An older PanelView will handle ASCII data entry, and has a security function that will use strings or numerics. However, it's not intended to be "in the PLC" and security and access will be in the HMI.

OK... once you have identified the controller, read up on it's capabilities/limitations, and identified the HMI, you can go to the customer and propose an alternate security plan that will match the equipment and their requirements. It may use strngs, but they won't be in the PLC. If it has to be in the PLC (why? What is driving this?) it will probably look a lot like what I outlined a few messages back or what kolyur just said.

Please... I don't want to sound harsh, but you have to stop focussing on the strings and get a bigger picture. Look up the info on the AB site, talk to your boss, and get back to us. We can answer a lot of questions, but you need a better definition before you spend a lot of time and money on this task.
 
Last edited:
You can put alpha characters in N registers. In the radix popup there is an ASCII option which will display the data as text, and let you enter it as text (two characters per word).

That said, it is certainly not ideal for most applications. But it is an alternative to String data that uses gobs of memory.

I agree that an HMI with security functions would be the best solution.
 
From what you said before "They told me that I could set 4 words for username, 4 words for password and 1 N file for access level."

It sounds like only 4 usernames and password levels are required. Then basing the username/password you have 4 levels of security (ie. maintenance, engineer, admin, operator). Each of the users of the equipment will be given a username/password based on their function.

Again I will echo everyone else that the HMI is the way to go. With a standard panel view all that the user has to do is type in a password. The associated level is sent (by integer) to the PLC. The logic in the PLC can determine which username is associated and display that on the HMI.

This might not be what you need but just throwing it out there
 

Similar Topics

I'm not super familiar with the Micrologix line of processors, but I am pretty familiar with RSLogix 500. I'm trying to simply copy a string to...
Replies
4
Views
311
I've got a Keyence barcode scanner I've got coming in via Ethernet to a Micrologic 1100. I've got the data coming into N Type Data Files and when...
Replies
12
Views
7,118
Hey, guys. I'm a co-op/intern at a company this semester, and I'm learning how to program PLCs. I'm using RSLogix 500 and a MicroLogix 1400 PLC to...
Replies
3
Views
4,265
Hi, first post so be nice :) After searching through here and on the Google I still haven't resolved my problem. I've referenced...
Replies
3
Views
3,935
Hi Everyone, I am not proficient in RSLogix 500 so I have a question regarding the evaluation of N7:0 data as an input. So as I understand in...
Replies
1
Views
92
Back
Top Bottom