RSLogix 500 - Checksum Correlation - Under the Hood...
Ken Roach said:
...When you do the "Who Active Go Online" with RSLogix 500, the software checks the program in the controller to see if it matches the program you have open.
If it does not, it checks on your hard drive for programs with the same name and the same checksum. I'm not sure if it looks in the default directory, or in the last directory you had open, or in several other places.
The problem comes when you have an uploaded, without-comments version of the program that's currently in the PLC on your hard drive. Unless you very carefully make sure you are downloading a new program instead of "going online", you'll end up with RSLogix 500 pointed to the offline copy of the program it thinks matches most closely the program in the PLC.
This isn't based on specific knowledge of the under-the-hood operation, just my experience going "wait, no, that's not the right program !".
Ken,
We've all been there!
What is actually compared to what before going Online can be a little bit deceiving, or tricky. I'm sure many a user has scratched their heads thinking what on earth is going on here when they try to
Go Online? I just had it open? I just came Offline? I was Online a few minutes ago? Why is it not the right file any more? Why is it suddenly looking for some "other" file to be used?
The following hopefully offers a little more insight into this sometimes perplexing task...
Checksum & Co. - under the hood...
When a new program is created in RSLogix 500, it has no checksum, or to be more specific, it has a checksum of "0". The first
Verify Project of the program will generate a unique checksum for the
Offline Image of that program. The
Offline Image checksum reflects the contents of the Offline program's
Database. If an
Offline Edit is carried out, say adding a rung of logic, or adding a Data File, then the
Offline Image checksum is again temporarily set to "0". The next
Verify Project will again generate a new checksum value for the
Offline Image because of the modified contents of the program's
Database.
So, the
Offline Image has its own checksum.
The first time a new program is loaded into a controller, and goes Online, an
Online Image is automatically saved to the program file in RSLogix 500. This
Online Image is thus retained within the Offline copy of the program i.e. within the *.RSS file. This
Online Image reflects the contents of the controller's
Database.
The
Online Image also has its own checksum.
Why?
This is because
Online Edits are automatically saved to the
Online Image in the *.RSS file, as they are performed i.e. you do not have to explicitly save the program to update the
Online Image. If after performing
Online Edits, you do not save them to the Offline program, then the checksums for the
Online Image and the
Offline Image, within the same *.RSS file, will differ.
Say what?
So, even though you have opened a program, gone Online, performed
Online Edits, not saved, gone Offline, and closed the Offline program, the *.RSS file's
Online Image has changed. This is why it prompts you to save as you go Offline, as the two images are now different in the *.RSS file. If you choose to not save, the two images remain different. When you attempt to go back Online, you will get the
No Matching File Found prompt.
So, we now know that there is an
Offline Image, and an
Online Image, within the same *.RSS file, and both have their own checksums.
So how do you synchronize them again?
By doing a save while Online, usually as you are editing, by performing an Upload to a selected file and saving, or by performing a Download.
Another item, included in the the
Online Image, is the
Processor Name as stored in the controller.
Why is the
Processor Name needed in the
Online Image in the *.RSS file?
If you open RSLogix 500, but
do not open a program, and then attempt a
Who Active Go Online, RSLogix 500 will first read the
Processor Name from the live controller under the driver path you are attempting to
Go Online with. It will then look to a default project folder, if one is set, to try to find a suitable *.RSS file to go online with. The default folder can be set under
Tools>Options>System Preferences>Project Files Search Path.
If a folder is set, and their are *.RSS files present, then it will automatically look to the first *.RSS file alphabetically, and read the
Processor Name stored in the
Online Image within the *.RSS file. This is a rough pre-check as it only tries to match the first 8 characters of the
Processor Name. If satisfied with the
Processor Name, it moves on to trying to match the checksum between the
Offline Image, and the
Online Image, within the *.RSS file.
To be clear, the only check carried out between the live controller and RSLogix 500, before going Online, is the 8 character pre-check of the
Processor Name. The checksum correlation is entirely done Offline within the chosen *.RSS file.
Why Offline?
Why is the
Online Image in an Offline file to be trusted?
Because the
Online Image in an *.RSS file, that was the last file used while Online to the controller,
should always represent the latest
Database in the controller.
Ok, but what if I copy that up-to-date *.RSS file, saving it under a different name, or even in a different location, and then perform
Online Edits again with the original file and save?
Would this not create a scenario where both files have the same
Processor Name and both have a matching
Offline Image and
Online Image, but only one of them has an up-to-date
Online Image, correct for the controller's current
Database?
Surely an attempt to
Go Online with the copied *.RSS file, that did not perform the last
Online Edits would correlate and attempt to
Go Online, because the
Processor Names matched, and the
Offline Image and
Online Image also matched?
i.e. If the checksum correlation is always carried out in the Offline *.RSS file, then how does RSLogix 500 prevent the above from happening?
Another under-the-hood check is performed...
When you save a program, another piece of data saved to the images is the *.RSS
path/filename.
If you are Offline and save, only the
Offline Image is written to.
If you are Online and save, both the
Offline Image and the
Online Image are written to, synchronizing them.
If you have an *.RSS file that has it's
path/filename synchronized for both images, and then you save as another name, or even the same name in a different location, only the
Offline Image is written to in the new *.RSS file, leaving the two images now unsynchronized.
If you attempt to
Go Online with the copied file - Even though the
Processor Name,
Offline Image and
Online Image all pass the first two correlations, this file will fail the third check. To resynchronize this file's images, for
path/filename, you must perform an
Upload Use File and then save.
So now, and as per above, the original file can
Go Online as everything checks out, but now the copied file can also
Go Online, even though both files have either different names, and/or locations.
As I write this, I have two programs open and Online to the same MicroLogix 1400 controller. They are identical except they have different
path/filenames.
Ok, just to complete this picture...
If you open RSLogix 500, and you
do have an open a program, and then attempt to
Go Online, RSLogix 500 will first read the
Processor Name from the live controller under the driver path you are attempting to
Go Online with. It then checks if it roughly matches the
Processor Name in the
Online Image in the open *.RSS file. If this passes, it then checks the
path/filename and checksum both match for the
Offline Image and
Online Image in the *.RSS file. If they both correlate, it will then
Go Online.
If you open RSLogix 500, and
do not open a project, and then attempt a
Who Active Go Online, while there is no default folder set, or there is no existing file available anywhere that matches, then you must perform a
Create New File. This is where you will end up Online with a controller with no documentation displayed.
The checksum is viewable under
Controller Properties.
So what can change the checksum?
_Changing the processor name.
_Creating/deleting/modifying program files.
_Creating/deleting/modifying data files.
And what will not change the checksum?
_Modifying data table values.
_Editing documentation.
_Forcing, histogram, trends, etc.
Lesson for the day...
The controller does not care about anything to do with checksums, or filenames and paths, it only needs to see a matching first 8 characters for the
Processor Name in the *.RSS file's
Online Image. After that, it's all down to the correlation of the images within the *.RSS file.
Clear as mud?
Regards,
George