09-15-2010 04:10 PM
I'm programmatically creating a task containing 9 voltage measurements and 10 thermocouple measurements. All of the thermocouples are Type T. I want to read one of the thermocouples down to 30 K. NI's lower limit for Type T is 73 K.
I understand that the way to read thermocouples lower than their NI-defined limit is to change the scale type to table using a DAQmx Channel property node. However, because I am taking different types of measurements, I need to isolate the particular thermocouple channel. If I pass the whole task to the DAQmx Channel property node and try to set the thermocouple scale type to table, I get an error because the voltage channels don't support that property. I can't seem to figure out how to pull the channels out of the task individually. I don't want to separate the measurements into two tasks, because then I will have to do extra programming to synchronize the clocks.
I have one more idea: Use a DAQmx Create Task VI at the start. Make a global virtual channel in MAX for the one thermocouple that I want to change the scale type for. Place a constant for that virtual channel and run it through the DAQmx Channel property. Use the DAQmx Create Task to create a task containing this global virtual channel. Pass this task to a bunch of DAQmx Create Virtual Channel VIs to add the other measurements to the task.
This hurts the scalability of my program and seems to be bad form in general. It seems like there should be a simpler way to do this. Any ideas? Thanks!
Solved! Go to Solution.
09-16-2010 05:36 PM - edited 09-16-2010 05:40 PM
Hello,
Try using the Active Channels (ActiveChans) Channel Property node i.e. specifying the "isolated" channel as its input, then adding the (AI.Themcpl.ScaleType) by expanding the same property node and setting its input. The Active Channels property node specifies a virtual channel or list of virtual channels to modify.The virtual channels are within the context of a specific task. NI-DAQmx configures all channels in the task if you do not set this property 😉
Best regards,
Ali M
Applications Engineer
National Instruments
09-16-2010 07:12 PM
Ali, could this be solved by creating a Custom Scale (tabled) in MAX and assign that custom scale to the desired channel when setting up the channel in LV?
09-17-2010 09:07 AM
Ali,
That sounds like exactly what I am looking for. I will give that a try today.
Do I call up the channel by its string name that I set when I created it?
Thanks!
09-17-2010 09:50 AM
Do I call up the channel by its string name that I set when I created it? Yes
Just as an aside I spill my secret tip for generating tasks. I very seldom use the Create task vi most of the time I can design the task in development and it rarely changes at run time so I prototype the task in MAX and save it there Since the task is defined and saved I just drop a task constant and select the task to run on my BD. I get several advantages-
1: the MAX import wizard handles all HW/ Driver conflicts at deployment so I "catch" all those little forgot to install NI-xxx bugs up front rather than during debug.
2: since the task is persisted in MAX I can interact with the hardware from MAX to debug hardware / wiring issues and I don't need to develop "debug code" as well as the app I generate
3:the MAX config.nce leaves a back-up copy on the deployment target that allows recovery to a good config if "someone" corrupts MAX.
All that said: in your case the scale you are using is dependant on cal info for a specific thermocouple. you do want to programatically determine which scale to apply that scale using the property node like so
09-17-2010 11:05 AM - edited 09-17-2010 11:07 AM
Assuming we do use Create Task, I am not following why the custom scale can't be added to the desired channel during setup as shown in my pic. What am I missing?

09-17-2010 11:48 AM
Broken Arrow,
Does that work or does it not? It looks OK to me.
09-17-2010 12:08 PM
@maxwellb wrote:
Broken Arrow,
Does that work or does it not? It looks OK to me.
Yes it works for me.
09-17-2010 01:25 PM
@broken Arrow wrote:
@maxwellb wrote:
Broken Arrow,
Does that work or does it not? It looks OK to me.
Yes it works for me.
I won't knock the solution if the OP likes it BUT, Assume the TC is replaced or re-calibrated. I'ld look up the scale name from a config file and apply that scale to avoid either changing the original scale (loss of historically relevent data) or re-building the app to use the new scale.
09-17-2010 01:38 PM - edited 09-17-2010 01:39 PM
@Jeff Bohrer wrote:
I won't knock the solution if the OP likes it BUT, .....
Jeff, my post was more for my own education - I didn't know why the topic centered on fixing the scale channel so far downstream, so what I meant was "why can't you do this?" but it came out <sarcasm> "why can't you do this?" </sarcasm>.
I always provide a setup screen so that the sensor, scale, and channel can be changed at startup. I would not use constants like my example shows.