LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Create Virtual Channel-specify max, min values as lists? + Channel calibration with DAQmx functions?

Solved!
Go to solution

Hello, 

I'm using LabVIEW version 9.0f3 (32-bit) on a Windows XP computer in my university research lab.

I'm trying to expand functionality of a vi I was running previously using the DAQ Assistant which read data from 12 thermocouple channels using SCXI 1102 modules in an SCXI 1001 chassis. I had unique Channel Calibration data entered for each of these channels, and not all of the channels had the same maximum and minimum values. I am currently converting the VI to one based on an enum-case-structure inside a while loop, which amounts to a finite state machine to allow cooperative multitasking, such that the program can stop and restart the data collection tasks in order to handle other extremely short tasks such as switching the DC level of some analog output channels which control a solenoid valve and a DC motorized pump. When I tried doing this with the analog inputs entering via DAQ Assistant(s), it threw an error saying the analog output task could not run while other task(s) (the analog inputs) were running. I read some other post/answer here suggesting the way to handle this is by using the lower level DAQmx functions to do the analog input and output tasks. In the attached VI you can see my progress in this direction--although I haven't fixed all the errors so it won't run yet, if you only look in the lower left corner of the "DAQ" enum case of my main (big) case structure you can see the part I'm now inquiring about. I've started to wire up the two DAQmx Create Virtual Channel blocks, one for K-type Thermocouple Analog Inputs and the other for Voltage Analog Inputs. I have string lists that specify multiple physical channels and their associated virtual channel names I want to use for the Thermocouple Create Virtual Channel block, and I plan to do the same for the Voltage one. Now I have two questions:

 

1) Can I also specify the maximum value and minimum value inputs as lists, one value corresponding to each channel? If so, how? Nothing like that comes up when I right click->Create on the max or min input terminal.

2) The reason I thought (1) would be necessary is because the calibration data I collected has max and min values that are somewhat different for each of the channels I want to calibrate, and when I did channel calibration using the DAQ assistant it required that the max and min values for each channel exactly coincide with the max and min values in the calibration reference data for that channel. How do I do channel calibration with these low level DAQmx functions? Will the varying max/min values present an issue similar as described above for the DAQ Assistant method?

 

Best regards

0 Kudos
Message 1 of 4
(3,160 Views)
Solution
Accepted by BrianMendo

I'll answer the question I think you're asking... (I don't have DAQmx installed on this PC, otherwise I would attach a snippet)

 

The DAQmx Create Virtual Channel VI has a Task In and a Task Out in the top left and top right. You can add many channels to a task by wiring these VIs together. But it may help to first look at specifically what a Virtual Channel is anyway. Start here: http://zone.ni.com/reference/en-XX/help/370466AD-01/mxcncpts/chantasks/

 

and note the key phrase: "Virtual channels, or sometimes referred to generically as channels, are software entities that encapsulate the physical channel along with other channel specific information—range, terminal configuration, and custom scaling"

 

In practice this means that any physical channel that you specify as an input to the virtual channel will all inherit the same channel-specific settings (i.e. scale, range, terminal configuration, etc.). If each thermocouple has a different scale, then each thermocouple physical channel should be mapped 1:1 with a virtual channel using the scale specifically for that thermocouple:

 

1 thermocouple is calibrated and creates 1 unique scale. This thermocouple is connected to one physical channel. A virtual channel is created to encapsulate the physical channel, unique scale, etc. The single virtual channel is added to the overall DAQmx task

 

So if you put the 'Create Virtual Channel' in a for loop and pass in an array of scale names, min/max values, and physical channel names, while maintaining the task handle in a shift register then you can effectively create all the channels in a list like it sounds like you're asking for. 

Nathan Murphy
Message 2 of 4
(3,115 Views)

Well, you are working with a no-longer-supported Operating System, an almost-decade-old Version of LabVIEW, and are using the Dreaded DAQ Assistant, which is designed for Beginners to "show how easy LabVIEW is", how "you don't need to know anything about programming, or about LabVIEW", and other silly notions.

 

You need to learn a little about DAQmx, and also a little about LabVIEW.  There are excellent White Papers about the former, and numerous tutorials about the latter (see links at the beginning of this Forum).  I especially recommend "Learn 10 Functions in NI-DAQmx and Handle 80 Percent of your Data Acquisition Applications" (if you forget the URL, do a Web Search on "Learn 10 Functions" and it should pop right up).

 

Give it a try.  If you get stuck or need more help, try reading the other White Papers in the Learning DAQmx series, or come back to the Forums, post your code (very important, and posting the actual VIs is best), and describe your problem.

 

Bob Schor

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

@Bob_Schor wrote:

Well, you are working with a no-longer-supported Operating System, an almost-decade-old Version of LabVIEW, and are using the Dreaded DAQ Assistant, which is designed for Beginners to "show how easy LabVIEW is", how "you don't need to know anything about programming, or about LabVIEW", and other silly notions.

 

You need to learn a little about DAQmx, and also a little about LabVIEW.  There are excellent White Papers about the former, and numerous tutorials about the latter (see links at the beginning of this Forum).  I especially recommend "Learn 10 Functions in NI-DAQmx and Handle 80 Percent of your Data Acquisition Applications" (if you forget the URL, do a Web Search on "Learn 10 Functions" and it should pop right up).

 

Give it a try.  If you get stuck or need more help, try reading the other White Papers in the Learning DAQmx series, or come back to the Forums, post your code (very important, and posting the actual VIs is best), and describe your problem.

 

Bob Schor


Like I said in my original post and as evident in the DAQmx-based VI I attached, I am not currently using DAQ Assistant, rather I *was* using DAQ Assistant initially in order to size up the job I am dealing with and to get my feet wet so to speak. To be honest, if these message boards weren't available I would have read more of the papers and manuals available and probably would have figure it out on my own. If you think this isn't a fair use of the forums, that's fine, maybe I'll wait until I need less help before asking for help next time. But in recent years it seems I've often taken longer to finish things than necessary/compared to those who have asked for and used the help of others more readily than I have (because I naturally didn't like asking for help as opposed to reading and learning on my own), so I've been trying to ask for help more often and earlier in the process.

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