LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set thermocouple scale to table for one channel within task

Solved!
Go to solution

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!

0 Kudos
Message 1 of 12
(4,595 Views)
Solution
Accepted by maxwellb

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

Message 2 of 12
(4,571 Views)

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?

Richard






0 Kudos
Message 3 of 12
(4,560 Views)

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!

0 Kudos
Message 4 of 12
(4,544 Views)

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

 

24180i92D3EA8C84577C13


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 12
(4,539 Views)

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?

 

 

 

 

 

Richard






0 Kudos
Message 6 of 12
(4,527 Views)

Broken Arrow,

 

Does that work or does it not? It looks OK to me.

0 Kudos
Message 7 of 12
(4,519 Views)

@maxwellb wrote:

Broken Arrow,

 

Does that work or does it not? It looks OK to me.


Yes it works for me.

 

Richard






0 Kudos
Message 8 of 12
(4,513 Views)

 


@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.

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 9 of 12
(4,503 Views)

@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.

Richard






0 Kudos
Message 10 of 12
(4,495 Views)