
adccommunitymod (AutomationDirect) asked a question.
Created Date: November 17,2009
Created By: krak
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
Here is a new challenge, for me it is anyway. A customer has a 06 and Cmore. He wants to add two functions to the machine. First he wants to add password protection to the cmore so his company can change setting top level settings on the machine, and his customers can change some settings mid level settings, and the customers’ employees can change the lowest level of settings. The second function he would like to add is to have the employee log on every day before using the machine, and after 15 minutes of idle time. The machine will be programmed to remain idle until a employee is logged in. The employee will be assigned a number between 0 and 9999. That number will be logged to track who is using the machine at what times, and how much. There can be up to 50 customers with each having 10 or more employees. I plan on using the password segment of the cmore to handle the levels of access to settings. But I have my doubts that the cmore can handle the login of that many employees. I was thinking about setting up a segment of code in the plc that can help handle this. I would make it so the customer management can use the cmore to assign the employee first and last name, and also the login number. I think a number entry box and two text entry boxes could be used to assign the employee their number. Then store that in the plc. Then when it is time for the employee to login, they use the cmore to enter in their number so they can start using the machine. My questions are: How can I verify that the number the employee enters is in fact their number? IE after entering the number have it scanned and compared to up to 10 saved employees in the plc to make sure the number is valid and it is the correct employee. To set up the cmore for text entry, the anscii string is default to 40 characters, how much memory does that use in the plc? Considering up to 10 employees, I’ll limit it to that many for now, with 2 ansii string each that is 20 strings total, 800 characters. What is an easy way to compare the number inputted by the employee, with the ten possible correct numbers that were entered by management?
Created Date: November 17,2009
Created by: Do-more PE
Each V-memory location will hold two ASCII characters.
There isn't much of an easy way. If it were me I'd use a for/next loop and pointers to index the numbers for comparison.
Created Date: November 17,2009
Created by: Shimmy
I 've read through your description several times but I am still mostly confused. A couple of suggestions that I have initially are:
Why use ascii if the login is going to be a number from 0-9999? Use a numeric entry box instead.
Could you assign a group of numbers to each level so employees are assigned numbers 0-5000, customer is 5001-7000, and company is 7001-9999. In your PLC any login less than 5001 would be level 1 access on the cmore, between 5001 and 7000 would be level 2, and greater than 7000 would be level 3. The PLC could keep track of who is logged in. The cmore wouldn't care who is logged in but, according to the range, would be able to assign the correct level.
Created Date: November 17,2009
Created by: krak
@ ADC app Assist,
So I would 20 vmem per name, 40 vmem for a full name First and last, for a total of 400 vmem. Ok I think I can handle that. I was afraid that it would not be easy. I haven’t used the for loop much, actually I can’t remember the last time I used it. Since I can limit it to 10 users for now, I was thinking of coding out a compare line. If v3000 ( entered on screen) is equal to v3100 (number assigned by manager) load spot 1 ascii string into v4000 and spot2 ascii string into 4020 and out c123(confirm match)
Repeat the line of code 9 more times plus one more line in the case that there is no match.
It’ll work for ten users, but can be messy to add more. However the manager could reassign one of the ten spots, with new numbers and names.
If you could present an example of the for loop, I would appreciate it.
@ Shimmy,
Sorry for the confusion. The reason for using ascii strings will be to allow the manager on site control the user number and name directly on the cmore. so he / she could assign worker 1 with a number and the First and Last name 1234 John Smith
1235 Jane Doe
The purpose of this part of the program is document who is using the machine. This will be sent to a database. I think I will set up a message or alarm to be sent to the database when a name or number changed by the manager. Encase a employee is no longer using the machine and there are no more available slots for manager. I understand what you are saying with the levels. It just doesn’t apply for my situation. However I was thinking about limiting number ranges according to machine. Machine gets 0-99, machine 2 100-199, and so forth.
Created Date: November 18,2009
Created by: Do-more PE
I agree with Shimmy. I wouldn't use ASCII for the number. I would set it up something like this.
V2000 - Employee 1 Number (Unsigned Decimal 32)
V2002 - Employee 2 Number
V2004 - Employee 3 Number
etc
V2100 - Employee 1 First Name
V2124 - Employee 2 First Name
V2150 - Employee 3 First Name
etc
V2200 - Employee 1 Last Name
V2224 - Employee 2 Last Name
V2250 - Employee 3 Last Name
etc
I would use a For/Next compare to find the pointer location of the number when the employee put it in. This would give me a pointer for the first and last name as well by doing some math.
Not the best example, but I am a bit rushed for time. This program adds two tables using pointers and a for/next loop.
PLC 250(-1)
// Rung 1
// Address 0
STR SP1
LD K0
OUT V2000
// Rung 2
// Address 3
STR SP1
FOR K7
// Rung 3
// Address 6
STR SP1
LDA O4000
ADDB V2000
OUT V2001
LDA O5000
ADDB V2000
OUT V2002
// Rung 4
// Address 13
STR SP1
LD P2002
ADD P2001
OUT P2002
// Rung 5
// Address 17
STR SP1
INCB V2000
// Rung 6
// Address 20
NEXT
// Rung 7
// Address 21
END
// Rung 8
// Address 22
NOP
Created Date: November 18,2009
Created by: krak
Thank you for the example. Now I see were the confusion is. I should have made it clear that the name would be the ascii strings the number would be bcd. Hopefully I will be able to try this out by the end of the day.
Created Date: November 17,2009
Created by: krak
Here is a new challenge, for me it is anyway. A customer has a 06 and Cmore. He wants to add two functions to the machine. First he wants to add password protection to the cmore so his company can change setting top level settings on the machine, and his customers can change some settings mid level settings, and the customers' employees can change the lowest level of settings. The second function he would like to add is to have the employee log on every day before using the machine, and after 15 minutes of idle time. The machine will be programmed to remain idle until a employee is logged in. The employee will be assigned a number between 0 and 9999. That number will be logged to track who is using the machine at what times, and how much. There can be up to 50 customers with each having 10 or more employees. I plan on using the password segment of the cmore to handle the levels of access to settings. But I have my doubts that the cmore can handle the login of that many employees.
I was thinking about setting up a segment of code in the plc that can help handle this. I would make it so the customer management can use the cmore to assign the employee first and last name, and also the login number. I think a number entry box and two text entry boxes could be used to assign the employee their number. Then store that in the plc. Then when it is time for the employee to login, they use the cmore to enter in their number so they can start using the machine.
My questions are:
How can I verify that the number the employee enters is in fact their number? IE after entering the number have it scanned and compared to up to 10 saved employees in the plc to make sure the number is valid and it is the correct employee.
To set up the cmore for text entry, the anscii string is default to 40 characters, how much memory does that use in the plc? Considering up to 10 employees, I'll limit it to that many for now, with 2 ansii string each that is 20 strings total, 800 characters.
What is an easy way to compare the number inputted by the employee, with the ten possible correct numbers that were entered by management?