News:

  • May 29, 2026, 03:33:23 PM

Login with username, password and session length

Author Topic: Differences in Disk and PLC programs message.  (Read 53880 times)

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3826
    • Host Engineering
Re: Differences in Disk and PLC programs message.
« Reply #15 on: January 23, 2013, 08:06:37 AM »
Yes, that's the symptom I have seen.  It's a strange bug because it doesn't happen all the time, but it does happen frequently.  We will look at it for 1.1.  :-[

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Differences in Disk and PLC programs message.
« Reply #16 on: January 23, 2013, 08:20:51 AM »
I will continue to monitor the order in which I do things to see if I can find a common denominator.

Side note that may help: I use NOP's frequently in my program to help break things up and for use as reminders of ttd. I also have a couple places where I have code beyond END's to store some code that I may or may not need.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Differences in Disk and PLC programs message.
« Reply #17 on: January 23, 2013, 12:07:39 PM »
The only time I've seen it is when I switched computers. If it makes any difference, I only use the USB link for programming.

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Differences in Disk and PLC programs message.
« Reply #18 on: January 23, 2013, 12:28:00 PM »
The only time I've seen it is when I switched computers. If it makes any difference, I only use the USB link for programming.

I am only using one computer, and all my programming is over ethernet (hardwired). The PLC is on a static IP, but my computer is assigned by DHCP.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Differences in Disk and PLC programs message.
« Reply #19 on: January 24, 2013, 06:05:46 AM »
Yesterday I clicked Save to PLC, and then save to disk and shut down the system as before, but this morning I didn't get the warning when I connected to the system. The only thing I did different is I saved to PLC before saving to disk.

ATU got me thinking about IP's, so I am going to record the IP that I was assigned so I can see if it makes a difference if the server gives me a different one.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

plcnut

  • Hero Member
  • *****
  • Posts: 814
    • premiersi.com
Re: Differences in Disk and PLC programs message.
« Reply #20 on: January 25, 2013, 05:28:01 AM »
Computer IP makes no difference.
Circumstances don't determine who we are, they only reveal it.

~Jason Wolthuis
Premier Systems Integration, LLC
http://premiersi.com

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3826
    • Host Engineering
Re: Differences in Disk and PLC programs message.
« Reply #21 on: January 25, 2013, 04:11:14 PM »
We figured it out.  When creating certain instructions offline, these special instructions require an arbitrary unique resource.  For device instructions (e.g. STREAMOUT, EMAIL, CTRIO...), it is a unique "instruction id" so that a device can be tied to a specific instruction whenever it becomes "busy".  Similarly, edge triggered instructions are allocated an "edge bit" to maintain the previous-scan's power flow (in order to detect any leading edge conditions).

Anyway, these various IDs are assigned at DOWNLOAD time, but are maintained ON DISK.  However, if you Save To Disk, THEN Write To PLC (and assign these IDs THEN), the Disk version will not have these "new" IDs.  Not only that, but the "Write to Disk" toolbar button was never being re-enabled because of the tweaking of the program at download time.

Note that once an instruction's edge bit or instruction id is assigned and saved to disk, it stays with it FOREVER (until the instruction is deleted or modified).  This helps for proper runtime edit behavior.

So, the problem occurs because the disk has UNASSIGNED Instruction/Edge IDs, but the PLC has ASSIGNED Instruction/Edge IDs.  Even though these parameters are "invisible" to the user, they get flagged as being different, but when you do the user-level comparison, they match.  Doh!

Here's how we fixed it:

1. If ANY Instruction IDs or Edge IDs are assigned at download time, we flag the PROGRAM as being MODIFIED, so that the Write to Disk button will be enabled (if it wasn't already)

2. If BEFORE you started your download, the CURRENT PROJECT MATCHED what was on disk (i.e. the Write to Disk button was DISABLED), but then AFTER DOWNLOADING, one of these ID's got assigned, then we will log an event to the Output Window that
Program modified - new Edge/Instruction IDs assigned at download

I know this is clear as mud, but it's some of the special handling that is done by Designer that wasn't properly propogated back to the user level.  This special ID handling will ONLY occur if a NEW EDGE/DEVICE instruction was added or if you MODIFIED AN EXISTING EDGE/DEVICE instruction (this is technically a "new instance" of that operation).  Any other instruction will not cause this to occur (e.g. non-edge contacts, coils, MATH), basically anything without an edge or without a device.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3607
  • Darth Ladder
Re: Differences in Disk and PLC programs message.
« Reply #22 on: January 25, 2013, 05:40:48 PM »
Good sleuthing!
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.