devices in nor-daqmx Dev1 in c

Hello

I'm trying to control several devices USB 6501 devices from a linux machine using the standard C. basically, I would like to be able to get out of lsdaq in the code, that is, to associate the serial number to the Dev1, Dev2,... names.

I looked at the:

vxipnp/linux/NIvisa/Examples/C/General/FindRsrc.c

and it works, but it only gives me the following string:

USB0::0x3923:0x718A:015C400E: RAW

considering that lsdaq looks like:

NEITHER USB-6501: "Dev1" (USB0::0x3923:0x718A:015C400E: RAW)

so, as I said, Miss me the Dev1 - serial connection.

If the devices were discovered by visa methods in the same order as lsdaq, I guess I could hard-code it, but they are not. Also I probably prefer using methods nidaq-mx(-base) to do this, if they exist.

Thank you

Andrzej

Ok. I went back, looked through the NIDAQmxBase.h

and found:

DAQmxBaseGetDevSerialNum (const char [], uInt32 *);

It works for me, that is if I assume that the total number of tips I can recover their serial numbers and I work with who.

It would be nice if there was at least a hint of this function in

/ usr/local/natinst/nidaqmxbase/documentation /.

Andrzej

Tags: NI Hardware

Similar Questions

  • drivers for simulated devices of NOR-DAQmx (NI9211 etc.) in cDAQ9174

    I'm trying to understand the three methods of calculating the maximum analog input sampling rate below NI CompactDAQ system

    http://zone.NI.com/DevZone/CDA/tut/p/ID/4320

    Problem 1

    In method 1. Build your physical hardware system or simulate your configuration able & Automation Explorer (MAX) using NOR-DAQmx simulated devices

    Buy using my MAX, I was able to build a simulated chassis cDAQ7192, but the NI 9233 modules or 9215, and NI 9211 is not found in the MAX. do I need special disks for them?

    My MAX is verson 4.6.2f1 and LABVIEW2009.

    Problem 2

    Following the method 2 to use the NI CompactDAQ Advisor, 'Performance of analog to calculate' does not appear upward after you set up the chassis.

    Thanks a lot for your help

    Concerning

    Bing

    Your version of MAX and LabVIEW is not relevant. What is your version of DAQmx?

    After you add the chassis, you right click on it to select "set up simulated cDAQ chassis? I did this and was able to select all the devices you mentioned.

  • How can I find a list of inner channel of a chassis or any other device using NOR-DAQmx?

    Hello

    I want to use the internal counter on my cDAQ-9178 channels. I know that I can use _ctro for my physical channel name when creating channel meter. Is there a way I can list all the internal channels available on a device. I use the function

    DAQmxGetDevCIPhysicalChans

    for a list of all channels of the device. But when it is used on the chassis, I do not get a list of internal channels. I found KB on how to do it with LABVIEW but cannot find a way to do it programmatically using NI DAQmx API C.

    Best regards

    Manisha

    The MathWorks

    Hi Manisha,

    For the internal channels, you must hard-code them. You can find a list of the names of internal channels at the following link: http://zone.ni.com/reference/en-XX/help/370466V-01/mxdevconsid/internalchannels/

  • Clock and hw external trigger with USB-6210 on Linux with NOR-DAQmx Base?

    I have two devices USB-6210 I need to synchronize so that they both collect data exactly at the same time. I was told by support OR I can send the clock off Dev1/PFI4 and have the two USB-6210 s read the clock in through their own PFI0. I also want to trigger data collected for each device by sending a trigger off Dev1/PFI6 and have two devices to receive the signal on PFI2.

    All my attempts to try this are filled with error messages and my research online seem to say that's not possible with USB devices on NOR-DAQmx Base 3.4.0f2 on Linux.

    I "ve tried using example AI programs and those who do not seem to work either for external clocks. Here is the code I tried:

    #include "NIDAQmxBase.h"#include 
    
    #define DAQmxErrChk(functionCall) { if( DAQmxFailed(error=(functionCall)) ) { goto Error; } }
    
    int main(void){    // Task parameters    int32       error = 0;    TaskHandle  taskHandle = 0;    char        errBuff[2048]={'\0'};    int32       i;
    
        // Channel parameters    char        chan[] = "Dev1/ai0";    float64     min = -10.0;    float64     max = 10.0;
    
        // Timing parameters    char        clockSource[] = "/Dev1/PFI7";    uInt64      samplesPerChan = 1000;    float64     sampleRate = 10000.0;
    
        // Data read parameters    #define     bufferSize (uInt32)1000    float64     data[bufferSize];    int32       pointsToRead = bufferSize;    int32       pointsRead;    float64     timeout = 10.0;
    
    printf("Calling CreateTask...\n");    DAQmxErrChk (DAQmxBaseCreateTask("",&taskHandle));printf("Calling CreateAIVoltageChan...\n");    DAQmxErrChk (DAQmxBaseCreateAIVoltageChan(taskHandle,chan,"",DAQmx_Val_Cfg_Default,min,max,DAQmx_Val_Volts,NULL));printf("Calling CfgSampleClkTiming...\n");    DAQmxErrChk (DAQmxBaseCfgSampClkTiming(taskHandle,clockSource,sampleRate,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,samplesPerChan));printf("Calling StartTask...\n");    DAQmxErrChk (DAQmxBaseStartTask(taskHandle));printf("Calling ReadAnalogF64\n");    DAQmxErrChk (DAQmxBaseReadAnalogF64(taskHandle,pointsToRead,timeout,DAQmx_Val_GroupByChannel,data,bufferSize,&pointsRead,NULL));
    
        printf ("Acquired %d samples\n", pointsRead);
    
        // Just print out the first 10 points    for (i = 0; i < 10; ++i)        printf ("data[%d] = %f\n", i, data[i]);
    
    Error:    if( DAQmxFailed(error) )        DAQmxBaseGetExtendedErrorInfo(errBuff,2048);    if(taskHandle != 0) {        DAQmxBaseStopTask (taskHandle);        DAQmxBaseClearTask (taskHandle);    }    if( DAQmxFailed(error) )       printf ("DAQmxBase Error %d: %s\n", error, errBuff);    return 0;}
    

    When I run the resulting program, I see this:

    $. / acquireNScans-ExtClk
    The CreateTask call...
    Call for CreateAIVoltageChan...
    Call for CfgSampleClkTiming...
    Error-89136 DAQmxBase: route specified cannot be satisfied, because the hardware does not support it.

    For example, a clock and a trigger can be imported via one of the PFI lines by using a USB-6210 on Linux with NOR-DAQmx Base? A clock and a trigger exportable via one of the PFI lines?

    If so, does anyone have the code example illustrating how to do this, or can you at least tell me the names of the lines ("PFI0/Dev1" or other) so I can try again?

    Clues or suggestions would be helpful.

    Thank you

    -Tom

    The clockSource in the example specifies an output rather than an input channel channel. Change source "/ Dev1 / PFI0" solved the problem.

    Please close this post.

  • 5112 does not appear under devices NOR-DAQmx

    Why does not list MAX my 5112 under NOR-DAQmx devices, but it is displayed (undefinded) PXI system? Also, I can communicate with the map using the flexible Panel so I think that the device is correctly installed.  The main problem is that I can't use this card with my 5600 because MAX reports no digitizer.

    The 5600 must be coupled with a 5142 to form a DAA.  If you must use the 5112, you can use the 5600 on its own with the pilot DAMA downconvert only mode.  Then, it would be possible to manually use the OR-Scope driver with the 5112 to read in the data, but this is not recommended.  (It would be essentially the same using a third frequency step-down converter or digitizer).

    -Christina

  • No NOR-DAQmx eligible simulation device

    Hi all

    I am developing an application for a PXI-6132, but I don't have the equipment yet, so I would like to start this with a simulated device, unfortunately when I'm at MAX, I see no device at all to choose, so I was wondering what I can do and I can't wait for material to arrive.

    I don't want to spoil my installations OR so this is the reason why I ask through this support.

    I have attached a few photos on this problem.

    Any ideas?

    I have:
    -LabVIEW 8.6

    NOR-DAQmx 8.7.2

    Thank you very much in advance

    Gozto

    The real is to solve it (I realize) comes to update MAX, I was working with the MAX which was included with LabVIEW 8.6, so I downloaded NIDAQ930f2.exe and it worked.

    Now I am able to virtualize my devices.

    I hope this might help someone with the same question/problem.

    Good day.

  • NOR-DAQmx C to run two cards USB M series

    Hello

    I am a newbie in working with DAQmx system and need help on the synchronization of multiple USB DAQ devices. The goal is to start the collection on two USB DAQ for M-series card, and we use C codes (via the DAQmx ANSI C library) to do this. I read and resources OR more guides: "Several hardware DAQ synchronization" (http://www.ni.com/dataacquisition/videos.htm), and examples of code on the dev box NOR: "NOR-DAQmx: HAVE / simultaneous in CVI AO" (http://zone.ni.com/devzone/cda/epd/p/id/879).

    My understanding is as follows:

    1. set the first card as the master and export the signal 'StartTrigger' and 'SampleClock' PFI1 and PFI2 (the physical axis).

    2. connect physically with pin PFI1 and PFI2 (sources) of MasterCard wire on pin of PFI0 and PFI1 (destination) in the slave card.

    3. set the task of the slave to use the beginning of digital dashboard using PFI0 and configure the sample clock of the slave task to use the clock of the source of the exported signal from main task to PFI1 (the slave PIN).

    So far the result does not work. The error still shows as if the physical connection is not recognized (I have not yet found a way to check if the signal exported successfully or not).

    I have attached the instant routing table to the map created in the MAX and the code snippet I used.

    Any help is welcome. Thank you!

    Hi kusg.

    DAQmx unclear that some PFI terminals on your two devices are interconnected, and you can't tell him that they are connected because DAQmx only supports connections inter-appareils for chassis PXI, not PFI terminals and cables of the RTSI. So export terminals PFI of Dev2 Dev1 task signals won't work.

    However, you can export terminals PFI of Dev1 Dev1 task signals. Try to do this instead, and the error should go away (as I think it is to assume that it is error-89124).

    In addition, when you use PFI, I recommend committing the master task before you begin the task of the slave, to start the master task does not generate unwanted edges digital:

    DAQmxTaskControl (masterTask, DAQmx_Val_Commit);

    DAQmxStartTask (slaveTask);

    DAQmxStartTask (masterTask);

    Brad

  • Runtime error example NOR-DAQmx ANSI C in the Windows 7 virtual machine

    I am under a guest Windows 7 system with a host of Ubuntu 14, using VirtualBox and have encountered a problem running even the simplest examples provided by National Instruments, using the ANSI C API for NOR-DAQmx.

    The first time that the DAQ hardware is turned on, I can run a single measure, and after that, any other indicator displays the following error message:

    Attempted to read samples that are no longer available.
    The requested sample was previously available, but has since been overwritten.
    Increasing the buffer size, reading the data more frequently, or specifying
    a fixed number of samples to read instead of reading all available samples
    might correct the problem.

    Property: DAQmx_Read_RelativeTo
    Corresponding Value: DAQmx_Val_CurrReadPos
    Property: DAQmx_Read_Offset
    Corresponding Value: 0

    Task Name: _unamedTask(0)
    Status Code: -200279

    In order to start a new measurement, I have to restart the DAQ hardware, probably in order to clear the internal buffers that are in the process of substitution.

    I am interested in a measure of continuous tension in basic by using a callback function. (The example of ContAcq_IntClk provided by OR)

    The exactly the same setup, same version of NOR-DAQmx (9.7.5) and running on Visual Studio 2012 smoothly on a computer that is running Windows 7 directly.

    I suspect that the problem is with the internal buffer being somehow messed up because of the connection with the Virtual Machine, but do not find an elegant solution to fix it.

    The camera I use is NI USB-6289.

    Hello fromm8

    Thank you very much for your help, I managed to locate the problem.

    He was not the actual code, or something like that, it was a problem of communication between the VirtualBox machine and the physical device.

    Kept launches MAX test panels a comparable as error the program C.

    I fixed the problem by opting for VMWare, which seems to have the best compatibility with USB devices.

    See you soon!

  • NOR-DAQmx 8.0.1 undefined reference

    Hello

    I'm new with NOR-DAQmx on Linux. After reading the posts in this forum, I was able to successfully install OR-DAQmx 8.0.1 on OpenSUSE 11.0. When you run "nilsdev", I get the following list of features:

    OR PXI-6255: "Dev4.
    OR PXI-6733: "Dev3.
    OR PXI-6733: "Dev2.
    OR PXI-6713: "Dev1".

    What is correct. However, when you try to compile the following program example, using "gcc main.c:

    #include "NIDAQmx.h".
    #include
    #define DAQmxErrChk (functionCall) if (DAQmxFailed (error = (functionCall))) goto error; on the other
    int main (void) {}
    error int = 0;
    TaskHandle taskHandle = 0;
    char errBuff [2048] = {'\0'};
    float64 data [3] = {1.0,2.0,3.0};
    /*********************************************/
    DAQmx Configure Code
    /*********************************************/
    DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
    DAQmxErrChk (DAQmxCreateAOVoltageChan(taskHandle,"PXI1Slot4/ao0:2","",-10.0,10.0,DAQmx_Val_Volts,""));)
    /*********************************************/
    Starting code DAQmx
    /*********************************************/
    DAQmxErrChk (DAQmxStartTask (taskHandle));
    /*********************************************/
    DAQmx write code
    /*********************************************/
    DAQmxErrChk (DAQmxWriteAnalogF64(taskHandle,1,1,10.0,DAQmx_Val_GroupByScanNumber,data,,));
    Error:
    If (DAQmxFailed (error))
    DAQmxGetExtendedErrorInfo (errBuff, 2048);
    If (taskHandle! = 0) {}
    /*********************************************/
    Stop DAQmx code
    /*********************************************/
    DAQmxStopTask (taskHandle);
    DAQmxClearTask (taskHandle);
    }
    If (DAQmxFailed (error))
    printf ("Error");
    GetChar ();
    return 0;
    }

    I get several errors about undefined references:

    main.c.text + 0 x 90): refers to 'DAQmxCreateTask' the undefined
    main.c.text + 0xdc): refers to 'DAQmxCreateAOVoltageChan' the undefined
    main.c.text + 0xf0): refers to 'DAQmxStartTask' the undefined
    main.c.text + 0 x 140): refers to 'DAQmxWriteAnalogF64' the undefined
    main.c.text + 0x15f): refers to 'DAQmxGetExtendedErrorInfo' the undefined
    main.c.text + 0 x 171): refers to 'DAQmxStopTask' the undefined
    main.c.text + 0x17c): refers to 'DAQmxClearTask' the undefined

    I have already installed OR DAQmx on a Windows XP computer and got the same errors, but could (using this post) to create the libraries needed to link against. However, I have found no information similar to that in Linux (this message seemed to understand this problem, but unfortunately, the author does not share its solution). So far, I tried various options of connection with no success '-ldl ' etc. Obviously, I'm not bind properly.

    Any help would be greatly appreciated.

    Thank you

    Grine

    I solved step connects. (Why answers always come when you almost gave up? )

    As I suspected, a liaison simple number. Compilation with 'gcc /usr/local/lib/libnidaqmx.so o main main.c', did the trick.

    I have still some errors during execution of the program, but I can probably solve these on my own.

  • DASYLab w / support NOR-DAQmx NI 9227, NI 9229 &amp; cDAQ 9174

    I am trying to use DASYLab 11 w / NOR-DAQmx 8.5 to my configuration material of NI 9227, NOR 9229 & cDAQ-9174. After decommissioning of my PC Win7 for XP that takes in charge OR-DAQmx 8.5 (the OR-DAQmx last, supported by 11 DASYLab), I discovered that NEITHER-DAQmx 8.5 does not support the cDAQ 9174. Right now, looks like I'm watered except so use LABView. Is there any other way at this time to use this hardware configuration with DASYLab or any other application?

    DASYLab V11 supports Windows 7 when you install the Service Pack (see www.dasylab.com).

    Where are we going to say that it does support NOR-DAQmx 8.5? I installed the most recent NI.com last week, and it seems to work very well. I use only simulated devices so far, but DASYLab is data collection and display correctly.

  • Data acquisition tool NOR-DAQmx with Matlab R2012a

    Hello

    I'm trying to control NI USB-6211 of Matlab 2012 using NOR-DAQmx Data Acquisition tool:

    http://zone.NI.com/DevZone/CDA/tut/p/ID/3005

    I'm working on win7 64 bit. And I see the device AND Measurement & Automation Explorer.

    The tool does not work: DAQ_Demo_Browser do nothing. And I got the error "unexpected or unbalanced parenthesis or support" of AcqNUpdates_nonUI.m

    What is the problem?

    Thank you and best regards,

    Arthur Shulkin

    Hi Arthur,.

    Tools OR DAQmx for Acquisition of data with the Software Inc. MATLAB® from The Mathworks, supports up to the 2008 version of the MATLAB® software.  In order to use our products DAQ Multifunction with MATLAB® software, you could get back to 2008 or earlier, or instead use the Data Acquisition Toolbox provided by The Mathworks, Inc.

    Another option would be to import your ".m" files in a node MathScript in LabVIEW and use the functions of NOR-DAQmx everything in the LabVIEW development environment.  For more information on the Module LabVIEW MathScript, you can consult the information available on this link:

    Inside of the LabVIEW MathScript RT Module

    MATLAB® is a registered trademark of The MathWorks, Inc.

    Katie

  • I don't see the icon of NOR-DAQmx in measurement window in Labview 2013 (student Edition)

    Hi all:

    I installed the driver NOR-DAQmx and Labview 2013 (Student Edition). I connected an acquisition of data NI USB-6008 and tested using NOR-DAQmx and that it works correctly.

    Now, I tried to make registration of data of this device using the software Labview installed but as I open a new project and go to the block diagram and show the measure menu I can't NEITHER-DAQmx icon in the window (Menu) measurement in Labview 2013 (student Edition).

    Any suggestion?

    I enclose two screenshots.

    Help, please.

    Thank you

    In what order did you install software?

    You must install LabVIEW first, followed by DeviceDrivers!

  • Question about the Acquisition continues through NOR-DAQmx

    I'm a bit new to NIDAQmx methodology and I was wondering if someone could could give me some advice on accelerating certain measures of tension that I do with a case of DAQ NI USB-6363.

    I have a python script that controls and takes measurements with a few pieces of equipment of laboratory by GPIB and also takes measurements in the area of DAQ OR DAQmx via (I use a library wrapper called pylibdaqmx that interfaces with the libraries C native).  As I do with the data acquisition unit is 32 k samples at 2 MHz with a differential pair to AI0.  An example of code that performs this operation is:

    from nidaqmx import AnalogInputTask
    
    # set up task & input channeltask = AnalogInputTask()
    task.create_voltage_channel(phys_channel='Dev1/ai0', terminal='diff',       min_val=0., max_val=5.)
    task.configure_timing_sample_clock(rate=2e6, sample_mode='finite',
          samples_per_channel=32000)
    
    for i in range(number_of_loops):  < ... set up/adjust instruments ... >  task.start()  # returns an array of 32k float64 samples  # (same as DAQmxReadAnalogF64 in the C API)  data = task.read(32000)  task.stop()  < ... process data ... >
    
    # clear task, release resourcestask.clear()del task< ... etc ... >
    

    The code works fine and I can all the 32 k spot samples, but if I want to repeat this step several times in a loop, I start and stop the job every time, which takes some time and is really slow down my overall measure.

    I thought that maybe there is a way to speed up by configuring the task for continuous sample mode and just read from the channel when I want the data, but when I configure the sample for the continuous mode clock and you issue the command of reading, NOR-DAQmx gives me an error saying that the samples are no longer available , and I need to slow the rate of acquisition or increase the size of the buffer.  (I'm guessing the API wants to shoot the first 32 k samples in the buffer zone, but they have already been replaced at the time wherever I can playback control).

    What I wonder is: How can I configure the task to make the box DAQ acquire samples continuously, but give me only the last 32 samples buffer on demand k?  Looks like I'm missing something basic here, maybe some kind of trigger that I need to put in place before reading?  It doesn't seem like it should be hard to do, but as I said, I'm kinda a newbie to this.

    I understand the implementation of python that I use is not something that is supported by NEITHER, but if someone could give me some examples of how to perform a measure like this in LabView or C (or any other ideas you have to accelerate such action), I can test in these environments and to implement on my own with python.

    Thanks in advance!

    Toki

    This is something I do a bit, but I can only describe how I would do it in LabVIEW - I'm no help on the details of the C function prototypes or the python wrapper.

    In LabVIEW, there are accessed via the 'DAQmx Read property node' properties that help to implement.  One is the Mode "crush" which I'm sure must be set before performing the operation.  The other pair is known as "RelativeTo" and "Offset" and they allow you to specify what part of the CQI data buffer to read data from.   If you the config to "RelativeTo" = 'most recent sample' and 'Offset' =-32000, then whenever you read 32000 samples, they are the very latest 32000 which are already available in the buffer of data acq.  Between the readings, the task is free to overwrite the old data indefinitely.

    Note that you will need to do this continuous sampling mode and that you can explicitly set a buffer size smaller than the default which will choose DAQmx based on your fast sampling rate.

    An excerpt from LV 2010:

    -Kevin P

  • Integration of material NI_DAQ and NOR-DAQmx software on the same system PCI-DIO-96

    Hello

    We have a great system that is developed in VB and uses the traditional inherited NOR-DAQ system. The system controls the controller PCI-DIO-96. We would like to upgrade to some parts of the system to NOR-DAQmx and use VB.Net and we know that you can install both systems together on the same computer.

    We have a few questions:

    (1) once the legacy of NOR-traditional DAQ OR DAQmx software can be integrated in the same system. Some parts of the system will always use the VB and the other parties will use VB.Net.

    (2) if the answer to the first question is Yes. Are there hardware or software limitations? Is there a recommended way to integration?

    (3) are there articles based on the knowledge about it?

    Thanks Jeremiah

    There are a number of limitations to the use of NOR-DAQmx and NOR-DAQ traditional at the same time.  First of all, only one of the drivers can access the device at a time.  To switch between the drivers, I recommend that you read this knowledge base Article: that I can use OR-DAQ traditional (old) and NOR-DAQmx simultaneously?  You will need to use the equivalent functions of VB .NET to switch between the pilots.

    In addition, the system should use Windows XP or an earlier version.

  • What is the latest version of the NOR-DAQmx driver? 9.7.0 vs 9.6.2

    Hi all... I'm puzzled. I found the version of NOR-DAQmx 9.7.0 released February 25, 2013 and NOR-DAQmx version 9.6.2 released March 4, 2013.

    Read the "readme" files does not lighten.

    What is going on? Two teams who does not speak with them?

    DAQmx 9.7 is always the latest version with the most recent device and the support of the API. The 'Release Date' refers to the post to date of web and it can not match the schema version.

    We'll push DAQmx 9.6.2 Update Service with the DVD of LabVIEW Driver 2012 SP1. DAQmx 9.7 will be available only for download web or included as a DVD with the hardware which requires for the purposes of support.

Maybe you are looking for