VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Modify "HDW Serial" property of Sys Def Programmatically

Solved!
Go to solution

Does anyone know of a way to programmatically modify the "HDW Serial" property of a device in VeriStand, such as a DAQ card?  This property is not available as a part of the .net System Definition API as far as I can tell.

 

api.jpgsdf.jpg



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 1 of 7
(3,021 Views)

You can try getting the base node type of that reference and then accessing specific properties by name. I haven't tested this code out, but you can try something similar to the following:

base node property.JPG

You'll just need to select the BaseNodeType from the drop down in your screenshot and then wire that into an invoke node with the GetStringProperty method.

0 Kudos
Message 2 of 7
(2,990 Views)

The only thing is I need to be able to set that value not read it.  I have a fix in the form of using the XML document API in LV to parse the sys def file and it works but it could be cleaner.  

 

Perhaps though since that property probably isn't supposed to be manually modified, the parsing route is the only way.



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 3 of 7
(2,988 Views)
Solution
Accepted by topic author blackburnite

I believe SetStringProperty is also a method which may allow you that functionality. If not, the XML workaround is probably the best option for you.

Message 4 of 7
(2,983 Views)

Ah yes, I don't know how I missed that, I'll check that out.



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 5 of 7
(2,961 Views)

A follow up question if you don't mind, the HDW serial property, that is auto populated by VS when you add a DAQ device.  I'm assuming that serial corresponds to the "Device Serial Number" property available in the DAQmx API?



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 6 of 7
(2,958 Views)

You're absolutely correct! By default, the HDW serial property will be populated with the serial number of your device. You can verify this by checking the result of the GetStringProperty call against the serial number of the device. 

0 Kudos
Message 7 of 7
(2,948 Views)