VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding Reflective Memory Channels useing VeriStand API

Solved!
Go to solution

I am trying to use VS API to add folders and channels to the Reflective Memory section of an existing system def file.  I can't seem to see the existing folders and channels or add new ones.  I have attached a code snipit and the code.  Please tell me what I am doing wrong and point me in the right direction.  I am new to the API programming and have been doing a lot of trial and error.

 

Thanks!!

Joshapi.png

0 Kudos
Message 1 of 5
(5,923 Views)

I think I got this working and wanted to post the results.  If there is a better way to do this please let me know.  I realize that I don't do a good job at closing the references, but this was just for proof of concept for me.

 

I can't seem to insert the PNG, so I attached it.

0 Kudos
Message 2 of 5
(5,915 Views)

Hi Josh,

 

I think you have the basic Idea.  It looks like there is a good bit of code that you can cut out and still run correctly.  Having lots of property nodes is pretty typical of using this API.  It is very similar to using scripting in LabVIEW.  There are lots and lots of layers to dig through, but that is one reason it is so powerful.

 

Cheers,

 

Ryan 

Applications Enigneer

Applications Engineer
National Instruments
0 Kudos
Message 3 of 5
(5,899 Views)
Solution
Accepted by topic author joshe

You can simplify this some:

  • Use dotted properties and methods where possible to collapse multiple calls into one node
  • Use searching and casting to navigate instead of making several get calls
  • Add the channels to the folder before you add the folder to the tree

api3.png

Stephen B
0 Kudos
Message 4 of 5
(5,883 Views)

Hi StephenB,

 

Thanks for the great suggestion and example. I had never heard of dotted properties, so I learned something new and useful.  I did try the find node and casting, but could not get it to work, but I will try it again based on your example ( I assume the .net ref is of the ReflectiveMemoryDataChannels type).  Thanks for the support, I really appreciate it!!!

 

-JoshE

0 Kudos
Message 5 of 5
(5,875 Views)