11-10-2015 11:33 AM
Hi All,
I have a pinout on my DAQ board to control all my hardware. I would like it that if I change the pinout I don't have to trawl through my entire program changing references to Dev/a0 to Dev/a1 etc. Is there anyway of have a menu ring type constant whereby I can type define this thing and if I click "Device 1" then it will output whichever port I have specified in the congiruation?
Regards,
Craig
11-10-2015 11:51 AM
11-10-2015 01:10 PM - edited 11-10-2015 01:12 PM
Here is an example: on the left I define 3 sepperate channels ao0, ao1,ao2. To call their DAQmx channel parameters, I need the Visa resource name (on the right in the while loop). I wouldlike to have a type defined, enumerated style constant so I can just drop it down and choose for instance Scan Mirror (Y) and it then inputs for me the correct visa resource name.
I could just use a sub vi which subs in from a an enum, but that's not very clean I dont think.
Any advice welcome,
Craig
11-10-2015 01:10 PM - edited 11-10-2015 01:12 PM
11-10-2015 01:36 PM
11-10-2015 01:58 PM - edited 11-10-2015 02:00 PM
If you name your tasks appropriately you can use a Combo Box input for specific names. This has a string datatype, but when wired to your DAQmx task or channel input, it will coerce to the DAQmx type and find the task (or use the channel) with that name.
Ideally, you let the user pick from specific tasks or channels that the system recognizes instead of the above option. If you were to change a task name or hardware in the future, you would have to make sure to go back and update your combo boxes.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
11-10-2015 02:36 PM
http://digital.ni.com/public.nsf/allkb/46CC27C828DB4205862570920062C125
Unfortunately strings don't type define properly, this solution would have been perfect though.
11-10-2015 02:59 PM
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
11-10-2015 03:37 PM
If I want to add ports later and only update one control.
11-10-2015 05:31 PM
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'