Reading voltages into a USB6210 using CVI

I have had this board working ok until I connected it to some other equipment.
the first 3 inputs are connected to load cell amps and the fourth to measure the output of the test machine appling load to the load cells.
Its when I conect to this test machine the voltages go all over the place.
I have the inputs wired in differential mode.
I got into Test panels and selected differential then ran the program, then selected create a task so I could select four inputs and all the channels read ok.
So what I think I need is some way to configure my code to set the USB6210 to be in differential mode.
I have searched the NI examples and can not find an example.
this is the code I use to set up the USB6210
 int32       error=0;
 TaskHandle  taskHandle=0;
 char        chan[256];
 float64     min=-10.0,max=10.0,rate=10000;
 uInt32      sampsPerChan=100;
 int32       numRead,a;
 uInt32      numChannels;
 float64     *data=NULL;
 int         log;
 char        errBuff[2048]={'\0'};
 uInt32      i;
 float  Floatnum;
 char NumString[30]; 
  // DAQmx Configure Code
  DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
  DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai1,Dev​1/ai2,Dev1/ai3,Dev1/ai4","",DAQmx_Val_Cfg_Default,​min,max,DAQmx_Val_Volts,NULL));
  DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"",rate,DAQmx_Va​l_Rising,DAQmx_Val_FiniteSamps,sampsPerChan));
  DAQmxErrChk (DAQmxGetTaskAttribute(taskHandle,DAQmx_Task_NumCh​ans,&numChannels));
  if( (data=malloc(sampsPerChan*numChannels*sizeof(float​64)))==NULL )
   MessagePopup("Error","Not enough memory");
   goto Error;
  // DAQmx Start Code
  DAQmxErrChk (DAQmxStartTask(taskHandle));
Solved!
Go to Solution.

You may have to use:
DAQmxSetChanAttribute (taskHandle, "", DAQmx_AI_TermCfg, DAQmx_Val_Diff, 0);
This will affect all channels in the task.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos?

Similar Messages

  • How do I read voltage on multiple channels using the 6255\SCB-6​8

    Hi All
    I was able to get the following code to compile, run and view the voltage data as expected. when reading the voltage (RSE) on Dev0/ai65
    ...National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog In\Measure Voltage\Cont Acq-Int Clk\ContAcq-IntClk.c
    * I think that I am using RSE but I have no clue since I do not see an argument to specify
    I am trying to read two different data points:
    1. View the voltage (RSE) on Dev0/ai65
    2. View the voltage difference (Differential) between Dev0/ai17 and Dev0/ai25
    Can someone point me to an example (or web link) where two different data points are being read.
    *edit - I am trying to complete this task using C++
    Thanks
    Chad
    Solved!
    Go to Solution.

    This was my last attempt that failed
    #include <stdio.h>
    #include <NIDAQmx.h>
    #include <iostream>
    using namespace std;
    #define DAQmxErrChk(functionCall) if( DAQmxFailed(error=(functionCall)) ) goto Error; else
    int32 CVICALLBACK EveryNCallback(TaskHandle taskHandle1, int32 everyNsamplesEventType, uInt32 nSamples, void *callbackData);
    int32 CVICALLBACK EveryNCallback(TaskHandle taskHandle2, int32 everyNsamplesEventType, uInt32 nSamples, void *callbackData);
    int32 CVICALLBACK DoneCallback(TaskHandle taskHandle1, int32 status, void *callbackData);
    int32 CVICALLBACK DoneCallback(TaskHandle taskHandle2, int32 status, void *callbackData);
    int main(void)
     cout << "\t***********************************************​****\n";
     cout << "\t         Starting the NI DAQmx data logger\n";
     cout << "\t***********************************************​****\n\n";
     int32       error = 0;
     TaskHandle  taskHandle1 = 0;
     TaskHandle  taskHandle2 = 0;
     char        errBuff[2048] = { '\0' };
     // DAQmx Configure Code
     DAQmxErrChk(DAQmxCreateTask("task1", &taskHandle1));
     DAQmxErrChk(DAQmxCreateTask("task2", &taskHandle2));
     DAQmxErrChk(DAQmxCreateAIVoltageChan(taskHandle1, "Dev1/ai65", "", DAQmx_Val_Cfg_Default, -10.0, 10.0, DAQmx_Val_Volts, NULL));
     DAQmxErrChk(DAQmxCreateAIVoltageChan(taskHandle2, "Dev1/ai17", "", DAQmx_Val_Cfg_Default, -10.0, 10.0, DAQmx_Val_Volts, NULL));
     DAQmxErrChk(DAQmxCfgSampClkTiming(taskHandle1, "", 10000.0, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 1000));
     DAQmxErrChk(DAQmxCfgSampClkTiming(taskHandle2, "", 10000.0, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 1000));
     DAQmxErrChk(DAQmxRegisterEveryNSamplesEvent(taskH​andle1, DAQmx_Val_Acquired_Into_Buffer, 1000, 0, EveryNCallback, NULL));
     DAQmxErrChk(DAQmxRegisterEveryNSamplesEvent(taskH​andle2, DAQmx_Val_Acquired_Into_Buffer, 1000, 0, EveryNCallback, NULL));
     DAQmxErrChk(DAQmxRegisterDoneEvent(taskHandle1, 0, DoneCallback, NULL));
     DAQmxErrChk(DAQmxRegisterDoneEvent(taskHandle2, 0, DoneCallback, NULL));
     // DAQmx Start Code
     DAQmxErrChk(DAQmxStartTask(taskHandle1));
     DAQmxErrChk(DAQmxStartTask(taskHandle2));
     printf("Acquiring samples continuously. Press Enter to interrupt\n");
     getchar();
    Error:
     if (DAQmxFailed(error))
      DAQmxGetExtendedErrorInfo(errBuff, 2048);
     if (taskHandle1 != 0) {
      // DAQmx Stop Code
      DAQmxStopTask(taskHandle1);
      DAQmxStopTask(taskHandle2);
      DAQmxClearTask(taskHandle1);
      DAQmxClearTask(taskHandle2);
     if (taskHandle2 != 0) {
      // DAQmx Stop Code
      DAQmxStopTask(taskHandle1);
      DAQmxStopTask(taskHandle2);
      DAQmxClearTask(taskHandle1);
      DAQmxClearTask(taskHandle2);
     if (DAQmxFailed(error))
      printf("DAQmx Error: %s\n", errBuff);
     printf("End of program, press Enter key to quit\n");
     getchar();
    return 0;
    int32 CVICALLBACK EveryNCallback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, void *callbackData)
     //cout << "\nStarting EveryNCallback" << "\n";
     //cout << "line 59" << "\n";
     TaskHandle  taskHandle1 = 0;
     TaskHandle  taskHandle2 = 0;
     int32       error = 0;
     char        errBuff[2048] = { '\0' };
     static int  totalRead1 = 0;
     static int  totalRead2 = 0;
     int32       read1 = 0;
     int32       read2 = 0;
     float64     data1[1000];
     float64     data2[1000];
     // DAQmx Read Code
     cout << "Start DAQmx Read Code Loop \n";
     DAQmxErrChk(DAQmxReadAnalogF64(taskHandle1, 1000, 10.0, DAQmx_Val_GroupByChannel, data1, 1000, &read1, NULL));
     DAQmxErrChk(DAQmxReadAnalogF64(taskHandle2, 1000, 10.0, DAQmx_Val_GroupByChannel, data2, 1000, &read2, NULL));
    // for (int i = 0; i <= 10; i++)
    //  cout << data[i] << "\n";
     //cout << "Here is data = " << data << "\n";
     //cout << "Here is data[2] = " << data[2] << "\n"; // write the data to a file
     if (read1>0) {
      cout << "Acquired " << read1 << " samples \n";
      totalRead1 += read1;
      cout << "Acquired " << totalRead1 << " Total samples \r\n\n";
      cout << data1 << "," << data2 << "\n";
      fflush(stdout);
     // cout << "the next line is stdout \n";
     // cout << stdout << "\n";
    Error:
     if (DAQmxFailed(error)) {
      DAQmxGetExtendedErrorInfo(errBuff, 2048);
      // DAQmx Stop Code
      DAQmxStopTask(taskHandle1);
      DAQmxStopTask(taskHandle2);
      DAQmxClearTask(taskHandle1);
      DAQmxClearTask(taskHandle2);
      printf("DAQmx Error: %s\n", errBuff);
     return 0;
    int32 CVICALLBACK DoneCallback(TaskHandle taskHandle, int32 status, void *callbackData)
     cout << "\nStarting DoneCallback" << "\n";
     cout << "line 99" << "\n";
     int32   error = 0;
     char    errBuff[2048] = { '\0' };
     // Check to see if an error stopped the task.
     DAQmxErrChk(status);
    Error:
     if (DAQmxFailed(error))
      TaskHandle  taskHandle1 = 0;
      TaskHandle  taskHandle2 = 0;
      cout << "line 109" << "\n";
      DAQmxGetExtendedErrorInfo(errBuff, 2048);
      DAQmxClearTask(taskHandle1);
      DAQmxClearTask(taskHandle2);
      printf("DAQmx Error: %s\n", errBuff);
     return 0;

  • HOW TO READ DATA FROM A FILE AND INSERT INTO A TABLE USING UTL_FILE

    Hi..
    I have a file.I want to read the data from file and load it into a table using utl_file.
    how can I do it?
    Any reply apreciated...

    Hi,
    This is not your requirment but u can try this :
    CREATE OR REPLACE DIRECTORY text_file AS 'D:\TEXT_FILE\';
    GRANT READ ON DIRECTORY text_file TO fah;
    GRANT WRITE ON DIRECTORY text_file TO fah;
    DROP TABLE load_a;
    CREATE TABLE load_a
    (a1 varchar2(20),
    a2 varchar2(200))
    ORGANIZATION EXTERNAL
    (TYPE ORACLE_LOADER
    DEFAULT DIRECTORY text_file
    ACCESS PARAMETERS
    (FIELDS TERMINATED BY ','
    LOCATION ('data.txt')
    select * from load_a;
    CREATE TABLE A AS select * from load_a;
    SELECT * FROM A
    Regards
    Faheem Latif

  • I pull fiftyfour bytes of data from MicroProcessor's EEPROM using serial port. It works fine. I then send a request for 512 bytes and my "read" goes into loop condition, no bytes are delivered and system is lost

    I pull fiftyfour bytes of data from MicroProcessor's EEPROM using serial port. It works fine. I then send a request for 512 bytes and my "read" goes into loop condition, no bytes are delivered and system is lost

    Hello,
    You mention that you send a string to the microprocessor that tells it how many bytes to send. Instead of requesting 512 bytes, try reading 10 times and only requesting about 50 bytes at a time.
    If that doesn�t help, try directly communicating with your microprocessor through HyperTerminal. If you are not on a Windows system, please let me know. Also, if you are using an NI serial board instead of your computer�s serial port, let me know.
    In Windows XP, go to Start, Programs, Accessories, Communications, and select HyperTerminal.
    Enter a name for the connection and click OK.
    In the next pop-up dialog, choose the COM port you are using to communicate with your device and click OK.
    In the final pop
    -up dialog, set the communication settings for communicating with your device.
    Type the same commands you sent through LabVIEW and observe if you can receive the first 54 bytes you mention. Also observe if data is returned from your 512 byte request or if HyperTerminal just waits.
    If you do not receive the 512 byte request through HyperTerminal, your microprocessor is unable to communicate with your computer at a low level. LabVIEW uses the same Windows DLLs as HyperTerminal for serial communication. Double check the instrument user manual for any additional information that may be necessary to communicate.
    Please let me know the results from the above test in HyperTerminal. We can then proceed from there.
    Grant M.
    National Instruments

  • Error in reading voltage using DAQmx with PXI-6259

    Hi,
    We are trying to acquire analogue voltage from 5 channels using PXI-6259. We trigger the data sampling with clk 0 (i.e. using PFI 12).
    The problem we had is:
    1)When we tried to get voltage from 5 channels, we get 2 data at the same after twice the period. For example, If we set the 
      sampling rate to be of period 1 second, we get 1 signal at 2 second and around (2+t), where t is a random time less than the execution period of the loop.
      Then the next cycles would be 4 second and (4+t).
    2) This timing problem did not occur if we only acquire voltage from 2 or less channels.
    3) We tried to run exactly the same program with NI USB-6210 and everything worked just fine.
    4) We replaced the DAQmx read with DAQ assistant and still encountered the same problem.
    Attached is the a simple program that showed the error. Is this possibly a bug in PXI or DAQmx?
    Please help us
    Arul (CLAD)
    Attachments:
    test rig.vi ‏74 KB

    Good afternoon Nitin,
    Thanks for contacting National Instruments with your issue, we'll try our best to resolve it for you as quickly and efficiently as possible.
    As the error message stated:
    "Analog input virtual channels cannot be created out of order with respect to their physical channel numbers for the type of analog device you are using. For example, a virtual channel using physical channel ai0 must be created before a virtual channel with physical channel ai1."
    If you need to randomly switch which channels you want to either control IEPE excitation or coupling on, a better approach rather than having all of these channels in one task as you've done in your attached VI, is to parse your program down to multiple tasks that can run simultaneously. 
    I have attached a screenshot of this approach, which hopefully is not a compromise to your application.
    Best of luck with your project.
    Sincerely,
    Minh Tran
    Applications Engineering
    National Instruments
    Attachments:
    ParallelTasks.JPG ‏52 KB

  • I plugged my iPod touch (4th generation) into my computer and when iTunes popped up, there was a notice that read "The iPod cannot be used because the Apple Mobile Device service is not started". What does this mean and what do I do?

    I plugged my 4th generation iPod touch into my computer and when iTunes popped up, there was a notice that read, "The iPod cannot be used because the Apple Mobile Device is not started". What does this mean and what do I do?

    Type "Apple Mobile Device Service" into the search bar at the top of the page by Support and read the help article.

  • CAN Frame to channel conversion using CVI

    Hi,
    I am using USB-8473 can bus modules in a project.  I would like to display the channel data by using the Frame to Channel conversion library.  Is there a version that can be used with CVI?  I am using CVI 9.1
    Thanks
    John

    Hello John,
    I do see what you mean, the VIs actually just call into a C dll. I dowloaded to the Library after reading your post and opened up the VIs. It looks like each is just a small wrapper around Call library funciton node. It is definately silly that the VIs are so well documented but not the functions of the dll itself. Based on browsing a few of these VIs, it would be pretty easy to write the wrapping code in C and call all the same functions of frchconvlib.dll. 
    I will look into whether this library was written by a third party or NI, and if its NI property I would like to expose the dll itself to users like yourself. 
    I do apologize that this is the only current solution. I will let you know what I find out.
    This kind of feedback it important to receive, so thank you for voicing you concern.
    Best,
    Anna K.
    National Instruments

  • Taking my 4S verizon phone to italy,greece. can i safely recharge on their voltage? can i use the phone?

    taking my verizon 4S phone to italy and greece. can i safely recharge on their voltage?
    can i use the phone in europe?

    razmee209 wrote:
    You would probably need to contact Verizon and see if you can use the phone there.  You may need to add some international plans to your phone prior to leaving.
    I think he was refering to charging the iPhone not a calling plan.
    Here is what I found on a Google search:
    From an Electrical Engineer. Short answer: Yes.
    Long answer: The only things that is important for using any AC adapters overseas are the following:
    * You need to have the right type of plug. If you do not it will not fit, and if you force it, it could break.
    * The adapter needs to support the right voltage for input. Some of the world uses around 110 volts. The rest uses around 220 volts. Many digital devices have power adapters that support both, which is often written as 100-240V or sometimes 110-240V. As long as it support both you are good. If it does not things get messier, and I won't get into them here.
    * It must support the correct frequency for input. Again some parts of the world use 60 Hz, the rest uses 50 Hz. Just about all AC adapters support both. If the do they will say 50-60Hz.

  • Upload data from Excel into SAP CRM using webservices

    Hi,
               I want to upload the data from EXCEL into SAP CRM using a web  service, can anyone say me the process and also how to map the excel and the source code structures.
    Thanks,
    Sanju.

    Try the following :
    Class: CL_GUI_FRONTEND_SERVICES
    Method: GUI_UPLOAD
    Thanks
    <b>Allot points if this helps!</b>

  • Please help, I am trying to split a HD mp4 video into two parts using Quicktime 10.2

    Please help, I am trying to split a HD mp4 video into two parts using Quicktime 10.2, running Mountain Lion. I use trim then export but it doesn't give the movie option as a format. What would you suggest i do?

    I'm not sure why you're using a FAT32 drive, but using ExFAT instead of FAT32 would be a better overall choice as it doesn't have the 4 Gig limit.
    http://www.tech-recipes.com/rx/2801/exfat_versus_fat32_versus_ntfs/

  • How to read accdb and mdb files using JDBC or File Adapter

    Hi,
    How to read and extract the .accdb and .mdb files  from FTP server and parsing into xml  by using FTP or JDBC Adapter in SAP PI7.11 With linx Os.
    Regards
    Upendra

    Hi,
    As per SAP note:1681420 i have to  install the below  driver from Microsoft
    Our SAP PI installed under Unxi OS ,how to install the driver (.exe file) .
    Driver name :AccessDatabaseEngine_x64.exe
    Url:Download Microsoft Access Database Engine 2010 Redistributable from Official Microsoft Download Center
    1681420 - PI : Where to locate the JDBC Driver for Microsoft Access
    Regards
    Upendra

  • How do I scan multiple pages into one document using the CanoScan LiDE 200?

    How do I scan multiple pages into one document using the CanoScan LiDE 200?
    I can't seem to find a way to get them to scan continuously, or a way to stitch them together afterwards.

    Hi dagda24,
    You can scan multiple pages into a single document with the scan to PDF option.  Use the following steps to do so:
    1.  Open MP Navigator.
    2.  Click One Clcik.
    3.  Click Save to PC.
    4.  Change the File Type from PDF to PDF (multiple pages).
    5.  Make any other changes as needed, then click scan.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • Is it possible to export data from a PDF in Reader XI into an xfdf file?

    Hello,
    I am new to the forum and to Adobe Acrobat.  Please bear with me as I explain what I need to do and what I have tried to do so far to accomplish this (based on reading numerous forum discussions and Adobe IAC/JavaScript manuals).
    Operating system, Adobe and Microsoft products on my standalone PC:
         OS:  Windows 7 Professional
         Adobe:  Adobe Acrobat Pro XI
                       IAC Software (free download)
                       Adobe Reader XI
        Microsoft: VisualStudio 2010 (VB.NET and C#.NET)
    I need to export the data from a fillable PDF in Acrobat Reader XI into an .xfdf file that will allow me to pull the field data out of the .xfdf  (xml-type) file and use it in a C# program.  I tried using exportXFDF as a trusted function not knowing initially that Acrobat Reader XI will allow you to import, but not export.  Is there any workaround for this problem?
    Using the IAC I was able to write a program that allowed my to save the data in a fillable PDF in Acrobat to an xml-type file; however, that only worked when my executable was running on a PC that had Acrobat installed (not Acrobat Reader).  I need to be able to do this out of Acrobat Reader XI, and we do not want to use Adobe LiveCycle to do this. 
    I feel like there is something very obvious that I am missing here.
    kfreema7

    I hope you won't see this as rude, but what you are missing is the obvious point that Adobe are in business to make money. So they put as little in Adobe Reader as they can, so people are motivated to buy stuff. Every development intended for Reader has severe limitations on feasibility and techniques for this reason; it's a huge (but very common) mistake to just develop for Acrobat and assume Reader will follow.

  • Query on integrating windows file server into SAP KM using WEBDAV

    hi
    I have sucessfully integrated windows file server into SAP KM using WEBDAV. I have query in it regarding the possible validation against the portal Database user. Can we configure such that the user comparison happens for LDAP as well as database user. Have anyone configured such a scenario?
    Regards,
    Ganesh N

    Hi Ganesh,
    this should work in principle.
    However you would need a user in Active Directory for each user in the portal database that should connect to the file server if you are using the SSO22KerbMap Module as I assume.
    In my whitepaper I have mentioned this for the internal user index_service that does only exist in the portal database.
    Best regards,
    André

  • Load a flat file into BW-BPS using SAP GUI

    Hi,
    We are using BW BPS 3.5 version, i implemented how to guide  " How to load a flat file into BW-BPS using SAP GUI" successfully without any errors.
    I inlcuded three infoobjects in the text file   costelemt, Posting period and amount. the same three infoobjects i inlcuded the file structure in the global data as specified in the how to document
    The flat file format is like this
    Costelmnt      Postingperiod         Amount   
    XXXXX             #      
    XXXXX             1                          100
    XXXXX             2                           800
    XXXXX             3                           700
    XXXXX             4                           500
    XXXXX             5                           300
    XXXXX             6                           200
    XXXXX             7                           270
    XXXXX             8                           120
    XXXXX             9                           145 
    XXXXX            10                           340
    XXXXX            11                           147
    XXXXX            12                           900 
    I successfully loaded above flat file in to BPS cube and it dispalyed in the layout also.
    But users are requesting to load  flatfile in the below format
    Costelmnt        Annual(PP=#)   Jan(PP=1)   Feb(PP=2) ........................................Dec(PP=12)  
    XXXXX              Blank                       100           800                                                   900
    Is it possible to load a flat file like this
    They wants load a single row instead of 13 rows for each costelement
    How to do this. Please suggest me if anybody accorss this requirment.
    In the infocube we have got only one Info object 0FISCPER3(Posting period) and one 0AMOUNT(Amount)
    do we need 13 Infobjects for each posting period and amount.
    Is there any possiblity we can implement any user exit which we use in BEX Quer's
    Please share your ideas on this.
    Thanks in advance
    Best regards
    SS

    Hi,
    There are 2 ways to do this.
    One is to change the structure of the cube to have 12 key figures for the 12 posting periods.
    Another way is to write an ABAP Function Module to fetch the values from each record based on the posting period and store it in the cube for the corresponding characteristic. This way, you dont have to change the structure of the cube.
    If this particular cube is not used anywhere else, I would suggest to change the structure itself.
    Hope this helps.

Maybe you are looking for

  • Send Idoc to AS2 System via HTTP using XI

    Hi, We need to send Invoice Idocs as XML files from SAP R/3 system to external AS2 system using XI. The communication will happen over HTTP using certificate. I tried using Plain HTTP adapter , but the message went into error 'ATTRIBUTE_CLIENT'. Why

  • How to remove yellow bounding box?

    As I understand, stage.stageFocusRect = false; will remove the yellow bounding box around buttons in my Flash app. However, it is throwing an error: TypeError: Error #1009: Cannot access a property or method of a null object reference. Is there a dep

  • Vista does not allow me to install firefox

    i had blue screen 3 times today and i uninstalled firefox 6.smt. then i've downloaded firefox 7 setup an tried to run it. it starts to extract files but nothing happens. by the way smt weird happens, after extracting files a window shows up and says,

  • Where to download the License Manager

    Hi all, I have seen someone mention that the License Manager can be downloaded as a standalone application in order to update the License Key for the SAP Integration Kit. But I don't know where to find this "stand-alone" License Manager. Any help is

  • EL implicit exception object

    Hi I tried to use the EL implicit exception Object in my errorPage.jsp. The errorPage shows up correctly, but nothing from the exception object is displayed. The page looks something like this: <%@ page isErrorPage="true" %> <%@ page isELIgnored="fal