VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable the delete button in the system definition file

Solved!
Go to solution

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 10
(5,224 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 10
(5,173 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 10
(5,164 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 10
(5,157 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 10
(5,086 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."
Message 6 of 10
(4,979 Views)

Hi again,

 

sorry for this late reply, I had a long working break.

 

So, I am now trying to add an extra page to my custom device with this manual (http://zone.ni.com/reference/en-XX/help/372846M-01/veristandmerge/adding_pages_after_creating_projec...).

There is a problem at point 2.7 with creating the GUID. If I open the Custom Device Template Tool, I can not change the access scope of the folder that contains the GUID Creator.vi to public, but the manual tells me to do this. Do I miss anything or am I doing something wrong? How did you solve this?

0 Kudos
Message 7 of 10
(4,499 Views)

The easiest way to get the GUID generator to your project is to copy the VI to your new project and disconnect the new copy from the original library. Then you can add it to your CD project and use it ...

 

btw I would use the NI VeriStand Custom Device Developer's Guide as a programming reference for the NIVS custom devices

CLA, CTA, CLED
0 Kudos
Message 8 of 10
(4,446 Views)

If I add the GUID VI, the whole library is copied but I can not see the GUID VI, because the access scope is private.

A password is necessary to make it public, so I can not change it...

I can not just disconnect this VI from the library. What am I doing wrong?

0 Kudos
Message 9 of 10
(4,436 Views)
Solution
Accepted by DanyDaniels

ok, doesn't work for locked library. So simply copy/paste VI block diagram to the new VI and save it. Et voilà, you have your own on-hand GUI Generator... or simply run it from the vi.lib

CLA, CTA, CLED
Message 10 of 10
(4,426 Views)