LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

broken XControls

It's quite easy to get XControls to stop responding if one makes a mistake in code handling the xcontrol. After you place such a errorneous XControl to front panel, labview stops responding and must stopped by forcing the application to stop in Windows task list.

If the project was not saved just before the crash, this may brake the XControl itself so that at least I don't know how to repair it. I opened my XControl project after such crash and corrected the problem in the facade.

Several things went wrong however:

  • The properties I wrote were not a part of the Xcontrol anymore even thought the files were still there. This I fixed by creating new properties and saved the new files. Then I copied the old property files over the new ones. This is not very elegant way to repair the missing properties. Is there an easier way to do this?
  • For some reason the link from XControl Init to Xcontrol State typedef was broken. It seems as if the State does not belong to Xcontrol anymore. You cannot create a new state since Labview assumes that the State is always there. You cannot replace one of the typedef links in Init the correct State typedef since it is somehow "on forbidden area". It seems that NI has decided to restrict the ability to edit the Init which results in inability to repair it. How this can be repaired?
Now it's only a little bit of extra work to rewrite the whole xcontrol. But if the same thing would happen to much more complicated XControl, it would really be annoying.

I attactch my broken XControl project.

Message Edited by Tomi M on 11-09-2005 09:34 AM

--
Tomi Maila
Message 1 of 8
(4,764 Views)
It seems that I had two XControl projects open simultanously when the crash happened. Also this other one is totally meshed up. I just didn't try to fix it before the problem occurred, so it may help to understand the origin of the problem better. I wonder if crashing labview with an open project browser would mesh up the whole project. It seems that it's not enough to save your project all the time but one has to make backups of the files as well, since they get meshed up when labview stops responding and must be shut down.

Tomi
--
Tomi Maila
Message 2 of 8
(4,743 Views)
Hi Tomi,
Thanks for your feedback on XControls.
XControls are a different kind of beast unlike anything in LabVIEW. It is like calling a DLL from LabVIEW and hoping that it will not run into an infinte loop, because LabVIEW does not have any control over it once the DLL call has been made. However, you can prevent getting into hangs by saving the Facade VI with a break point. This will bring up the Facade VI's diagram once the XControl is dropped and allow you to debug the Facade and even reset it if anything goes wrong. You can also bring up the Facade VI's diagram by popping up on the XControl instance and selecting Advanced->Show Diagram. This will work provided you were successful in dropping the XControl in the first place.
 
Property, Method and Ability informations are stored along with the XControl. If LabVIEW is terminated before the XControl is saved, that information is lost. Unfortunately, the only way to bring the VIs back into the fold is by using the method you mentioned.
 
The typedef being broken in the Init.vi is most likely a bug. If you could list the steps that caused it to happen, we can investigate it better. However, you can repair the VI. LabVIEW locks all the controls that are part of the connector pane to prevent users from accidentally deleting them and thereby breaking the VI. You can unlock the controls by first drag selecting the controls and clicking on the (Group, Lock, ...) button on the toolbar (the last one with 2 circluar arrows tailing one another) and selecting Unlock. This will allow you to edit the controls. Replace the broken typedefs with the State typedef. Make sure that the new control is on the connector pane and its name is not changed. I have attached a new zipfile with that fix.
 
Hope this helps.
Thanks,
Ram Kudukoli,
LabVIEW R&D.
Message 3 of 8
(4,729 Views)
I don't know exactly the steps I took, but if and when the problem occurs again, I'll try to repeat it.

About the properties. I always saved all the individual files before I tried to place the XControl on a front panel. I understood that XControl file is automatically updated each time a new property is created and the files related to the property are saved. Otherwise it doesn't make sence that I can place the XControl on a front panel.  Still howerever the propertied get at least sometimes "removed" from the XControl.
--
Tomi Maila
Message 4 of 8
(4,721 Views)

Tomi,

Saving the VIs does not save the XControl. XControl is a separate file that manages all the VIs needed by the XControl. You can popup on the XControl and select "Save" to save it. Also, you can drop an XControl on a panel before saving any of its VIs, but it is always a good practice to save all the VIs & the XControl before dropping it on the front panel.

Thanks,
Ram Kudukoli,
LabVIEW R&D.

 

Message 5 of 8
(4,710 Views)
Is there any reason why XControl must be saved manually. It would be more intuitive if it would be automatically saved each time any of the files belonging to it is saved.
--
Tomi Maila
Message 6 of 8
(4,693 Views)
I still cannot get all the problems fixed with broken Xcontrol projects. The attached project (multichannel.zip) was broken as well. I opened each file in the project and fixed all the problems that LV complained about. There is a test.vi in the project which I used for testing purposes. Now each time I open test.vi LV starts searching for missing files even though these files are exactly in the locations where they are supposed to be. The funny thing is that labview doens't find these files. You can either manually browse for the files or ignore the files and the test.vi still runs correctly. When one runs test.vi, there is a OK button down right, which causes the green boolean indicator above the graph to switch on and off.

When on creates a zip build from the project (attached as multichannel_zip_build.zip ), extracts it, and then opens test.vi, LV start searching for XControl.xctl which was the old name for the "multichannel waveform graph.xctl" XControl. I renamed it using the project browser, but for some reason the it seems not to be correctly updated to the project.

Can somebody of the NI folks help me fixing these projects. This is really annoying new feature for labview that files get meshed up.
--
Tomi Maila
Download All
Message 7 of 8
(4,676 Views)

Tomi,

I have attached the fixed multichannel.zip.
I investigated it to be a bug with replacing an XControl with another XControl when property and invoke nodes exist for the old one.
I have filed a bug report on that. The workaround was to redrop the property & invoke nodes.

Thanks,
Ram Kudukoli,
LabVIEW R&D.
Message 8 of 8
(4,661 Views)