From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Additional NI Software Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Eric.M

Refresh the *.nivssdf Tree on Demand

Status: New

The VeriStand System Definition API allows you to edit a definition file. While it is mostly used as an offline API, it is also often used in custom devices code, notably thanks to the Item Reference to Pointer function that gives your access to the SystemStorage namespace, an internal representation of the SystemDefinitionAPI.

 

Unfortunately, there's a hiccup with that. If you want to edit existing nodes in your system definition, it works. If you want to add/remove nodes or sections (say, automatically add an alarm when you add a given custom device channel), the underlying API calls will work but you can't see the modifications in the System Definition tree: my alarm won't show up in the tree although it exists in memory. You'll have to manually save and reopen the *.nivssdf file for that. This can't be a decent workaround for end users.

 

Would NI R&D be nice enough to provide us with a public function that refreshes the tree (or parts of it if we feed the node reference)?

 

--Eric

 

Nb: I currently have a working solution, in case anyone urgently needs this feature.

 

Eric M. - Senior Software Engineer
Certified LabVIEW Architect - Certified LabVIEW Embedded Systems Developer - Certified LabWindows™/CVI Developer
Neosoft Technologies inc.

5 Comments
fra_sab
Member

Hi, 

I am trying to do the same thing (refresh the tree from a custom device after I added some node: alarms, folder, etc.). Could you explain me what is currently your solution?

 

Thank you,

Francesco

 

Joel-P
NI Employee (retired)

Hey Eric!

 

I got curious about this and started digging a bit.

 

My first thought was to try the Commit System Explorer Update Buffer.VI in the Custom Device API >> System Explorer Functions, but I'm not sure if that only applies to updates to the system definition within a custom device.

 

Have you tried using the UpdateLayout method from NationalInstruments.VeriStand.SystemStorageUI >> SystemDefinitionBrowser

 

I was motivated enough to browse through a bunch of the .NET classes and methods, but.... not quite motivated enough to rebuild your code to create an alarm from a custom device. If you attached the source for an example custom device I could give some other ideas a shot.

 

Cheers,

Joel

fra_sab
Member

Hi Joel,

 

I built an example Custom Device that creates an alias folder (download link: https://1drv.ms/f/s!AiF-hb7CJ_E-gadIbSEj4iurI1lDdA). 

 

Thanks,

Francesco

 

 

 

fra_sab
Member

Excuse me, there is a mistake in the previous link. Correct link: DOWLOAD

 

Eric.M
Active Participant

Hey Joel!

 

Update Buffer only applies to the owning custom device.

I think the other internal class you're referring to is an underlying interface class for the TreeBrowserWF and NodeBrowserWF. By looking at the properties/methods, it looks like it inherits from one of the .NET visual components so it does not makes sense to call into this class from the block diagram.

 

In the sysdef, the tree is a real LabVIEW tree so I somehow find a way to interact with it from my custom device. That's how I force it to refresh for now. Super ugly but does the trick.

 

@Francesco : I can send the "utility VI" to you in private.

Eric M. - Senior Software Engineer
Certified LabVIEW Architect - Certified LabVIEW Embedded Systems Developer - Certified LabWindows™/CVI Developer
Neosoft Technologies inc.