Sign in to follow this  
Followers 0
Pulsar2003

SLC500 and Visual Studio/Basic

28 posts in this topic

Hello guys, it's been a while since I've been here. I have a small project that I want to make much more complicated.... I've came about M. Archie Jacob's website and videos on YouTube (search: HMI). This gentleman was generous enough to create some free HMI templates for Visual Basic and Visual Studio. Currently I've downloaded the trail version of Visual Studio Express 2010. Here is the link found on this forum: http://www.plctalk.net/qanda/showthread.php?t=51758 Now is the simple version of the project the factory manager has asked me: We have six workstations on an assembly line. Some workers are faster then others and others aren't efficient; therefore the statistics of the entire work line is affected by the slow ones. I point out that each worker builds the entire product from A to Z. All I have to do I put a push button at each stations and once they have finished they press it to increment their own counter so we can know how much each one have finish at the end of the day. The complex version: Over the months this assembly line has been in business I often have seen the factory manager with a stop watch to evaluate some of the employees and also each of the different products is getting assembled on this line (let me tell you that when she's there the pace is not the same...). Knowing this I proposed the use a PLC over simple digital counters. Instead of having just a push button I would have two: one on/off and the momentary push button with a SLC500 (probably a 532). This means that as soon as the employee is ready to work they will have to turn the switch to "on". A RTO would start adding the seconds and would be reseted by the momentary push button (at breaks, lunch and at the end of the day the will have to switch it to "off"). We have reason to believe that this would put pressure on the workers to perform much better and increase the production to a more acceptable level. What I need to do is to store the value of the RTO timer and transfer is somewhere it can be saved and used for statistics and individual evaluations. This is what I've been up to: I've done a HMI with seven digital panel meters, one for each station and one that adds the accumulated values of the counters (C5:0.acc + C5:1.acc +C5:2.acc +C5:3.acc +C5:4.acc +C5:5.acc = MOV N7:0. That way it is easy to see how many each one has finished and the total production for the entire assembly line. Now I wonder how can I transfer the values of the timers and counters? I was thinking of using an Excel worksheet. There would be probably four values transfered: The works station number, the accumulated time, the accumulated value in the counter and finally a tage that would allow us to know what was the typical product being assembled at the time (there is about ten or twelve different ones with different difficulties so the monitored time varies). I'd rather stop here because I know that I can complicate things uselessly. I'd rather answer questions or see what suggestions I will have. Thank you.

Share this post


Link to post
Share on other sites
If you have a licensed version of RSLinx, you can use it to copy and paste a "link" to each of the values you want displayed in excel. RSLinx Lite does not support this connectivity.

Share this post


Link to post
Share on other sites
I have an OEM version 2.3. I found it in the server room where we keep all the software at the factory. I believe it has Gateway too. Are there any tutorials or examples on how to do it? thanks.

Share this post


Link to post
Share on other sites
Open RSLinx and go to Help, then search for "excel". There are instructions for copying and pasting links there. I am away from work and access to manuals, but that should get you there.

Share this post


Link to post
Share on other sites
For the simple version OkiePC described he's write the help file lays it out. You'll find several "step up" versions of Excel to PLC thru RSlinx in the downloads section of mrplc.

Share this post


Link to post
Share on other sites
Overall, very Pavlovian of you. Seriously, what's to prevent someone from cheating the system? And if they do, how can you catch them? I've done these same kinds of systems dozens of times. However, my implementations have one major important difference. I rely on the natural reactions of the assembly line workers to implement counters or timers. For instance, where do the raw materials come from, and how can you track them? How about the finished products? If they have to put them on a pallet for instance, you can always weigh them knowing the average product weight. Same with raw materials. If the raw materials or finished products go onto a belt or come from a box or something like that, you can also use this as a very easy measuring stick. The reason for doing this is simple. What's to prevent me from pushing the button a few extra times, intentionally or unintentionally? That will completely screw up your answers. If however it's simply counting product and/or raw materials either individually or by weight, it's a little harder to cheat the system. As to your implementation...yes, you can use RS-Linx this way. Consider using an HMI though since it already implements most of the details. Ignition from Inductive Automation works with Allen Bradley PLC's, logs to databases (heck, works ON databases), and a single machine implementation is free. You can easily read the database directly from Excel. Plus, it can log a LOT more information such as time stamping each event, and the database can be used directly to do hourly sums, averages, etc.

Share this post


Link to post
Share on other sites
Hello Mr. Paul You are correct as for how do we track how much work has been done etc. We have an employee that drill holes and prepares the material for the 6 assembly line employees and there is one or two who inspects and adds the instructions to finally put in boxes and on pallets. They keep track of how much the entire line has done for the day. To help you understand what we do it's cargo boxes for All Terrain Vehicles ATV. What is unfair for the efficient employees is that they will do more for the same salary. The slow ones need to get the message that they cannot rely on the others to be at goal. This is why I need a screen so all can see the total count for each employees. To resume: We do have track of how much goes is and out of the assembly line. This is why I wanted to have a button that indicated that one is working. So they need to turn the switch on. And this is why I want to have timers (RTO). If one resets the timer and it's way beyond the normal time span to complete the assembly it would be easy to find out who tries to cheat. Also because they end their shifts at 10 to 4 PM to clean up the assembly line and the last cargo box in somewhere in the process of being completed. Then they have to turn off the switch and stop the timer and the next morning the work will resume. On my home computer I don't have RSLinx installed so I went on AB's website. I searched for RSLinx and found this literature: linx-gr001-en-e.pdf on page 9 their is some details on how to monitor data. Then I remembered the short video for monitoring data from a PLC. It was the value of a timer being copied and pasted to an Excel cell and it kept on changing. For my project I wanted to keep track of 4 specific informations: Station number, Product identification, The count for that station and the time it took. That would be done ONLY as the RESET is done at a specific station. I already have in mind how to work the ladder for this. My worry is how does the information can build up!!! For example lets say that at Station 1 the employee took 20:55 seconds minutes to complete the Product ID 3 and it's the 7th completion. Station 2 the employee took 21 minutes and 30 seconds to complete the Product ID 3 and it's only the 4th completion. Those values would be move to the file N9:0, N9:1, N9:2 and N9:3. In Excel that would fill the Row 1 and columns A,B,C,D with this data: A=1, B=20:55, C=3 and D=7, the Row 2 would then read as: A=2, B=21:30, C=3, D=4. But how do I get that to be copied and pasted has it happens? And how do I prevent data to be overwritten? Or to fill next the Row 2 columns A,B,C,D? Most of the time it's always the same employee working at the same station. As you can see from a daily basis we would be able to make some statistics for each individuals, products and the entire assembly line. Now I also received the message about using a data base. This sounds Martian to me. Perhaps I should search this forum for some tips. Any software needs to be purchased? How do I get there? I have a spare HMI and I have a computer on the assembly line... Lets what comes out of this reply. Thank you.

Share this post


Link to post
Share on other sites
I also found this topic: HMI Operator Panel Opinions I understand better about the Ignition from Inductive Automation

Share this post


Link to post
Share on other sites
What you are doing (collecting statistics) is the heart and soul of what you do with databases. Doing it with Excel is not uncommon but is Martian. Excel is meant for, well, spreadsheets, especially what-if's. A database is tailor made specifically to collect massive amounts of data, sort/organize/index it, store it (possibly with redundancy), and to respond to queries on that pile of raw data with sub-second response times in most cases. Most major web sites, sales, accounting, etc., systems rely on databases as the backends for what they do. Effectively you end up with a 3 part solution: the data collection system, the database itself (which is generic), and the reporting/querying system that the end user sees. HMI/SCADA systems implement the first and third parts quite nicely, but Excel is also often pressed into service for the reporting end of things since that "data" tab/menu in Excel is specifically made to do SQL queries. A database (at least the relational type) works on set theory. You have a collection of data from some source. Let's say it has start/end times in it. So you can ask questions like "how many start times over X time interval?" or "how much slack time over X time interval?" or "what's the average service time (working time), by operator station?". Databases by and large use a language called SQL to construct the queries and return the results as a table (rows and columns). The one thing to remember though is that it is a SET, not a table. The only reason that there's any order to the table is because you impose one. Databases can and do operate on extremely large data sets. Think millions of records (each "row" is a record). They have built-in compilers (aka "query optimizers") as well as indexing systems that can return results of even a fairly complex query in fractions of a second. On the input side while they aren't as good as historians (which can log tens of thousands of entries per second), most of them can easily log into the low hundreds of data points per second. So even after you're done with the production line, you can trivially call up data over the past day/week/month/year and chart things as well with almost instantaneous response times. The "1000 pound gorilla" is a toss-up between Oracle and IBM DB2. Both are well known for being installed in large corporate installations, and both feel the urge to charge you dearly. The "800 lb. gorilla" is Microsoft SQL Server. The full fledged version is about $4K PER CORE (very, very annoying pricing scheme), making DB2 actually look cheap in comparison. Fortunately, they have a "developer version" that used to be called MSCE that constantly changes names and specs. Right now I believe it is relatively unencumbered except that the number of users on it at a given time is limited...fortunately this isn't a problem if you are driving it from an HMI (since there is effectively just one or two "users"). In open source, the top dog for years was MySQL. Unfortunately, MySQL was purchased by Oracle and they've since pretty much put a halt on anything resembling active development. Second place for a long time was Postgres. Postgres was even more buggy than a new release of Windows but was effectively full featured and very, very fast. Recently however they finally went bug stomping and at at this point, Postgres is probably the top of the line database for anything other than multi-site enterprise applications where you have to either rely on some manual programming, or pay for Oracle. Check out the postgres web site. Also check out w3schools.com since they have an excellent beginner tutorial on using SQL language for free. Download Postgres or the free version of Microsoft SQL server and start playing with it, or else download Ignition and ask for the free single-station license to use it since your end use will be interfacing to a PLC anyways. You really can implement everything you want with industrial grade software and not pay a dime for any of it. Forgot to mention...I'd trust Postgres at this point for industrial data storage and reporting. I can't say the same for Microsoft SQL. Everywhere I've worked so far, we've always had SQL as at least one option. It has a lot of bugs where if someone sends a bad query or doesn't open/close connections properly, or doesn't set up the rollback/recovery system just right, it results in crashes or taking down the system. Fortunately I've never lost data from it yet. Can't say the same for MySQL, although before they halted development, supposedly some of the supported database formats are much more reliable than others, which is the strongest reason not to use it (crashes are not 100% gauranteed to recover all, or ANY data). Postgres on the other hand is the most bug free and friendly to development. About the only big disadvantage is that despite having a really, really, really esoteric protocol, you can always find Windows drivers for everything out there. So before starting development, begin with the reporting and HMI that you intend to use. Then investigate what databases are supported and choose accordingly. Edited by paulengr

Share this post


Link to post
Share on other sites
Mr. Paul, I can see thing clearer now. Currently we use a system called Genius. I don't know if it's a system made locally or if it's known. This systems allows us to keep track of inventory, work orders, shipments, suppliers, clients. There are cross references the allows us to track all supplier and part details for all thing that we manufacture. Also the time collection is administered by it, in other word we don't have to us punch cards anymore. There are bar codes and a hand held scanner. If I use myself as an example when I come in in the morning I enter four letters from my name and scan the bar code for 'Start New Job' and once I finalize that job I return to the computer, type my ID again and scan the appropriate informations: machine/department, repairs/improvement, R&D etc and for which machine or client it's been done. As I have as immediate supervisor the Factory Manager she can know all that I've done in a day, week, month. Things go also for the rest of them employees. The assembly line also scan their work for the day. I should see first with the company's controller who manages all the computer/software development and spendings if she could see if this can be added to the system, if so we could also expand this to the rest of the machines and have a real time and complete operations data. In the mean time I will educate myself and learn more about the Data collection softwares. I appreciate your help. One thing I can say: 'the more I learn the more I realize the less I know!' Tks.

Share this post


Link to post
Share on other sites
I doubt it. Most of these types of applications are called "ERP's" (enterprise resource planning). It's an extension of the concept of MRP (material resource planning). These applications can do a variety of functions including financial functions, customer tracking, purchasing, payroll, etc. One of the first, major innovative systems was called Baan, and probably the one that I see most commonly is SAP. These systems are built on top of and heavily dependent on databases, but just as with historians, they are not themselves databases. That being said and despite the advertising, these systems rarely interface to anything else...essentially they are closed environments. There is another class of applications called an MES (manufacturing execution system). They are specifically intended to monitor production performance. Most of them calculate a metric called OEE (overall equipment effectiveness) as well as breaking that statistic down into information that helps you to analyze the components of the statistic. Allen Bradley for instance sells their version and it's called RS Metrics. How much of a benefit can you get from this? At the last plant I worked at (a foundry making cast iron pipe), we went from the worst plant in the industry to the best in terms of our costs and productivity. Quality went from 8% failed to averaging in the 2-3% range (industry best was 3-4%) with some days under 2%. Productivity almost doubled. Downtime went from 10-15% (not making this up) to less than 1-2%. We firmly believed that most of these gains came from being able to measure, drill down, and attack our weaknesses. Despite our efforts, we were never able to put in any sort of incentive program for employee productivity gains or we believed that we would have improved even further than this. All of the MES systems come as essentially 4 parts...again, you have an HMI/SCADA system or something similar which serves as the data collector and usually also as the plant floor operator interfaces. Then you have the database which may also be a more specialized high sped data recorder called a historian. Then you have a report generator. Finally, you have a 4th piece that I'll describe as essentially a bunch of macros and scripts that run on top of the last piece. You fill in a bunch of detailed templates to describe your plant and then the system calculates metrics such as downtime, slack times, equipment utilization, OEE, etc., etc. It's a great system but there are a three problems. First off, the degree to which the MES model fits your particular operation determines how much of the MES system is actually functional. Many times I've run into limitations in the model that prevent me from truly utilizing the system. Second, it takes almost as much time to model the plant as it does to write your own reports, so it doesn't seem to be much of a time saver at least for me. Finally, the MES systems are really, really expensive for what you get. How expensive? Try $20,000-$40,000 for the base system, and many of them have various per user licenses. With this in mind, I am a huge proponent of MES systems, but not MES applications. I think the applications are too limited in their capabilities and overpriced, but the overall concept with a set of custom software is fantastic. I suggest you download the manual for RS Metrics or FactoryTalk Metrics or whatever they call it now. Carefully read the manual and understand exactly how the system is used to develop a plant model, and what the reports look like that it generates. Then set up your data collection system to collect the information you need if you had bought this application and develop reports off of that.

Share this post


Link to post
Share on other sites
Hello again. I haven't been on the forum for awhile because I've been working on the project. I made contact with Inductive Automation. It won't be free thought. For this project I decided to go with the MicroLogix1100 because it has a built in Ethernet connection. I'm able to communicate using RSLinx lite through DF1. RSLinx doesn't identify the unit but this doesn't impair the communication. RSLogix 500 can also communicate (for example I can monitor the inputs and outputs). The original IP address was 10.121.29.170 (the original one I think). In the factory we already have an oven that has a SLC500 processor (552), the IP address is: 192.168.100.99. I changed the original IP address of the ML1100 from 10.121.29.170 to 192.168.100.90 (I want to stay close to the other one to make things simple...and that one works). Now with RSLinx lite I set up the driver for the Ethernet. I connect the PC to the ML1100 via it's RJ45 jack with the proper wire. I'm aware that when connecting two PCs, a PC to PLC, PC to a 1761-NET-ENI etc you need the proper wire. I doubled checked the wire, the sequance is: Brown/white, White/brown; Orange/white, White/orange; Blue/white, White/blue; Green/white, White/green. And on the opposite side the sequence is: Brown, Green, Blue, Orange (I cut short on the details here). My other wires have the same order on both jacks. RSLinx doesn't find the ML1100. When it attempts to make the connection I notice the Network connection icon changes of status and there are dots indicates some connection being attempted (Windows XP Pro). Once RSLinx has failled there is a message box over the Network connection icon that indicates that the Network connection is now established. It does that also when I turn on the PLC or connect it back the PLC and PC. Because the LAN card is not connected to an internet router or modem I wonder if I need to make some changes in the parameters with Windows. Any body can help? Thanks

Share this post


Link to post
Share on other sites
1) When you used the DF1 serial connection to set up the ethernet address of the ML1100, did you remember to turn off BootP in the channel configuration? If BootP is enabled, the ML1100 will send BootP requests following a power cycle, looking for a new IP address to be assigned. 2) Is the CAT5 cable connected directly from a PC to the ethernet port on the ML1100? If yes, it needs to be a crossover cable. If you connect the ML1100 to a hub/switch/router and connect the programming PC to the hub/switch/router, then you can use straight through cables. I think based on your post that you did use the correct crossover type of cable. 3) Since you mention that RSLinx didn't identify the unit, that hints that you might be missing the eds file for this particular PLC/firmware level, so you are likely to encounter problems until you find the correct eds file and install it using the EDS Wizard. If RSLinx shows the device in the RSWho window with a yellow question mark, this is a sign that RSLinx does not recognize the device due to a missing hardware eds file. Find the eds file here. Install it using the eds installation wizard found on your computer under All Programs > Rockwell Software > RSLinx Tools. If the device doesn't show up at all, then the RSLinx driver hasn't found it. If it shows up with a red X, RSLinx has seen it there at one time (or is configured to expect it to be there) and the device is no longer "there" (not communicating anymore). Edited by OkiePC

Share this post


Link to post
Share on other sites
Back to square one!!! 1) When you used the DF1 serial connection to set up the ethernet address of the ML1100, did you remember to turn off BootP in the channel configuration? If BootP is enabled, the ML1100 will send BootP requests following a power cycle, looking for a new IP address to be assigned. 2) Is the CAT5 cable connected directly from a PC to the ethernet port on the ML1100? If yes, it needs to be a crossover cable. If you connect the ML1100 to a hub/switch/router and connect the programming PC to the hub/switch/router, then you can use straight through cables. I think based on your post that you did use the correct crossover type of cable. 3) Since you mention that RSLinx didn't identify the unit, that hints that you might be missing the eds file for this particular PLC/firmware level, so you are likely to encounter problems until you find the correct eds file and install it using the EDS Wizard. If RSLinx shows the device in the RSWho window with a yellow question mark, this is a sign that RSLinx does not recognize the device due to a missing hardware eds file. Find the eds file here. Install it using the eds installation wizard found on your computer under All Programs > Rockwell Software > RSLinx Tools. If the device doesn't show up at all, then the RSLinx driver hasn't found it. If it shows up with a red X, RSLinx has seen it there at one time (or is configured to expect it to be there) and the device is no longer "there" (not communicating anymore).

Share this post


Link to post
Share on other sites
Yes, that is the problem. I should have noted that earlier since you did mention the version you're using... You need RSLinx version 2.50 (with the eds file) or 2.51 or newer. You can download the latest version of RSLinx classic here: http://www.rockwella...ort/webupdates/ Read the agreement, then sign in (register for free if you haven't already) . EDIT (license type confusion on my part): I would recommend you download the latest version 2.57 of RSLinx OEM. I don't know of any problems with the newest version, and it will include capabilities to communicate with the newest A/B controllers. Edited by OkiePC

Share this post


Link to post
Share on other sites
It is the RJ 45 connector wiring which doesn't quite look like it should. Is it a pre-made patch cord or it was "in-house" made ? We've always "split the greens" of CAT5/6 cables when running Ethernet/IP. Something like OR/WH, OR, GR/WH, BLU, BLU/WH, GR, BR/WH, BR. You really need a LAN Media Checker/Tester to ensure the proper layout and functionality of any Ethernet cable run! Try using pre-made patch cords when possible, but not before also testing them

Share this post


Link to post
Share on other sites
So I'm back with bad news.... First thing I done was to replace RSLinx 2.30 to 2.57.00 CR9 SR3. I connected my original wire from the PC to the ML1100. Same results from RSLinx. On the Ethernet browser window there is a huge yellow question mark over the IP Address and shortly after a nagging red X appears over it. So I bought another cross wire and guess what? ....same results. I remind you that I currently have two computers side by side, one I recent and runs on Windows 7 while the other is probably a Penthium 2 running with Window XP Pro (makes it very slow). Next I installed a switch to connect both PCs, the ML1100 and the router (Linksys EZXS55W). Something must be working correctly with the switch because I can go on the net with both computers. I even tried: http://192.168.100.90 on Google Chrome which comes back with an error: page not found (Internet Explorer did the same)(As an example I have some literature for the ML1400 already opened, Publication 1766-UM002A-EN-P - November 2008, on page 5 there is an example of this). For all the connected devices all the respective lights are lite in front of the switch. If all was correct shouldn't I be able to connect directly to the MicroLogix (or any other Ethernet device) this way? Is there a way to verify that a port functions correctly? On the ML1100 the green lite on the upper left side of socket is lite while the yellow/orange one never does. I removed the jack from it to visually inspect that all the gold plated strings are there and not bent or damaged. Any other avenues.... I'm loosing the little sanity I have over this. P.S.: on my newer computer I'm currently replacing my version of RSLinx to run the same test as the older one.

Share this post


Link to post
Share on other sites
Looks like a dead avenue... Can the MicroLogix1100 have both the DH+ and the Ethernet port run at the same time? I deactivated the com port from the display but nothing changed.. Thanks Edited by Pulsar2003

Share this post


Link to post
Share on other sites
Hopefully you de-activated it and did not devastate it! Get the PC and PLC connected to a switch with straight cables. Make sure the IP addresses and subnet masks of both are compatible. From the PC, shutdown RSLinx for now. Open a command window and ping the ip address of the PLC. Until you can get it to reply to a ping, there's no point going any further. Example: ping 192.168.100.90 The PLC and PC must have compatible IP addresses and subnet masks, so tell us what the PC lan card IP and subnet mask are set to. Edited by OkiePC

Share this post


Link to post
Share on other sites
Thank you. I will make that attempt as soon as I get the know how.

Share this post


Link to post
Share on other sites
Now what is the PC (laptop) ip configuration? You should be able to see that from the command window by entering "ipconfig/all". The PC must have an IP assigned to the same subnet as the PLC in order to communicate. So, the first three octets must be the same, and the 4th must be different. Edited by OkiePC

Share this post


Link to post
Share on other sites
Got that!!! On the old computer (which is now hooked up to the hub) I followed your instructions. I ipconfig/all and the IP address came up as: 192.168.1.108. Subnet mask as: 255.255.255.0. There were two more IP address that came up, as it's a French version of Windows I don't know how to translate it, twice it was 192.168.1.1. this older computer as the network card set to get the IP address automatically. If I change that and set an IP address to match the one that came up as: 192.168.1.109 or I could also change the IP address in the MicroLogix as 192.168.1.109. Now they should be on the same wave length and both the PC and PLC could communicate via RSLinx. The network at work as a different setting for the IP Address, from what I understand I will need to change it in the PLC before setting it up. Ignition should find it on the network in the factory. On my more recent computer I got the hex address of: 00-ID-60-52-8F-73. And another as IPv4: 192.168.1.106. Now if I want to use my more recent computer I will need to match both IP address. Did I get that???

Share this post


Link to post
Share on other sites
It's the third octet that does not match. Does your DHCP server (I.T. Department at work) issue addresses which always have "1" as the third octet? I would recommend checking with them to make sure it's okay to use that for a PLC IP address. I am fairly new with ethernet so, I don't want to suggest IP addresses that break something on your work network. Your IT department should be able to tell you what addresses to use for the PLC and RSLinx driver (PC NIC IPconfig), but it's likely they will have "1" as the third octet. Now, if you're isolated from the IT network and want to test your cables / PC IP and port and the PLC IP config and port, then set them all up with a subnet mask of 255.255.255.0, and IP addresses of 192.168.1.x and 192.168.1.y, where 1<x<>y<254...addresses like 0, 1, and 254 may be illegal or reserved. If connected to a larger network, before you change any of the IP addresses, ping the addresses you want to use to make sure nothing replies so you don't create a duplicate IP address. A duplicate IP address can wreak all sorts of havoc, or cause very few symptoms at all, so avoid duplicates ahead of time. That hex code is called the MAC ID. It is for the most part, an unchanged number that identifies the mfg and uniqueness of each ethernet device. In the background the MAC ID is used by various services but you needn't worry about the MAC IDs for what you're doing. Edited by OkiePC

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