06-16-2015 02:57 PM
I am creating system definitions programmatically using the System Definition API. The only thing I cannot figure out how to do is add CAN channels from a linked database. For example, I want to add channels under the Incoming/Single-Point section. I've discovered that in the .NET API I can add a SignalBasedFrame object to the SinglePoint section, but here I need to specify the frame ID, payload length, signal names, etc.
Is there a way to pull this information automatically from the database file?
Any help is greatly appreciated.
Solved! Go to Solution.
06-17-2015 09:00 AM
Hey aweiss47,
There is a VeriStand help file which you will probably find useful for that:
http://zone.ni.com/reference/en-XX/help/372846G-01/vsnetapis/lv_sysdef_creating/
There is an XNET Databases class in the System Definition API which should allow you to add one programmatically to the System Definition of your project!
06-17-2015 11:33 AM
Hi Siana,
Thanks for your response.
I had come across that link before, but It looks to me like I need to manually enter fame info that is already contained in the database (specifically Part 2, Step 6 in the help file).
Is there a way to get, say, a list of all frames contained in the database file, similar to the "Import NI-XNET Frames" dialog in VeriStand?
In the simplest case I want to add every single incoming frame from the linked database.
Thanks,
Adam
06-18-2015 04:22 PM
Hi Adam,
I'm fairly certain there is a property of the XNET Database that would either allow you to access its frames directly or access the XNET Clusters containing the frames. This forum post might be helpful in that regard:
http://forums.ni.com/t5/NI-VeriStand/adding-xnet-can-channels-using-veristand-api/td-p/2308006
06-18-2015 07:12 PM
So in a very basic form, this would get you all the frames in an XNET database, part of the Measurment I/O pallete
06-23-2015 12:19 PM
Hello,
Thanks for the replies. This is exactly what I needed.
One last question:
How do I create the XNET Database object from either the Database .NET Object, or from the database file path? I know I can create a control and manually select the database but I need to do this programmatically.
06-23-2015 12:24 PM
There is a vi called "XNET Database Get List" that will return the names and associated db files of all the configured XNET databases, it's located in the same palette and there are VIs to create/delete XNET dbs as well.
06-23-2015 03:49 PM
The problem is this VI returns strings and paths, but I need the XNET Database object to feed to the property node and I don't see anything else in the XNET palette that will create this.
Any ideas?
06-23-2015 04:07 PM
The strings it returns are the XNET db alias names, with LabVIEW IO (XNET objects, DAQ tasks, etc) you can generally provide the input as a string and it should still work.
Alternatively you could type cast the alias name as an XNET db object and that would give you the strict type so that property or method nodes you might wire up will adjust to the type wired. Either way should work fine though.