LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Programmatically Set Scale on DAQmx Channel? Possible LabView Bug?

Hi folks.  I have researched this question here on the forums and think I know what I need to do, but it doesn't work.

 

What I'm Trying to Do

I am creating a DAQmx Analog Out task that will write to a dozen channels.  I would like to set the scale on each of those channels to one of a handful of custom scales that I've already defined in my project.  From reading various posts on this forum, it sounds like I want to pull each channel out of the task using the DAQmx Task property node, then set each scale by writing to the AO.CustomScaleName property within the DAQmx Channel property node.  See the attached screenshots and VI file.

 

The Problem

I keep getting error 200378 "Custom scale specified does not exist".  The custom scale definitely exists in the project, but the VI won't recognize it.  It sounds similar to the bug described in this thread:  http://forums.ni.com/t5/LabVIEW/Why-do-I-receive-Error-200378-quot-Custom-scale-specified-does/td-p/...  However, I've tried the various workarounds mentioned in that thread (opening VI outside of project, then from within project, etc) and I don't get any different results.  I'm running LV 8.6.1

 

Questions

Does this VI work for anyone else once you've defined a custom scale with the same name as the one in the VI?

Am I doing something obviously wrong?

Is there a better way to do this?

 

Thanks for any advice, it is much appreciated.  I've attached screenshots of both the VI and the Project window showing the custom scale exists, and I've attached the VI itself.

0 Kudos
Message 1 of 3
(4,527 Views)

I found that this is a reported bug and is slated to be fixed in future versions of DAQmx, but I did find a good work around that will hopefully get you going. You can create the custom scale in MAX, instead of the project and use the custom scale you create in MAX. That seems to do what you are wanting to do.

National Instruments
Applications Engineer
0 Kudos
Message 2 of 3
(4,487 Views)

This workaround isn't exactly what you are trying to do, but I have made a set of VI's that will let you open up the DAQmx Assistants from LabVIEW code programmatically.

 

Programmatically Call NI DAQmx Assistants

 

You can call the VI to edit a channel and manually reassign the scale if you want to avoid going straight to MAX.

0 Kudos
Message 3 of 3
(4,403 Views)