How do I acquire multiple channels with NIDAQmxBase?

Sorry for the double post, I just thought my previous message subject looked more like a tutorial rather than a question.
My question is the same, I am looking to acquire more than 2 channels worth of data using C++ and NIDAQmxBase. I have tried initializing with and without the timer. Without the timer I will get an actual response, with it the program stalls. I don't know if I am splitting up the data correctly...not sure how the DAQmx_Val_GroupByChannel works or whether I should use GroupByScanNumber.
Here's my code (snippets from my prog):
char Dev1_joint1_channels[] = "Dev1/ai0:1";
char Dev1_joint2_channels[] = "Dev1/ai2:3";//the only reason I split this is to test with and without
//buffersize is 500
uInt64 samplesPerChan = bufferSize/4;
// Data read parameters
float64 data[bufferSize];
int32 pointsToRead = bufferSize;
/---------Initialize the task--------------------/
DAQmxErrChk (DAQmxBaseCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxBaseCreateAIVoltageChan(taskHandle,Dev1_joint1_channels,"",DAQmx_Val_Diff,min,max,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxBaseCreateAIVoltageChan(taskHandle3,Dev1_joint2_channels,"",DAQmx_Val_Diff,min,max,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxBaseStartTask(taskHandle));
WHILE LOOP
/---------Acquire data--------------------------/
DAQmxErrChk (DAQmxBaseReadAnalogF64(taskHandle,pointsToRead,timeout,DAQmx_Val_GroupByChannel,data,samplesPerChan,&pointsRead,NULL));
/---------Assign to variables after averaging---/
joint1_chanA = arrayAverage(data,0,pointsToRead/4);
joint1_chanB = arrayAverage(data,pointsToRead/4,pointsToRead/4);
joint2_chanA = arrayAverage(data,pointsToRead/2,pointsToRead/4);
joint2_chanB = arrayAverage(data,pointsToRead*3/4,pointsToRead/4);
}//END WHILE LOOP
This works perfectly for just 2 channels, without even using the timer. I tried to stick the timer in, but the acquisition would not even go at that point. With 2 channels, I simply average the first half of data and assign it to the appropriate variable and then do the same for the second half. This works very well for just 2 channels, it's when i get into 4 channels that the data is messy.
Help is appreciated!
Thank you!
Nathan
[email protected]

>I tried to stick the timer in, but the acquisition would not even go at that point.
What timer? There's no timer in your code. Since putting in the timer makes it stop, that would seem to be the problem, and you're going to have to show it to us.
A quick and not-very-careful read of your code seems to be OK, assuming the variables whose definitions and initialization you have left out are OK.
>not sure how the DAQmx_Val_GroupByChannel works or whether I should use GroupByScanNumber
The way you're doing the averaging requires DAQmx_Val_GroupByChannel.
John Weeks
WaveMetrics, Inc.
Phone (503) 620-3001
Fax (503) 620-6754
www.wavemetrics.com

Similar Messages

  • How do set up multiple devices with multiple graphs in labview

    Hello,
    I am new at LabView, and we are trying to setup a test rig to measure voltage, pressure and flow rates. We are currently using a NI-6009USB box and Labview version 8.2.  Our problem lies in setting up the actual measurements on separate graphs. How do i go about setting up the daq-assistant to measure mulitple devices, and graph them on their own graphs?  We also need to know how to program in when measuring flow, how to convert it from square wave form to a calibrated curve?
    Any help would be greatly appreciated!
    Nate

    When you configure the DAQ Assistant, you will be first asked to select the measurement type. Assuming that you have voltage sensors because you have the 6009, you select Analog Input>Voltage. You then get a list of devices. Since you only have one, it should be listed as Dev1. Expand that and then pick the channels you have connected to the sensors. Just like it says at the bottom of the of the channel window, you can select multiple channels with  <CTL> or <SHIFT> click. After you've done that, the next window is where you select your sample rate, number of samples, etc. You can also select a custom scale for each channel. This is where you would enter any formula you have from the sensor vendor in order to convert a voltage reading to scaled units.
    The output of the DAQ Assistant is a dynamic data type. You can wire this to a single graph to display all readings together or use the Split Signals function to break out individual channels for separate graphs.
    Message Edited by Dennis Knutson on 02-22-2007 03:33 PM
    Attachments:
    Split Signals.PNG ‏4 KB

  • I have a large number of photos imported into iPhoto with the dates wrong.  How can I adjust multiple photos (with varying dates) to the same, correct, date?

    I have a large number of photos imported into iPhoto with the dates wrong.  How can I adjust multiple photos (with varying dates) to the same, correct, date?

    If I understand you correctly, when you enter a date in the Adjust Date and Time window, the picture does not update with the date you enter.  If that is the case then something is wrong with iPhoto or your perhaps your library.
    How large a date change are you putting in?  iPhoto currently has an issue with date changes beyond about 60 years at a time.  If the difference between the current date on the image and the date you are entering is beyond that range that may explain why this is not working.
    If that is not the case:
    Remove the following to the trash and restart the computer and try again:
    Home > Library > Caches > com.apple.iphoto
    Home > Library > Preferences > com.apple.iPhoto (There may be more than one. Remove them all.)
    ---NOTE: to get to the "home > library" hold down option on the keyboard and click on "Go" > "Library" while in the Finder.
    Let me know the results.

  • How can I return multiple values with PL/SQL Web Services

    Hi,
    I'm new to developping Web Services. I'm doing some tests with JDeveloper and OC4J on my local machine with a Web Services based on a PL/SQL function within a package. Right now that function only returns one value. So the xml response only has one output.
    I'd like to know how can I return multiple values with my PL/SQL Web Service. For example, if I want to return an employee's name and id? And that the xml contains two output : <employee>, <empid>?
    Reginald
    ps : I have searched the forum and I couldn't find an answer to this question, if that has been discussed AND answered before, can you please post the link? Thanks

    Alright, I actually found my answer. Since this was asked I think as a followup somewhere else I'll give my answer.
    It is very simple, all you have to do is create an Object Type and then Return that object type. After that, JDeveloper will take care of everything and you will have an xml response with multiple values. Here
    {color:#ff0000}
    create or replace TYPE person AS OBJECT
    ( id_interv number,
    first_name VARCHAR2(50),
    last_name VARCHAR2(50),
    date_birth date
    );{color}
    Then your function used in your Web Service should look something like this :
    {color:#ff0000}
    function info_emp (p_empno IN VARCHAR2) RETURN person AS
    l_emp person := person(-1,'','','');
    BEGIN
    SELECT first_name
    ,last_name
    ,emp_no
    INTO l_emp.first_name
    ,l_emp.last_name
    ,l_emp.emp_no
    FROM emp
    WHERE upper(emp_no) = upper (emp_no);
    {color}
    {color:#ff0000}
    RETURN l_emp;
    EXCEPTION WHEN NO_DATA_FOUND THEN
    l_emp := person (-1,'n/a','n/a','n/a');
    RETURN l_emp ;
    END info_emp;{color}
    {color:#ff0000}{color:#000000}After that, this is what the xml response looks like :{color}{color}
    &lt;first_name xsi:type="xsd:string"&gt;John&lt;/first_name&gt;
    &lt;last_name xsi:type="xsd:string"&gt;Doe&lt;/last_name&gt;
    &lt;emp_no xsi:type="xsd:string"&gt;0250193&lt;/emp_no&gt;

  • How can I copy multiple slides with a HP Scanjet 4050 to photoes using Maverick? HP apparently no longer supports this product for this OS.

    How can I copy multiple slides with a HP Scanjet 4050 to photoes using Maverick? HP apparently no longer supports this product for OS Maverick.

    VueScan
    VueScan FAQ

  • How can I edit multiple clips with different frame rates on the same timeline

    how can I edit multiple clips with different frame rates on the same timeline

    You do not want to edit material from different frame rates on one timeline. You CAN do this, but it is a very bad idea - and this is why.
    Once you establish the sequence frame rate - lets say it is PAL material at 25fps, any material that you drop into the sequence other than 25 fps will have to be changed to play at 25 fps. If the material you add is NTSC (29.97), FCP will DROP 5 frames per sec to bring the frame rate down to 25 fps. Which 5 get thrown away? Every 6th one. This yields a funky cadence that becomes even more complex as as there are also interlaced fields (DV/NTSC is an interlaced format). Oh, and by the way, the image sizes are different as well. DV/PAL has 576 lines of resolution and DV/NTSC has 480. FCP has to scale up the NTSC to fit the PAL frame.
    You do not want FCP adjusting these things on the fly. You want to do a thoughtful (and time consuming) conversion so that you end up with all your material in one format with the best possible image from the conversion process. Compressor can do an adequate job with Frame Controls turned on. The Natress Standards Conversion FCP plugin is another way to go. A third option is to find a post house that can do the conversion for you using a hardware based process.
    The good news is, once everything is in the same format, editing it will be painless and the output process very quick.
    Whatever frame rate/ image size you select, I'd suggest using ProRes for the codec. It is 4:2:2 color and will withstand color correction and composting with much more grace than any variant of DV based codecs.
    Have fun.
    x

  • How do I share multiple contacts with another iPhone?

    How do I share multiple contacts with another iPhone? Thanks in advance.

    What do you mean share? 
    It is not possible to send contacts from one iPhone to another without installing an app that would support this.  Bump is one such app.
    There is no functionality in iOS to do this.  iCloud can share contacts across multiple iDevices, but it would be ALL contacts, just just a few.

  • How to go about multiple inclination with different data selection in Delta

    We have to copy large amount of data ( more than 42lak of recodes) selectivly from on ODS to other ODS. in delata load ( BW 3.5 enverioment)
    I thought of loading data in slices through delta loading with selection condition.
    step 1> Do The initialization with selection condition as for calyear =2001 ( Init without data transfer )
    step 2> Take the delta load .. it will take all delta record with same selection
    step 3> Now I want to do Initialization with selection condition as for calyear =2002
    step 4> take the delta now it will take delta for year 2001 and 2002 both Right ?
    Here what problem I am facing.. while doing 2nd time initialization it prompt me to delete the last  initialization request form scheduler menu.
    if i delete the last request .. will it take the delta  for previous initialization selection  and new initialization selection. ?
    Please advice how to go about multiple inclination with different data selection in delta loading.
    Looking forward your reply.

    Hi,
    step 1> Do The initialization with selection condition as for calyear =2001 ( Init without data transfer )
    step 2> Take the delta load .. it will take all delta record with same selection
    step 3> Now I want to do Initialization with selection condition as for calyear =2002
    step 4> take the delta now it will take delta for year 2001 and 2002 both Right ?
    You are correct with this scenario normally. The message you mentioned normally comes up when you open a infopackage and don't change the selection first or in case you have overlapping selections with an already done init.
    regards
    Siggi

  • How to check-in multiple files with same name having different revision num

    Hi
    Can anyone please tell me, how to check-in multiple files with the same name with different revision number using RIDC API.
    For eg:
    First I will check-in a file(TestFile.txt) into a content server with revision number 1 using RIDC API in ADF application. Then after some time, will modify the same file(TestFile.txt) and check-in again. I tried to check-in same file multiple times, however first time its checking-in correctly into server showing revision as 1, while checking-in same file again, its not giving any errror message, and also its not reflecting in server. Only one file(TestFile.txt) is reflecting in server.
    How to implement this functinality using RIDC API? Any suggestions would be helpful.
    Regards
    Raj
    Edited by: 887680 on Mar 6, 2013 10:48 AM

    Hi Srinath
    Thanks for your response. Its not cloning, its like check-in file first, then check-out the file and do some editing and then again upload the same file with different revision number using RIDC. I got the solution now.
    Regards
    Raj

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

  • How do I read multiple channels at one time using labview with the Fluke Hydra Data Bucket 2620a using serial port?

    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 from multiple channels

    Dear Sir
    I am acquiring data using FP-RTD-122 using OPC Client software. I ahve made one socket for that and i am using command
    CWDataSocket1.AccessMode = cwdsReadAutoUpdate
    CWDataSocket1.URL = "opc://localhost/National Instruments.OPCFieldPoint/FP Res\FP-RTD-122 @1\Channel 0"
    CWDataSocket1.Connect
    v = CWDataSocket1.Data.Value
    where v is a variant type.But this is 8-channel RTD so how can i read values from all channels using single socket connection Because at presnt i have to use 8 sockets for all eight channels.

    At least as of FieldPoint 4.0 and earlier (I do not know about 4.0.1 or later), the OPC Server did not support multiple channel analog items. Thus to read all eight channels of a FP-RTD-122 module, you would need 8 separate socket connections. For discrete modules (boolean), the "All" tag, is treated as a single 8 or 16 bit number.
    Regards,
    Aaron

  • How can I read two channels with fieldpoint and labview

    I'm trying to read two or more channels with the TC 120, and I follow the examples of sopport page, but doesn't work.
    What can I do?

    For more information about reading or writing to or from multiple channels in Fieldpoint, please refer to:
    How Do I Read or Write to Multiple Channels on a Fieldpoint Module in LabVIEW?
    This should enable you to read multiple channels. The only other option available is to use one fp open.vi, multiple Create Tag.vi's and multiple FP Tag Read.vi's.

  • How do you use multiple displays with a MacBook Pro and iMac

    I have an iMac and a MacbookPro laptop both upgraded to OS X 10.9 (Mavericks).  I'd like to use multiple displays with them.  Can I do this without an Apple TV?  They are both on the same network.  If I can, can someone please give some instructions on how this can be done?
    Thanks!

    Both computers have ports for external monitors. Check your user manuals. Only one display can be added to the MBP, but newer iMacs have dual Thunderbolt ports.
    Do your own Google research to learn what to do, but reading your manuals should be all you really need. It' not rocket science yet.

  • How do I run multiple channels in the same VI?

    I am trying to analyze two signals, one temp, the other strain.  I have configured my two tasks using MAX, and written separate VIs which work fine when run independently.  Now I want to measure the two signals and output the data on two separate graphs within one VI, but when I run the VI I keep getting an error stating that the "resource is already reserved" (or something to that effect).  I tried adding a channel to an existing task, and building the VI but that didn't work (both signals showed up on both graphs).  I also tried using two separate tasks but that when I get the aforementioned error.  How do I get each channel to show up on different graphs?
    I am using: M-Series DAQ card 6259, SC-2345 and SCC modules, with Labview 8.0

    Does the following VI come close to what you wanted to do ?
    Attachments:
    demo-signal-split.vi ‏108 KB

Maybe you are looking for

  • How can I specify different settings in CustomSettings.ini based on the OS that is being deployed?

    I originally thought this could be achieved using "OSVersion" or "OSCurrentVersion" but (unless I'm mistaken) those variables are in fact tied to the OS from witch you actually launch the MDT Wizard right? i.e. say I run MDT from within Windows PE to

  • Laptop Screen size is reduced (Model: dv5 HP)

    Suddenly, screen size of my laptop has been reduced to 3/4 of horizontal size, 1/3 of screen is totally blank. The resolution in display settings is 1024 x 768. Aspect ration is full screen (no border).I didn't do any change in control panel>settings

  • Old Mail Re-Appearing

    Having logged onto a wi-fi network in a hotel yesterday all the mail from the past 3-5 months keeps being resent to my mailbox even though it has been read and/or deleted. Obviously this is slowiing down the mailbox and because there are large emails

  • Menu display names not showing properly in CS applications.

    In an effort to greatly reduce the burden on our catalog production staff, I am attempting to tweak an existing font whose bullet character is too large (so that they don't have to manually reduce the size of every bullet). I have successfully done t

  • * NEW to Boards *Blackberry 8230 with Bell hinge defective ( black screen when opening )

    Hi all, I am not sure if this is a common problem with the 8200's but after only one month of usage, the flip hinge does not turn ON the internal display when opened ( you have to play with the cover so that screen pops up ). Any ideas as now i have