Cancel
Showing results for 
Search instead for 
Did you mean: 

Bug: Crash when opening a table attribute with an observer

Gears Phenom Gears Phenom
Gears Phenom

Hello

 

This morning I have encounted a bug when using plant sim which caused it to crash when I opened a attribute of data type table which is being observed by a observer of that object.

 

After looking into it, I have noticed that the following can be done to reproduce the error but have managed to cause it through other methods as well.

 

  1. Create an object in the class library (tested with SingleProc and Line) with a table and a observer for that table (dose not have to contain any addidional code, just be set up)
  2. Place it into a frame and edit the table
  3. Hold Alt and drag it from the class library back onto the object and click yes to the dialog box to replace the object
  4. Open the object and then go to open the table and it will crash the program

I have found that it will only crash if the table is different from the table in the object you are using to replace it with, if they are the same then the program will work normally. It can be different in any way, have tested it with both formating and contents and both can crash the program.

 

Attached is a print screen of the crash window with the call stack and also the method that it refers to in the report. As you can see it has crashed on line 2 of the code which is the very last line and is empty.

 

Plant Sim Version: 12.2.1

 

JamesM

2 REPLIES

Re: Bug: Crash when opening a table attribute with an observer

Siemens Phenom Siemens Phenom
Siemens Phenom

I was able to reproduce the crash. I found the cause for the crash and fixed it. The next maintenance pack will include this bugfix.

 

Please note that an observer that observes a user-defined attribute of data type table (or list/stack/queue) is questionable. The observer will not observe the content of the table, but the table itself. So the obersver method will only be called when an entire table is assigned to the user-defined attribute, but not if you assign a value to a single cell of the table.

_________________________________________________________________
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.

Re: Bug: Crash when opening a table attribute with an observer

Gears Phenom Gears Phenom
Gears Phenom

Thank you for looking into this, depending on what I find to be the best approatch this might be a issue later on when using the item.

 

Yes, I did find that the ovserver did not trigger as much as I liked it to do so, and I could not observe the Changed sub attribute of the table, instead I have put in place a plausbility control for now which takes in the row and column so I know what has been edited (probaly a better way anyway as it tells me what has changed and not just that something has changed) and will look into other approtaches in a few days time.

 

JamesM