VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically configurable system definition file

Greetings! I'm trying to develop a LabVIEW application that will allow a user to configure a number of System Definition File parameters (not sure just how many at the moment). The end result will be a new Veristand project, but it starts from a standard System Definition File. I'm using the Veristand API VIs (I'm using 2014 versions of LabVIEW, Veristand, & TestStand) and I've got a pretty good handle on most of the functionality I need, but there's one that seems to be posing a particular problem: The XNET Database.

 

I want to be able to allow the user to select a given CAN database (.dbc) file and then programmaticallty import all the frames. Now, if it's a new project, I know I won't have to worry about deleting existing frames. I would, however, also like to be able to programmatically change the database in an existing project. From what I've been reading, it doesn't seem like this is possible. I already have code that will load and parse a given XNET database, but it's got nothing to do with a given VS project.

 

Does anyone have any ideas here?

 

Thanks in advance!

0 Kudos
Message 1 of 4
(4,899 Views)

You should be able to get the reference for the XNET Databases section of your system definition by using the Get Node Reference by GUID method. The GUID for this section should be in the XML of your system definition. From there you should be able to add the database. A similar process can be used to get the reference for the CAN section of your system definition to add a port and frames. 

Miles G.
National Instruments
Staff Applications Engineering Specialist
0 Kudos
Message 2 of 4
(4,877 Views)

Well, the only drawback to that approach that I can see is programmatically parsing/crawling the XML of the system definition file in order to find aforementioned GUID. I've not attempted to do that, but the other experiences I've had with LabVIEW and XML have not been pleasant. 

 

Thanks for the tip (love to hear any others you have about handling the XML parsing), I'll dig into it tomorrow.

0 Kudos
Message 3 of 4
(4,874 Views)

The GUID for constants in the system definition like the XNET Database section, or the CAN section should be consistent between system definitions. You should just be able to look at the XML manually in a program like Notepad++ and just find it once. That being said, DAQ channels, XNET Ports, and other things that you add to a system definition will change between sys defs.

Miles G.
National Instruments
Staff Applications Engineering Specialist
0 Kudos
Message 4 of 4
(4,856 Views)