NI VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Disable the delete button in the system definition file

Hi there,

 

I have started programming in LabVIEW about 3 months ago, so I am pretty new to that.

For now I am programming on a custom device and in this program I am adding sections and channels to this custom device in the system definition file. This works fine, but I can delete this sections and channels with the delete button and this is the problem.

 

Is it possible to disable the delete button in the system definition file and how does this work?

0 Kudos
Message 1 of 6
(657 Views)

So there's a few things you could try here.

 

In the LabVIEW, VeriStand System Explorer Pallete (NI VeriStand -> Custom Device API -> System Explorer functions), there are two VIs, Disable Dynamic Buttons and Enable Dynamic Buttons, which might do what you want though I don't know for sure as I have never used them myself.  However, these may only work for custom buttons not standard built in ones such as the Delete button.

Capture.JPG

 

Perhaps a better alternative though is the  <DeleteProtection> custom device XML tag described here:

http://zone.ni.com/reference/en-XX/help/372846L-01/veristandmerge/cd_xml_tags/

 

 I don't believe there is a way to set this using the VeriStand LabVIEW VIs, it would have to be manually added to the custom device XML file.  the embedded data logger that ships with VeriStand uses this tag in several places so you could look at its custom device XML to see how it is used.

 



I saw my father do some work on a car once as a kid and I asked him "How did you know how to do that?" He responded "I didn't, I had to figure it out."
0 Kudos
Message 2 of 6
(606 Views)

Hi,

 

the Enable/Disable Dynamic Button is, how you said, not the solution for my problem, because it is only for customized buttons.

The <DeleteProtection> tag is very useful, but when I tried it, only the Custom Device was protected from deleting. I could still delete

the sections and paths.

 

I have found an alternative solution, even though this is not a very good solution. I modified the RT Driver Main.vi, that the sections and channels are checked, when deploying. If they exist, deploy, if not then stop deploying and give the user a message. This works fine, but how I said, there is a better solution.

 

If you think there is a better way to solve the problem, please give me feedback.

 

I still thank you for your help!

0 Kudos
Message 3 of 6
(597 Views)

To add this tag to channel/section, you would need to create a new page in the custom device XML and add the <DeleteProtection> tag to it.

 

Then when you create your channels/section using the create channel/section VI, use this custom page's GUID rather than the default.



I saw my father do some work on a car once as a kid and I asked him "How did you know how to do that?" He responded "I didn't, I had to figure it out."
0 Kudos
Message 4 of 6
(590 Views)

Hi again,

 

I have found a good example with ActionVIs where the pages are written in the xml file. I think it is the same principe as the <DeleteProtection>.

 

The thing is I do not know how many pages I need because the sections and channels are created dynamically when pressing a button.

I can not write this pages in the xml file because I do not know how many pages I need.

 

To add this on runtime to the xml file is not possible because I can not just recompile my project during runtime.

 

So I think this is not possible or am I wrong with this?

0 Kudos
Message 5 of 6
(519 Views)

You should still be able to use that tag even with the dynamic page creation.  The custom device XML is more like a template of pages.  So if you wanted to dynamically create "N" copies of "Page A", you still could.

 

For example you could add you custom device in the system explorer and on the main page have a button and a numeric control which would dynamically add new pages to the custom device tree when the button was pressed.

 

All you would do is use a for loop to call the Create Section and Create Channel VIs X number of times.

 

I attached a custom device which demonstrates this, it's 2017



I saw my father do some work on a car once as a kid and I asked him "How did you know how to do that?" He responded "I didn't, I had to figure it out."
0 Kudos
Message 6 of 6
(412 Views)