Contact and Coil | Nearly In Control

Nov/15

1

Offline Changes to a PLC Program

As a PLC programmer, you’ll often be asked to do a change to an existing system. If there’s a significant amount of functionality to be added, you generally get your changes ready “offline” and then do all the changes during a short window of time to minimize disruption to the production schedule.

If you’re using an Allen-Bradley PLC, the procedure is typically this:

  1. Get a copy of the latest program from the PLC (a.k.a. an “upload”)
  2. Make your changes to the offline copy, and write down every change you had to make
  3. Go online with the PLC and apply your changes as online changes

Step 3 is much safer than just taking your modified program and doing a “download”. That’s mainly because when you download, you’re not just downloading the program, but the memory state of the PLC as well. The PLC typically has to track things in memory (like recipe data, part tracking, data collection, sequence numbers, machine counters, etc.). If you do a download, you’re going to overwrite all those values with previous values, and that can cause a lot of problems. The other thing step 3 saves you from is simultaneous changes that were done online while you were busy making offline changes.

The only other option you have is upload-change-download, but you really have to shut the machine down for the duration to make sure that the internal state doesn’t change.

When I did a lot of Allen-Bradley programming, I didn’t question that. It’s just how it was. I remember visiting a plant one time for a service call, and the local maintenance person was a bit suspicious of what I was going to do (after all, I was a young kid who had never seen this machine before). He decided to quiz me a bit, and one of the things he asked was, “when you go online, do you download or upload?” I said “it depends,” but his answer was, “you never download.” I agreed that someone in a maintenance role should never need to do a download unless they’re replacing a CPU, or recovering from a corrupted PLC program.

Now that I mostly do Beckhoff TwinCAT 3 programming, I realized one of the benefits are that offline changes are a breeze. It’s due to the fact that TwinCAT 3 completely separates the program from the memory data. The program is stored in local files on your hard drive and compiled into a TMC file. The persistent data is stored in a different place on your hard drive.

When I want to do offline changes to a TwinCAT 3 project, here’s the procedure:

  1. Get a copy of the latest program
  2. Make your changes to the offline copy
  3. Copy changes back to the machine (keeping a backup, of course), rebuild, and activate configuration

This makes offline changes go a lot more smoothly, of course. I don’t have to copy and paste my changes in while online, so it takes less time and eliminates the possibility of a copy/paste error.

Since we also use Mercurial for version control, getting a copy of the latest program is a matter of pulling the latest from the source control, and copying it to the machine is a matter of pulling the offline changes to the machine. Any changes that were done in parallel can be merged with Mercurial’s built-in diff and merge utilities. (Note: I/O changes can’t be merged nicely, so if someone changed the I/O while you were doing your offline changes, you have to copy those changes in manually, but that’s rare and at least it tells you that it can’t merge them.)

This got me thinking that Allen-Bradley probably has a better way of doing offline changes that most of us just don’t know about. I know that you can do an upload without uploading the memory. However, it seems like it requires you to download both the program and data at the same time. I wonder if anyone out there knows how to do better offline changes to a ControlLogix. If so, I would be interested to know that.

· · · ·

10 comments

  • David · November 2, 2015 at 1:42 am

    I appreciate this post and I wish someone explained the difference between upload/download when I was a co-op student and shut down the factory for 2 hours. As a veteran now this is the first thing that I explain to inexperienced engineers. Also, I don’t think there is a better way to do a major change for an AB controller without downloading. UDTs are so useful however they are also not configurable without downloading or by creating new one and cleaning things up on a weekend. There should be a way but I don’t think there is.

  • Author comment by Scott Whitlock · November 2, 2015 at 8:00 am

    @David – great point about UDTs, you’ve always had to download to modify or add them. In fact, I’ve started to avoid using UDTs for general control stuff, and now I only use them for Recipe management and a couple rock-solid pieces of code that never change. I’m more likely to use Sta01_Dr01_Run (for Station 1, Drive 1, Run) than Sta01.Dr01.Run for exactly this reason. I can add and remove the former online, but adding a new bit to the latter is a real pain.

    TwinCAT 3 on the other hand – you can add/modify and remove structures (equivalent of a UDT) all day long and do it with an online change. It will sometimes warn you that it’s moving variables around in memory to do this, but it gives you a warning, and I just make sure to close and re-open the HMI when I apply the change (otherwise it might still be reading from the old address).

  • Mike Thiel · November 2, 2015 at 1:08 pm

    If you have Rockwell’s Data Preservation Download Tool it is possible to download new logic to a Control/CompactLogix processor without loosing any of the data.

    What is does is saves the current datatable into a local xml file. Then it downloads like normal. But before it puts the PLC back into run mode, it will reload the data from the xml file.

    It is far from perfect. If you change a UDT (add or remove a member) it will not reload any of the data for that variable, because it doesn’t match the structure saved in the xml.
    Plus there are some weird nuances to the program. Like you can only have the one instance of 5000 open that you want downloaded. The processor path has to already be established and set in the file.

    But what your are saying about the TwinCAT3 has me interested in checking out Beckhoff.

  • Author comment by Scott Whitlock · November 2, 2015 at 2:33 pm

    @MikeThiel – I didn’t know about that tool, so thanks very much. The problem with UDTs does limit its usefulness. As David said, modifying UDTs is one of the main reasons to do a download. Imagine adding a new field to your Recipe UDT and then having it not preserve the recipe data. Big problem.

    I find it weird that the tool can’t restore data inside an instance of a modified UDT. If you stored every field separately, it wouldn’t matter if you added or removed a member field.

  • Jeremy Choate · January 27, 2016 at 2:53 pm

    Regarding the hazards of misunderstanding upload and download:

    Many years ago, I was doing a project at Tropicana in Bradenton, FL. One of my colleagues made some offline changes to the PLC program, and not understanding that the program retains the tag values that were present during the last save, he chose to download his changes to the PLC on a running line.

    Once the download was complete, and he placed the processor back in Run Mode, the old tag values took effect and he dumped 25,000 gallons of orange juice on the plant floor.

    He was on a plane that afternoon.

  • Trusted Rockwell Automation Training For RSLogix500 · May 3, 2019 at 8:07 am

    […] turn each other on and off. When you are working on it, it is happening online. If you don’t know how to change the code, you need to go to the online bar and click on go […]

  • Bill Hillman · September 12, 2019 at 1:07 pm

    I know this is an old subject, but just be aware that with a GE PLC, you can make changes online or make changes offline, go online and download with the PLC in run. It also is a separate process to download data stored in the project variables. For a technician troubleshooting or programmer making changes, GE is soooo much easier to use. Plus the PLC and HMI devices can all be in one project, one software package that does everything. AB can be very powerful but is way behind in making life easier for the programmer.

  • Author comment by Scott Whitlock · September 12, 2019 at 1:34 pm

    @BillHillman – I’ve never used a GE PLC, so that’s very interesting. I’ve never seen anything like that.

  • mabosmail · March 13, 2020 at 10:55 am

    For anybody who like to play gambling and if you usually are
    looking for partners within gambling activities, Mabosbet is the right choice.

    Mabosbetransfer You can contact the customer care and make dealings with us.
    Mabosbet livechat is available 24 hours nonstop and is all set to serve you that help you online with betting.

    Mabosbet. com as the responsible gambling agent, we always provide an alternate
    link to mabosbet to ensure that members feel comfortable.

    You no longer require to have trouble finding an alternative
    Jababbet link with regard to access, it is currently available for you.

    All of us also always give concern to the safety of our members,
    very rigid protecting each of the privacy associated
    with members of Jababbet.

    Trustworthy Mabosbet From 2010

    With good praise, the support from the Headquarters will be no
    doubt. Friendly, quickly response, under 3
    moments.

    Mabosbet is highly valued by gambling bettors through Indonesia because whatever triumph you get will be accepted by mabosvip.
    We always want to provide typically the great for members with maximum service.
    The site mabosmail. com can also be very an easy
    task to access, as you only need internet access and alternative links mabosvip, no need to use proxies, news letters, or troublesome applications.

    That will is why many men and women join mabosbola and make deposits,
    then, win the match. The best plus quality alternative mabosbola option site.

    Come join mabosbet. com the trusted on-line gambling
    agent in Indonesia. Contact livechat mabosbet today in the lower proper corner
    to get a user ID. Welcome to the club.

    MABOSBET is a Trusted Online Gambling Site that has recently been established for more than 9 years with typically the
    most significant number of online gambling players.
    This gambling site also provides the most satisfactory online gambling
    game along with the most popular gambling providers in Indonesia.
    On the internet Gambling Games that may be played at MABOSBET are Sportsbook Soccer
    Wagering, Live Casino, On-line poker Credit card Gambling, Online Slot Wagering
    and Online Togel. Mabosbet itself has provided a variety of excellent facilities
    for internet gambling players in Indonesia which range from
    24-hour Live Chat Help, Bonuses with the least difficult conditions,
    additional wins for True Gambling Players.

    This specific MABOSBET Gambling Site also proves to become very reliable, while this Gambling Web site can also pay
    with regard to any winning player with no deductions.
    So you will play gambling comfortably and safely without fear
    of spending. In addition to a new definite win at MABOSBET, you
    will also supply additional bonuses to offer a different experience actively playing online gambling.

    JOBI BASKETBALL OFFICIAL SBOBET ONLINE IN INDONESIA
    Online Soccer Betting has become a very popular gambling online game inside Indonesia
    where every game has a market regarding betting. MABOSBET is now an official partner
    of SGD777 Indonesia, where more as compared to 7 years has provided football gambling games
    for betting players in Indonesia. This SBOBET Soccer Gambling Market
    allows a good where players will actually be provided
    a new live market from the established match directly.

    So you may be very lucky to be able to play SBOBET in this specific MABOSBET.

    RELIABLE ONLINE SLOT SITE SITE WITH MANY PROFITS
    Online slot gambling is currently popular in Dalam negri,
    where online slots are incredibly lucrative with huge jackpots and freespins that are usually straightforward to win. Because regarding that this MABOSBET very
    first provided Online Slot Online games from 2012 for
    betting players in Indonesia. Exactly where Jackpot
    is provided even more than USD $ one, 000, 000 for slot players who register from
    MABOSBET. The Slot Sport machine at MABOSBET does not
    just use your Equilibrium, the Slot Game has been built with the FREESPIN Bonus that comes out more often, so a person is going to
    be Fortunately.

  • mabosbet · March 20, 2020 at 1:45 am

    For anybody who like to play gambling and when you
    are looking for partners within gambling activities,
    Mabosbet is the right choice. Mabosbetransfer You can contact our customer support and
    make dealings with us. Mabosbet livechat is available 24 hrs nonstop
    and is prepared to serve you and help you online with
    gambling.

    Mabosbet. com as a new responsible gambling agent, we always provide an alternate link to mabosbet in order that members feel comfortable.
    You no longer require to have trouble getting an alternate
    Jababbet link for access, it is previously available for you.

    We also always give priority to the safety regarding our members, very rigid protecting each of
    the privacy of members of Jababbet.

    Trusted Mabosbet From 2010

    With good praise, the services from the Headquarters
    is usually no doubt. Friendly, fast response, under 3 mins.

    Mabosbet is highly valued by gambling bettors through Indonesia because
    whatever triumph you get will be accepted by mabosvip.
    We constantly want to provide the best for members with optimum service.
    The site mabosmail. com is additionally very straightforward to access, when you only want internet access and option links mabosvip, no need to use proxies, news letters, or troublesome applications.

    That will is why many folks join mabosbola and
    make deposits, then, win the particular match.
    The best and quality alternative mabosbola alternate site.

    Come join mabosbet. com the trusted online gambling agent in Dalam negri.
    Contact livechat mabosbet today in the lower correct corner to get the user ID.
    Welcome to be able to the club.

    MABOSBET is usually a Trusted Online Gambling Site that
    has recently been established for more than 9 years with the particular most significant amount of online wagering players.
    This gambling site also provides the most complete online gambling game together with
    the most popular gambling providers in Indonesia.
    On the internet Gambling Games that could be played at MABOSBET are Sportsbook Soccer
    Wagering, Live Casino, Online Poker Cards Gambling, Online Slot Betting and Online Togel.

    Mabosbet itself has provided many different excellent facilities
    for online gambling players in Indonesia starting from 24-hour Live Chat Support, Bonuses with the easiest conditions, additional wins with regard to True Gambling Players.

    This MABOSBET Gambling Site likewise proves to become very trustworthy, while this Gambling Internet site can also pay regarding any winning player without deductions.
    So you will certainly play gambling comfortably in addition to safely without
    anxiety about paying. In addition to the definite win at MABOSBET,
    you will also offer additional bonuses to offer a different experience enjoying
    online gambling.

    JOBI GOLF BALL OFFICIAL SBOBET ONLINE IN INDONESIA
    Online Soccer Betting has become a extremely popular gambling
    online game inside Indonesia where every sport has a market for betting.
    MABOSBET is becoming a great official partner of SBOBET
    Indonesia, where more as compared to 7 years has provided soccer gambling games for
    wagering players in Indonesia. This particular SBOBET Soccer Gambling
    Market allows a reasonable where players will actually be
    provided a live market from your recognized match directly.
    So you will certainly be very lucky in order to play SBOBET in this
    specific MABOSBET.

    RELIABLE ONLINE SLOT SITE SITE WITH MANY EARNINGS
    Online slot gambling is usually currently popular in Dalam
    negri, where online slots are incredibly successful with huge jackpots and freespins that are
    usually straightforward to win. Because of that this MABOSBET
    first provided Online Slot Games from 2012
    for betting players in Indonesia. Where Jackpot is provided
    even more than USD $ 1, 000, 000 for slot machine players who register in MABOSBET.
    The Slot Game machine at MABOSBET won’t just use your Balance,
    the Slot Game offers been designed with the FREESPIN Bonus that comes out more often, so a
    person will be Fortunately.

Leave a Reply

<<

>>

Theme Design by devolux.nh2.me