Reading multiple channels in one task
Hi i am trying to read three voltage inputs in one task. I have configured the task and used generate code to get the example. But i am now getting the data from all three channels in one waveform, but i would like to work independantly on the three channels. What should i do.
Hi vamy,
If you read all channels with AI Read, it should return an array of waveforms (not just a single waveform). You can use "Index Array" to get the waveform from each individual channel, or use "Index Waveform Array", which is basically the same operation.
Dan
Similar Messages
-
I need to take a reading of 15 channels about once a second. I can read one value at a time using the monitor function on the read values.vi driver, but this takes forever to read all the channels.
I don't have this instrument but I took a look at the instrument driver and it appears that you can only configure one channel at a time to read from. You might want to take a look at the command set for this instrument and see if it allows for configuration of multiple channels. It could be that the instrument driver just doesn't have that built in.
J.R. Allen -
How to Read All Channels in one task in vc
I want to read 6 channals' datas in VC. Now I create 6 task, and read it sperately.
I know that it can read from one task, but how??
DAQmxCreateTask("",&task1);
DAQmxCreateTask("",&task2);
DAQmxCreateTask("",&task3);
DAQmxCreateTask("",&task4);
DAQmxCreateTask("",&task5);
DAQmxCreateTask("",&task6);
DAQmxCreateAIVoltageChan(task1,"Dev1/ai0","",DAQmx_Val_Cfg_Default,-5.0,5.0,DAQmx_Val_Volts,NULL);
DAQmxCreateAIVoltageChan(task2,"Dev1/ai1","",DAQmx_Val_Cfg_Default,-5.0,5.0,DAQmx_Val_Volts,NULL);
DAQmxCreateAIVoltageChan(task3,"Dev1/ai2","",DAQmx_Val_Cfg_Default,-5.0,5.0,DAQmx_Val_Volts,NULL);
DAQmxCreateAIVoltageChan(task4,"Dev1/ai3","",DAQmx_Val_Cfg_Default,-5.0,5.0,DAQmx_Val_Volts,NULL);
DAQmxCreateAIVoltageChan(task5,"Dev1/ai4","",DAQmx_Val_Cfg_Default,-5.0,5.0,DAQmx_Val_Volts,NULL);
DAQmxCreateAIVoltageChan(task6,"Dev1/ai5","",DAQmx_Val_Cfg_Default,-5.0,5.0,DAQmx_Val_Volts,NULL);
DAQmxCfgSampClkTiming(task1,"",1000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,N);
DAQmxCfgSampClkTiming(task2,"",1000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,N);
DAQmxCfgSampClkTiming(task3,"",1000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,N);
DAQmxCfgSampClkTiming(task4,"",1000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,N);
DAQmxCfgSampClkTiming(task5,"",1000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,N);
DAQmxCfgSampClkTiming(task6,"",1000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,N);
DAQmxStartTask(task1);
DAQmxStartTask(task2);
DAQmxStartTask(task3);
DAQmxStartTask(task4);
DAQmxStartTask(task5);
DAQmxStartTask(task6);
DAQmxReadAnalogF64(task1,-1,10.0,DAQmx_Val_GroupByChannel,OriginData1,N,&read1,NULL);
DAQmxReadAnalogF64(task2,-1,10.0,DAQmx_Val_GroupByChannel,OriginData2,N,&read2,NULL);
DAQmxReadAnalogF64(task3,-1,10.0,DAQmx_Val_GroupByChannel,OriginData3,N,&read3,NULL);
DAQmxReadAnalogF64(task4,-1,10.0,DAQmx_Val_GroupByChannel,OriginData4,N,&read4,NULL);
DAQmxReadAnalogF64(task5,-1,10.0,DAQmx_Val_GroupByChannel,OriginData5,N,&read5,NULL);
DAQmxReadAnalogF64(task6,-1,10.0,DAQmx_Val_GroupByChannel,OriginData6,N,&read6,NULL);
DAQmxStopTask(task1);
DAQmxStopTask(task2);
DAQmxStopTask(task3);
DAQmxStopTask(task4);
DAQmxStopTask(task5);
DAQmxStopTask(task6);
DAQmxClearTask(task1);
DAQmxClearTask(task2);
DAQmxClearTask(task3);
DAQmxClearTask(task4);
DAQmxClearTask(task5);
DAQmxClearTask(task6);
thank you!DAQmxCreateTask("",&task1);
DAQmxCreateAIVoltageChan(task1,"Dev1/ai0:ai5","",DAQmx_Val_Cfg_Default,-5.0,5.0,DAQmx_Val_Volts,NULL);
DAQmxStartTask(task1);
DAQmxReadAnalogNChanF64(task1,-1,10.0,DAQmx_Val_GroupByChannel,OriginData1,N,&read1,NULL);//This proto changes fo DAQmxNch1sample.... I do not have it in front of me
DAQmxStopTask(task1);
DAQmxClearTask(task1);
int32_t DAQReadNChan1Samp1DF64_130(uintptr_t taskID, double timeout, int32_t incomingStatus, Array1DDouble **data, LStrHandle extendedErrorInfo);// is the C version
Jeff -
Select multiple channels for one task - control and shift keys don't work
Hi,
Following advice from several other posts, I'm trying to select multiple physical channels from the dropdown list so that I can then use the "unflatten channel string" function later on. It looks like if I hold down either shift or cntrl I should be able to select multiple channels from the list, however, this doesn't work for me. I tried going into the "key navigations" property for the task channel control but it doesn't have any associations listed. Has anyone else come across this and found a fix? I have previously got around this by stating multiple channels with a colon (eg. ai1:3) but this doesn't work for the unflatten function.
Thanks,
Claire.
Solved!
Go to Solution.Thanks for your reply Dennis, I see what you mean, unfortunately that doesn't solve my problem so I'm missing something else. I've attached my VIs. I expected that the output from the unflattenstring block would be an array of either the channel references or the names I had given them, and that therefore the "array size" in the 4th pane would be "9" (equal to the number of channels). Instead the output is a an "unnamed task#(some number)" when I look at it with a probe. Perhaps I'm misunderstanding how the task naming works?
THanks,
Claire.
Attachments:
Analog SW Trigger_v3.vi 33 KB
Cont Acq&Graph Voltage-Analog SW Trigger_cfjv3.vi 64 KB -
Shunt Calibrate Multiple Channels in One Task - Error 201398
Having created a task with multiple AI Strain Gage channels (each set with same bridge properties and quarter bridge config.), I recieve an error when passing the task to the "DAQmx Perform Shunt Calibration (Strain).vi"
My VI works fine if only a single channel is contained in the task, but more than one channel causes the error. Do I have to loop through each channel manually?
The "possible reason(s)" varies depending on my approach, but often indicates the AI.Bridge.ShuntCal.GainAdjust being requested is "-Inf"You can start a new thread even if you have the same issue. What exactly you aregetting and show us the code for better understanding.
The best solution is the one you find it by yourself -
Multiple channels in one task with ch to ch config
Hi,
Normally the way I acquire sample from more than one channel on a cDAQ system is like this:
1, I create virtual channels for my AIs in MAX
2, in LabVIEW I use channel constants and merging them using comma as a separator (eg. with the concatenate string node).
3, the I configure the sample clock using the comma separted channels as an input
4, start the task
5, acquire samples
6, stop and clear the task
This worked just fine so far as I acquired samples from my cDAQ modules with the same speed and all of them were simple analog inputs. But I have to implement a strain gage measurement (NI 9237) now and I'd like to use the bridge offset nulling calibration VI to get rid of the offset I have. That complicates my structure.
It seems the VI I have created runs just fine but I am wondering if this is a legit solution as I used the sample clock twice. (the VI uses simulated channels for now)
Attached the VI (LV2012) and its block diagram image as well.
Please advise. Thanks!
i-
Attachments:
Strain_test.gif 14 KB
Strain_test.vi 36 KBI have failed to realize that the offset nulling VI has another input called "skip unsupported channels". This is false by default, but setting it true resolves the problem without changing my structure at all.
Well done, kudos to myself
Attachments:
Strain_test2.gif 8 KB -
Reading multiple channels for multiple graphs
Hey I am fairly new to Labview and am using it just temorarily. My project is to take in readings from a Gaussometer (X,Y, and Z axis) and graph them in read time. The Gaussometer outputs a DC Voltage equal to the gauss of the magnetic field. The X,Y,Z all come in on three differnet channels. Connected to a NI USB-6009
I know I can use the Express> DAQ Assistant, however that outputs "Data" and I was hoping to use this in an Array. So I used the DDT to Array to convert it to the Array format that I needed (thanks to the forums for the help there). My only problem is that I don't know how to do this with multiple channels at the same time. But I have possibly been going about this all wrong.
So I just wanted to know if I could get some help on how to read multiple channels and write to them to three different graphs in real time that would be of great help.Whether or not you use the Convert From Dynamic Data or the Split Signal, your data should be shown as soon as the DAQ Assistant returns. How you format the data is irrelevant. If the number of samples you request is greater than the sample rate, then it will take longer to acquire the data and there is nothing you can do about that except reduce the number of samples and acquire in a loop. You can append new data to old and display everything in a graph if you want.
-
Assigning Multiple channels to one Camapign
Hi Gurus.
We have a requirement for our business where the marketing user would like to assign multiple channels to a campaign. Is this possible.
Ex. Marketing dept creates a campaign would like to target all existing customer. Now they want to execute this campaign through, telephone, e-mail, etc.
My question is it possible and if so how can we assign multiple channel for one campaign execution.
Unfortunately this a urgent requirement and i need to come up with a solution by very quickly.
Your help ment awould be really appreciated.
Thanks
RaoHi Rao
it is pretty easy,just you have to define the communication channel for all the BPs which you want to use for your segmentation cause.
within those BPs go to the identification tab and therein you just mention all those communication channels details which you want to use for assigning the BP to target group
after you are done with it just assign target group and do the segmenation.
do revert back in case of any doubt
best regards
ashish -
Hello,
I recieve the appended error message when attempting to use DAQmx Read in my VI. LabVIEW is telling me that I am attempting to read a single channel when my task is configured for multiple channels. However, as you can see in the task configuration pane, that is not the case! If I attempt to use DAQmx Read to generate a waveform with multiple channels, the VI executes without error but I do not want a 1D waveform array.. Any tips?
Regards,
Steve
Solved!
Go to Solution.
Attachments:
multi_chan_errr.JPG 42 KB
channel_Vin.JPG 108 KBThis is exactly why I ALLWAYS hide my DAQ Tasks inside a "Resource Module"
As I use the term a "Resource Module" is a special case Action Engine tha exposes only that subset of functionality that a specific project needs to take on a given resource external to LabVIEW. And, it provides a single point of entry to access that resource by keeping private data private. Had you used the technique here you would have had one vi to look at. and, there likely would have been no "Reconfigure to add channel" method available to cause trouble.
Jeff -
Steps to create a VI to read multiple channels
This is the first time I've used LabView. I want to create a VI to be able to read viltages from multiple channels and output the value of each channel to individual numeric indicators in the VI. I know how to read a single channel and I've created a task in DAQmax with multiple channels but how would I put that into a VI that will do what I need.
Thanks,
AlbertAssuming you are using the DAQ Assistant and getting one sample per scan, then you just use the Split Signal and wire the outputs to your indicators.
Message Edited by Dennis Knutson on 04-30-2007 09:49 PM
Attachments:
Split Signals.PNG 4 KB -
How to use multiple channels with one remoteObject .
hi,
I have an application which is accessed through HPPS some
times , also it can be access on server with http service.
so I want to know how to configure config files or add
runtime channels which will support either channel depending on
the server it is accessed over.
Is there any one who can help me to solve this...i need it
soon.
thank you...Hi,
Please visit the URL below for details on adding channel sets
at runtime. Add multiple channels to the channel set so that the
fall back mechanism works.
http://livedocs.adobe.com/blazeds/1/blazeds_devguide/runtimeconfig_5.html#194376
Hope this helps. -
Two Counter channels in one task ID with DAQmx?
I am writing a program which will control the movement of a gimble on the X and Y axis with servo motors while recieving
position feed back from two encoders on those axis. I am using a 6251M series card's AO to control the movement
of the gimble, while running the encoders into a 6602 for position. When setting up my task ID in MAX I noticed I could add
both ctr0 and ctr1 to the task ID, but when I tried read the counters with that task I got an error in Labview and with the
test function in MAX saying I need to use a multichannel read. I can not find a multichannel read under the counter
section of my DAQmx read, and was wondering if this is even possible. I am used to programming with Traditional DAQ
and know you have to keep separate counter task ID's, but having bought an M series card and having to use DAQmx I
was wanting to know if I could combine them.
ThanksYou can have multiple channels in a single task, but those channels all
have to be of the same type. You can have analog inputs together
with other analog inputs, but cannot combine digital inputs/outputs,
analog outputs or counter tasks with that analog input task.
Once you pair only like tasks together then you shouldn't run into any more issues like this.
Best of luck,
Otis
Training and Certification
Product Support Engineer
National Instruments -
I have a DAQ Assistant configured to read 2 channels at the same
time. When I wire a graph indicator to the output, I see the 2
signals jumbled together. How do I split them up into seperate signals?
When I wire any type of indicator it is showing just one output of a single channel.
I want 2 indicators showing 2 different signals as expected from the 2 channels configured. How to do this?
I have tried using split signal but it end up showing only 1 output from 1 signal in both the indicators.
thanks in advance.
Solved!
Go to Solution.Yes you are right. I tried that but I did not get the result.
I just found the way. When we launch split signal, we should expand it (split signal icon) from above and not from below. It took me a while to figure out this.
thanks -
Hello
i want to read multiple CAN channels simultaneously,
and diaplay the data received from the channel.
i attached my vi
give me an idea how to do this
thanks
sk
I am using LabVIEW 7.1/ PCMCIA CAN series 2 h/w
Attachments:
files.zip 81 KBHi,
Did you actualy see the advanced channel api example shipping with the driver. perhaps this is something you can take as an example.
DirkW
Attachments:
Channel Monitor.vi 141 KB -
Simultaneously reading multiple channel types programatically
Hi, I'm completely new to using NI DAQ so please forgive me if this is trivial. I am need to be able to simultaneously read 5 analog lines and up to 20 digital lines of an M-series multifunction card completely programatically, i.e. with no involvement of MAX, LabView, etc. (it's going to be incorporated into a Matlab program and has to be as independent as possible). I simply want to write a piece of C code that reads these channels at 2KHz and stores the data for later analysis. Is this possible with the NI DAQ library? (and if not, why not?) From what I've read so far, for some reason it doesn't seem to be a supported function of the DAQ library. Any advice welcome. Many thanks
TomYour M series board is not supported by the old NI-DAQ driver. It can only be used with the newer DAQmx driver included with the board. and while you can't have true simultaneous analog acquisition you can synchronously acquire 5 analog channels 20 digital inputs. The DAQmx driver includes some C example programs. You can download the latest version of DAQmx by going to http://www.ni.com/support/.
If you're not going to use LabVIEW for the data acquisition, you shouldn't post to this message board. There is a dedicated Multifunction DAQ forum and Measurement Studio vot VC++ message board.
Maybe you are looking for
-
Photos - itouch accepts only 1 folder at a time
New itouch, has tons of storage space. I can install only one folder of pictures. If I try installing a second folder, the second folder will install but the first folder will automatically be removed. When I manually choose a photo folder to be inst
-
Images in the screen corrupted by some strange lines ...
Hi, I have many troubles concerning the display on my MacBookPro. Often, the image on the screen is corrupted by black lines and some strange colour patterns. When I use Tiger on the same machine everything is fine. I agree that with the version 10.5
-
Hi, I have started getting this error since a week now when I try to schedule a report or change a schedule of a report. An error occurred within the report server database. This may be due to a connection failure, timeout or low disk condition with
-
Cost center and cost element display through report painter/writer
Hi Can any one suggest me how to display both cost center and cost element in the output of a report painter. Presently --- I am able to display cost center and its cost elements in the same leading coloumn and its periodical values for 16 consecutiv
-
Mapping Cust Mast XML (Generated from MDM) to IDOC
Question: I am having trouble mapping the KNVI segment (repeating node) to the Cust Master (DEBMAS) idoc. MDM does not support nested repeatable records (qualified records) on their end. I have the KNVI records generated (serially) in MDM. I want t