10-25-2011 07:10 PM - edited 10-25-2011 07:11 PM
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.
Solved! Go to Solution.
10-26-2011 11:03 AM
Replying to myself....
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.
10-26-2011 01:47 PM - edited 10-26-2011 01:48 PM
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.
L.
Any better way?
10-26-2011 06:44 PM
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
10-26-2011 07:01 PM
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.
10-26-2011 07:56 PM
10-26-2011 08:19 PM - edited 10-26-2011 08:20 PM
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.