VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

What are the options to programmaticaly create new hardware I/Os channels?

Solved!
Go to solution

I have seen a post that uses custom channels for possibly doing what I want to do. I was wondering of the other available options, for non-custom devices? 

 

I have a set of AIs, AOs,DIs, and DOs. Instead of entering them manually, I simply want to do it programmatically. It is ok if I have to deal with the different type separately (AI, AO...).

Which API to use for doing this? 

Thx.

L.

0 Kudos
Message 1 of 7
(5,875 Views)
Solution
Accepted by topic author LDBM

Replying to myself....Smiley Very Happy

 

it looks like there is one option using a variation on the example: NI Veristand>API>System Definition API>Support>Create a SDF File with user Channels.vi .

Will post after actually trying.

 

If you know of other options, I am still interested in hearing about them.

Thx.

L.

0 Kudos
Message 2 of 7
(5,861 Views)

Ok it seems to work, but there is some digging to do into the .net API...

 

systemdefinition>Root>GetTargets>Target>GetHardware>GetChassisList>GetDAQ>GetDeviceList>GetAnalogInputSection>AddAnalogInput. Then pass to this later method the DAQAnalogInput contructor ref out. Smiley Surprised

 

L.

 

Any better way? 

0 Kudos
Message 3 of 7
(5,852 Views)

Hey L,

 

When you say you want to programmatically enter a set of channels, I agree that custom channels are likely the most modular way to do it. You could also write VIs in LabVIEW to set up these channels, then import these VIs into VeriStand. However, this process also complex, and does not afford you the flexibility custom channels do.

 

I hope this helps. Please let us know if you have any other questions.

 

~kgarrett

 

District Sales Engineer
0 Kudos
Message 4 of 7
(5,837 Views)

The thing though is that I do not use at this point a custom device. I just want to upload programmatically a long list of I/Os channels into the sysdef file. With some reasonnable restrictions, I can do this using the API in a acceptable way as described in the prtevious post. We just don't want to type in 100's  of channels by hand...

L.

0 Kudos
Message 5 of 7
(5,834 Views)
yeah a custom device is not what you're looking for. The system definition API you found in that example and what you are doing with it right now is exactly right. Nice work 🙂
Stephen B
0 Kudos
Message 6 of 7
(5,829 Views)

Great. Just to be complete, with the DIO there is one more layer before adding a channel. One has to use the DAQDIOPort constructor before doing the channels. but it is all the same.

L.

0 Kudos
Message 7 of 7
(5,826 Views)