01-14-2019 01:33 PM
Hello, I have a frustrating issue involving the 3D Scatter function.
If I stop-start my VI exactly three times (for development) and invoke the plot in some conditional logic, I get this error:
"Aborting the Facade VI has left the XControl in an inconsistent state. To recover from here, right-click on the XControl and select Advanced->Update XControl. If the VI hosting the XControl is in run mode, then right-click and select Update XControl."
The front panel for the whole application breaks - I can't interact with it at all, and the only way to get back to normal is to force-quit LabVIEW altogether using Windows Task Manager. Following the instructions in the error yields nothing. I've also tried doing some things that could leave the VI in a consistent state - resetting to default, clean data, among others. I think I understand what the error is saying, but I'm not sure how else I can leave the XControl in a consistent state.
Does anyone have any ideas from developing their own XControls or running into this issue before?
Thanks!
Joe
01-15-2019 02:07 PM
Hey Joe,
Any chance you could post code for a simple case for this? What version of LabVIEW is this behavior occurring in?
01-15-2019 03:02 PM
If you create a new VI and drop another "3D Scatter plot on the front panel, do you have trouble there as well?
If so you may want to try a repair of LV.
If not try replacing the scatter plot on the VI where you are having trouble.
XControls are a special type of object that lives on the FP of VIs and runs while you are editing a VI. It has logic to save default values, init from file apply methods etc. It sounds like you found a way to push the XControl outside what the developer thought would happen.
Now to "start-stop"
Are you using the abort button to stop?
If so, "don't do that!". Use a control to stop your VI so that it can wind down gracefully.
Offering what I can...
Ben
01-16-2019 04:26 PM
Thank you both for your help.
Unfortunately I can't post my VI that has the issue - but I did make a sample VI with random scatter data, and it works without any problems. However, putting the sample in my application does break it.
I am performing a graceful shutdown using a control. I have tried replacing the graph itself.
Not sure if this is relevant, but I'm using an actor framework in my application. This graph is in the main actor.
Ben, I didn't know XControls run even when I'm editing the VI. I've probed everywhere in the control and can't find the source of the error.
Thanks
Joe
01-17-2019 07:53 AM
...
Ben, I didn't know XControls run even when I'm editing the VI. I've probed everywhere in the control and can't find the source of the error.
Thanks
Joe
Just to make you dangerous...
Drop an instance of the 3D scatter plot on a FP of a new VI and then look at the hierarchy (show VIs in VI.lib) and if you have "show full path in VI label" enabled, you can float of the XControl to learn where the XControl is located in VI.lib.
Since the XControl is running any time a VI that contains it is open, LV will look the XControl so you can not mess with it while it is running. But if you do not have any VI open that is using the XControl, you can dig into it.
With NO other VIS open find the XControl in LV.lib and open it. The "Façade" is the face of the XControl. The methods associated with the XControl are unique VIs that do whatever the methods should do.
So in theory ( I have not tried it many many years) you could set break points inside the Façade etc to see what it is doing.
There are VIs that take care of the transitions from running to stopped vise versa and saving defaults.
If you do want to learn more or investigate further I suggest you copy what you find in VI.lib to a safe place and don't mess with what you found in VI.lib.
Done making you dangerous,
Ben
01-17-2019 09:35 AM
Thanks Ben, being dangerous helped! (maybe?)
I traced down into the XControl, and the error is being thrown at
3D Scatter -> Display State Change Event -> 3D Plot Get Scene Data -> Get Plot Data -> Get Plot ID
right as it's being called. I'm not sure what actually presents the error message, is there some unseen force handling XControl runtime errors? I can't find any error handling logic anywhere.
Get Plot ID has two implementations (or more if I have other 3d plot types on my front panel) one for 3D Plot Datatype, and one for 3D Scatter Datatype - Neither VI has execution highlighted when the error occurs. Both VIs are really simple - just passing data through them, one accesses the index from the class - but again no error handling.
Since I only have one plot in this 3D scatter, my plot ID is always 0 - I tried hardcoding that and bypassing Get Plot ID altogether, but that didn't help anything - so I'm thinking its a bigger problem than getting an ID.
Hope this helps,
Joe