A Tale of Programming Two PLCs

Developing and managing several different PLCs and HMIs can be a real burden on a PC or laptop.  The problems include:

  • The different software packages can cause conflicts with each other.  Communication problems are a common example
  • Memory gets loaded up with automatically started background services even if you're not using the programs.  This kind of bloat makes everything slower.
  • Some packages don't uninstall well and leave behind a lot of files.
  • Older legacy software may only run on older operating systems.

To remedy the situation there are some options:

  1. Use a different laptop or PC for each application.
  2. Create a separate partition on your hard drive and boot up to a different OS.
  3. Write a batch file to stop/start services.
  4. Create different Windows hardware profiles
  5. Use software like VMWare or Virtual PC.

Dedicating a PC may be the only option in the case of ancient hardware, but it’s ultimately what we want to avoid.  We’re not going to consider option two since we’re into simplicity and I think the other choices are better.  The second and third option of batch files or hardware profiles solves the conflicts and memory problems and is easily implemented in Windows.  The fourth option can also be a good solution to separate environments and quickly switch to different operating systems even though it can be a memory hog.

Tracking Down the Right Windows Services

The first thing to do is identify the program’s services that start automatically.   The services are listed by going to the Control Panel, double click on Administrative Tools, and then double clicking on Services.  In our example we have installed and want to separate RSLogix Enterprise, Siemens STEP7 and Wonderware on a Windows XP computer.  

Be careful here as certain services are required for Windows to function correctly.  If you are unsure then you should create a system restore point before experimenting.

 

Windows Services

In the list you will see some obvious names and descriptions but others may be a bit obscure.  By right clicking on the Name and then selecting Properties you can see where the process lives.  For example the “Automation License Manager Service” looks suspicious.  The properties dialog shows us that it is indeed a Siemens program since it is in the Siemens folder.

 

Siemens serviece

When in doubt you can use Google to try to get information on any particular service.  There’s also ProcessLibrary.com which is one of the best sites for determining a files worth.  If you want to go further there’s a batch file at PC World that stop/starts what it thinks are unnecessary Windows services.

The other columns in the Services window tell us if the service is started or it shows nothing if it’s stopped.  The start up type determines what it will do when Windows boots up.  So even if things get screwed up it will go back to the default after a reboot.  The services of particularly interest say “Started” and “Automatic”

For my system, I’ve done the homework and determined the services I want to stop are:

AB

  • RSLinx Classic

Siemens

  • Automation License Manager
  • S7 Global Services
  • SIMATIC IEPG Help Services

Wonderware

  • ArchestrA Logger
  • FS Service Control
  • Wonderware SuiteLink

Just for kicks, I can get the file name of these services and determine their memory usage by Ctrl+Alt+Del and clicking on the Processes tab.  The column Mem Usage shows me how much RAM these bad boys are eating up.

Creating a Batch File to Stop/Start Services

To quickly stop a service, right click on it and select Stop.  That’s all well and good but who wants to do keep doing that all the time and having to remember each of the services?  The easy way is to create a batch file which does all the work.

A batch file is simply a text file (created with NotePad or any text editor) that has a .bat extension.  The commands found in the file will be run by Windows just like commands at a DOS prompt.  All you DOS/Windows old timers all ready know this.  The command to stop a service is:

NET STOP “Service Name”

And to start it up again… you guessed it…

NET START “Service Name”

Running this on a DOS prompt will return a message whether it was successful or not.

From our list of services above we can now make a batch file called ABStop.bat which contains the line

NET STOP “RSLinx Classic”

On the flip side is another batch file called ABStart.bat which has the command

NET START “RSLinx Classic”

The batch file can now be executed by double clicking on it, making it a shortcut or by putting it in our Start Up folder.

For the Siemens services there would be one file called SiemensStop.bat where each command gets put on a separate line.

NET STOP “Automation License Manager”
NET STOP “S7 Global Services”
NET STOP “SIMATIC IEPG Help Services”

I think you get the point now.

Windows Hardware Profiles

There is another way if you want to make it really obvious and automatic.  This is done by setting up different Windows hardware profiles.  It also gives you the ability to disable/enable certain devices on your computer.  Hardware profiles have actually been around since Windows 95.  More profiles can be added as you determine which services you don’t want to run.

 

Hardware profiles

The first steps involve setting up different hardware profiles.

  1. Open the Control Panel and double click on the System icon.  Another way to get there is to right click on My Computer and select Properties and then the Hardware tab.
  2. Under the Hardware tab, click Hardware Profiles.
  3. Under Available hardware profiles, click Profile 1 (Current), and then click Copy.
  4. Type a name for the new hardware profile like “Siemens Only”, and then click OK.
  5. Repeat Step 4 for “RSLogix Only” and “Wonderware Only”.

 

Disable Siemens serviceNow that we have our profiles we can enable and disable our chosen services based on these profiles.

  1. Open up the Control Panel and double click on the Administrative Tools icon
  2. Double click on the Service icon to bring up the list of services installed.  They may be running or not.
  3. Right click the Service and select Properties and the Log On tab.
  4. Select the Hardware Profile in the list and click the Disable button.  This makes sure that this particular service will not be running when you select to start Windows with this Hardware Profile.
  5. Go through each service and Enable or Disable according to the profile.

Now when Windows is started a DOS type screen will appear asking you to select the hardware profile to use.  Once this is done you should be able to go to the Service screen and verify that the service has not started.

 

Running a Virtual Machine

The concept behind a virtual machine is to have multiple operating systems running on one piece of hardware.  It is extremely useful for program developers who wish to test their application’s compatibility on several different platforms.  The switch can be done at a click of a mouse.

In this way it’s also helpful for the PLC programmer to have individual workspaces for each program so that they are not affected by the other.  It’s like having two computers just virtually.  It also allows for working in other older operating systems so that legacy software can still be used (as long as the hardware is supported).

One downside is that since the hardware is the same the RAM has to be divided between the different virtual machines.  If you don’t have enough memory then it can be a drain on resources.  A rule of thumb is to have double the amount of memory you think you’ll need.

 

Virtual PC VMware 

The leading front runners for virtual machine software are Microsoft’s Virtual PC and VMware’s Workstation.  Honestly I’ve never used this type of software but from the reviews and forum comments VMware has the most stable and usable software.  It’s tempting to try Virtual PC since it is now free but there have been some complaints about Siemens licensing and communications issues.  I haven’t seen anybody complaining about VMware.  A new version of Virtual PC is scheduled to come out with the release of Windows Vista.  So the battle will rage on to our benefit.

Conclusion

This article has discussed three ways to alleviate problems and boost performance.  First you identify the services associated with each program.  The quickest and easiest way to stop and start these services is with a batch file.  Another effective way is to create hardware profiles so that you’re automatically asked on Windows startup.  Finally, running a virtual machine like VMware is a popular option.  Not everybody has problems but if you do we hope one of these methods has solved the problem.  Let us know if it has as we’d love to have some real world examples.