Data acquisition with USB-6008 using C++

Hello

I am trying to use USB-6008 to collect analog data without using Labview, since I can't afford the lincence. I searched in the C++ provided with product samples and found "Simple example of analog input.

The compiler I use is codeblocks instead of visual studio (once again for monetary reasons). The code seems to works since when I run it with the USB-6008 box connected, he wrote "gains 1000 points.

I have 3 questions relating to the use of this code:

1. where are stored the 1000 points?

2. How can I modify the code to specify the time acquisition and the frequency of acquisition?

3. How can I change this code sample points simultenously with 8 analog inputs?

Thank you for your help,

I'll try to add any clarification if necessary.

Albany

Your questions are answered in help for c programmers.

1000 points are in the variable array of points called 'data '.

The sampling frequency is set to sync.

The number of points read is defined with the function of reading.

Read channels are defined with the function channel set. To read multiple channels, use syntax such as Dev 1 / ai0:3 for the first 4 channels.

Tags: NI Hardware

Similar Questions

  • Get incremental counter/sound to work along side with action with usb-6008 with labview tia sal22

    Get incremental counter/sound to work along the coast with usb-6008 with labview tia sal22

    Hi all

    I can get this vi to work if they are distinct from the vi but I can't join them together

    Example of my error:

    If buffers are set to 0 the freq counter increment works, but no sound
    If the buffers are set to 1 the audio works fine but is not increment the Freq counter
    If the buffers are attached to more 1 clicks and pops are coming

    That's what I'm doing:
    (1) have the frequency of increment of my internal sound card to a certain level as .01hz a second until he gets to 20 000 hz

    (2) use my device usb-6008 daq, which is connected to the same machine to measure the voltage at the same time. (I am in a position very low voltages between 1-5volts)

    (3) output to a worksheet text file which will show you:

    time in seconds, frequency, voltage
    0,400.01,2

    1,400.02,2.5

    2,400.03,1

    I'm a bit confused about how connect the increment and the audio during the measurements with the usb-6008 housing on the same machine
    at the same time and in the same VI.

    Anyone have any ideas?  I'm using labview 8.5
    TIA sal22

    Ha ha you have been deceived by a dynamic thread. Insert a convert from Dynamic Data Express VI (Palette to own: Signal handling screw Express) between the daq read and build the array function. Then it won't work. Now the value in the dynamic data is only converted to a numeric value

  • 2 channels of AI on a data acquisition with the range of different sensitivity

    This vi is based on the 'new project' state machine on the home screen at the start of LV.

    A time loop is parallel to the main loop of the state machine, shown in the picture.

    It works continuously until you press the Exit button.

    The problem seems to be in start this... > read >... stop start > read >... stop along the error line.

    The reason for this clumsy arrangement power is measured voltages are in two lines of different sensitivity.

    The shunt voltage is small and needs-. 2 to the range of V.2. The load voltage is greater and 09:50 V range is good.

    In the initializing state, two separate vi 'create a channel' have been used to specify the range of voltage to the physical channel. The corresponding tasks are sent via via local variables.

    DAQmx errors happen randomly, sometimes the first iteration, sometimes the 50th.

    I tried to disable one or the other start > read > stop for the shunt voltage or load.

    I tried replacing them with the DAQ assistant.

    I tried various DAQmx vi: "wait" and "accomplishment of the tasks by resource cancel selected".

    But error-50103 "specify resource is reserved" keeps popping up.

    Is it possible to create two tasks on the device even when they are not used at the same time?

    The only reason is to measure in two voltage ranges.

    Win 7 Pro 64-bit

    2014 LV database

    Data acquisition equipment: USB-6210

    Thank you.

    This has been discussed many times. Do NOT use separate tasks. You can use different ranges for different channels with a single task. Just wire the task from one channel to another channel to create task.

    You also use local variables when they are certainly not needed.

  • Pulse counting with USB 6008

    Hello world!

    I have a project with USB 6008. I want to count impulses (for special features: count the pulses of the encoder) use USB 6008. I wirite with DAQmx to test a simple. But it do ' t run. Please see and help me to do this exercise. I just borrowed 6008 USB so I don't have any experience with USB 6008. Thank you! It's funny.

    Looking at the PFI0 manual (pin 29) is correct and I don't see anything wrong with the code and example should work. I have a M-series card, not a 6008 and it works for me. This error code is meaningless if. Are you sure it's the number?

  • Lack of external input clocked with USB 6008

    I'm a little confused on how to extract digital data without an external clock.  I guess that there is a way to do it, or this device would not do any digital input advertising, but I don't understand exactly how that would work.  Apparently, my only option is ' we demand. "

    I take data frames occurring about every 1 ms with a frequency of 950 kHz clock.  I have this completed with a more sophisticated Board using a clock from the data source.  We now want to translate this to the USB-6008, so we can use the 6008 OEM like a daughterboard for our data source.

    Avoiding him depends on the software you use, the pc, the os, etc. Whenever you want to do a reading of a line, you do a Read DAQmx. Absolutely no correlation with a time given because windows is not even close to deterministic. You may have readings in the low khz range.

  • Amplification of Type K Thermocouple for playback with USB 6008 at high temperature

    I'm looking to amplify a K type thermocouple, so that the signal can be read with a bit of precision by a USB-6008. I watched the AD595 chip, but it indicates a maximum useful temperature of 100 ° C and I'll need to read up to 700 C.

    Is there another amplifier chip that would work up to this temperature, or should I resign me to use the unamplified signal and get a very inaccurate (~ 30/division) the temperature reading?

    The AD595 has a range of-200 C to 1250 C, here is the data sheet:

    http://www.MNE.PSU.edu/Sommer/me445/AD595.PDF

    -AK2DM

  • DAQmx data acquisition with persistent error of nyquist

    Hi, I created a multi channel data acquisition vi (accelerometer 2 and 1 sound pressure) using models for producer.   The vi is attached. Thanks to labview 2011.  I get the error of nyquist (2 enclosed) when you make a bandpass filter between 50 to 5000Hz.  This happens despite having put my sampling rate to 22050Hz.  When I checked the output of wave I noticed that the signal has a dt 1 s.  The text output to check the result.  I could not understand how this is so since I had set the sample rate to 22 k Hz.  Any help will be much appreciated.  Thank you.

    I would do something like that.  You must calculate the dt of the set (with the recipricol) sampling frequency and use to initialize the shift registers.  This way you only need to change 1 constant if you need to change your sample rate.

  • Loss of communications with USB-6008

    I have a USB-6008 be used to control a couple of valves with its digital output channels. The digital output channels are a relay that energizes the solenoid valves (valves are 115VAC) switching. The USB device is connected to a USB port on laptop.

    The software/hardware was working fine, then some time while it was connected there was a power surge. There was a 2 a fuse on the 115 VAC line that blew.

    After this communication surge was no longer able to be implemented with the box USB-6008. Is it possible for a power surge affecting the USB device, even if his power comes from the power supply of 5V USB?

    Things I checked so far.

    Restart the computer with the USB unplugged and start back up - no connection

    Check the Device Manager for the USB device to be present - not visible in the Device Manager

    Check MAX for device - does not present as gift

    Check the wiring to the son of course drop - no defeated cables

    try on different laptops - connection

    Connect other USB devices to the laptop USB - another fine feature of devices USB slot

    Check the + 5V channel on the USB device and do not read a voltage

    Any indication seems to be that, somehow, the USB device has been damaged during this surge? Is there some kind of diagnosis offline, I do without seeing the unit online?

    Hello the plough,

    It looks like the surge caused a sort of feedback of the valve of your USB device. This USB device is not designed for industrial applications and can easily be damaged in the situation you described. For a USB device with a greater ability to withstand this type of power surge, you should watch the box USB-6525. A better solution would be a CompactDAQ or CompactRIO system with a NI 9401, which is designed to withstand 1 000 Vrms, verified by a 5 s dielectric withstand test.

  • Real-time display at the high frequency of data acquisition with continuous recording

    Hi all

    I encountered a problem and you need help.

    I collect tensions and corresponding currents via a card PCI-6221. While acquiriing data, I would like to see the values on a XY graph, so that I can also check current vs only voltage/current / time. In addition, data should be recorded on the acquisition.

    First, I create hannels to analog input with the Virutal DAQmx channel create, then I set the sampling frequency and the mode and begin the tasks. The DAQmx.Read is placed in a while loop. Because of the high noise to signal, I want to average for example every 200 points of the current and acquired for this draw versus the average acquisition time or average voltage. The recording of the data should also appear in the while loop.

    The first thing, I thought, was to run in continuous Mode data acquisition and utilization for example 10 k s/s sampling frequency. The DAQmx.Read is set to 1 D Wfm N Chan N Samp (there are 4 channels in total) and the number of samples per channel for example is 1000 to avoid the errors/subscribe for more of the buffer. Each of these packages of 1000 samples should be separatet (I use Index Array at the moment). After gaining separate waveforms out of table 1 d of waveforms, I extracted the value of Y to get items of waveform. The error that results must then be treated to get average values.

    But how to get these averages without delaying my code?

    My idea/concern is this: I've read 1000 samples after about 0.1 s. These then are divded into single waveforms, time information are subtracted, a sort of loop to sprawl is used (I don't know how this exactly), the data are transferred to a XY Chart and saved to a .dat file. After all that's happened (I hope I understood correctly the flow of data within a while loop), the code in the while loop again then 1000 samples read and are processed.

    But if the treatment was too long the DAQmx.Read runs too late and cycle to cycle, reading buffer behind the generation of data on the card PCI-6221.

    This concern is reasonable? And how can I get around this? Does anyone know a way to average and save the data?

    I mean, the first thing that I would consider increasing the number of samples per channel, but this also increases the duration of the data processing.

    The other question is on the calendar. If I understand correctly, the timestamp is generated once when the task starts (with the DAQmxStartTask) and the time difference betweeen the datapoints is then computed by 1 divded by the sampling frequency. However, if the treatment takes considerable time, how can I make sure, that this error does not accumulate?

    I'm sorry for the long plain text!

    You can find my attached example-vi(only to show roughly what I was thinking, I know there are two averaging-functions and the rate are not correctly set now).

    Best wishes and thank you in advance,

    MR. KSE

    PS: I should add: imagine the acquisition of data running on a really old and slow PC, for example a Pentium III.

    PPS: I do not know why, but I can't reach my vi...


  • I can read two-channel USB-6008 using THE Signal Express?

    Hello world!!

    Is possible to read the two analog inputs at the same time?

    Example: Using Signal Express, I need to read the (channel 0) analog input and analog input (channel 1) at the same time.

    I try this but, the signal on purpose gives me an error message saying that I can't read several channels at the same time using the USB-6008.

    Is this true?

    Thank you

    Ivo João

    André,

    Grato definition of pela.

    SUA ajuda muito util faith.

    SDS,

    Ivo João

  • Frequency of maximum output with USB-6008

    I have a digital circuit containing 3 exits, 3 inputs digital and analog 1 entry in labview with my USB-6008. When I connect to the entrance (via the DAQ assistant) analog, the output frequency is reduced to a maximum of 27 Hz, but I need 50 Hz. is possible to do?

    Ah.  You'll need a DAQ better than the 6008, to do.

    There is no train generation feature buffering or the pulse on the 6008.  The outputs are all timed by the software, you cannot build a table and tell the 6008 in the output array.  Out of the 6211 must be able to produce this signal.  Series X-series Renault will do what it takes; the USB-6341 is probably your best option.

  • data acquisition in real time using the module sim900d (not arduino0

    Hello

    I'm doing my final year project. I'll send the data from a remote location using sim900d for the other module (sim900d) connected to my laptop. Now, I need to import data acquired through sim900d connected to my laptop in Labview. But I don't know how. Kindly guide me

    I looked for it and thus to find a link that uses the serial port to send to commnads

    http://www.codeproject.com/tips/583315/using-SerialPort-and-at-commands-for-querying-cell

    so now send orders AT serial number is easy. first of all examine the emitting part. for this you need VI config series VISA and VISA series write VI. You can serach these VI by right click I your new VI block diagram and press search on the top left corner. Here you type the serial port and you will get a list of the VISA series live.

    Here is also a link to or

  • Problem with USB HUB using Windows 7 on Bootcamp

    I have an iMac when I installed Win 7 with Bootcamp. I have problem with USB hub. If I connect USB devices (printer, iphone... etc...) directly to my computer, it works without any problem. But if I connect them through USB hub, that they do not work properly. The sound instantly invites you, but certain peripheral functions partially and some not at all. I tried several USB hubs... same problem for all. Any solution? Thanks a lot for your answer.

    Hello

    I suggest you to see link and check.

    Tips for solving common driver problems

    http://Windows.Microsoft.com/en-us/Windows7/tips-for-fixing-common-driver-problems

    I also suggest you to contact the apple support and check.

    http://www.Apple.com/support/

  • Measures of true bipolar voltage with USB 6008/6009

    The 6008 or 6009 to make true bipolar (positive and negative voltages referenced to GND) measurements?  If not, what is the solution to purchase cheaper data this feature?

    Thank you.

    The question of unipolar vs bipolar vs bipolar Pseudo-aleatoire also was mentioned in this thread.  The 6008 6009 use bipolar-only mode and load the setting differential input or CSR.  Please note that {unipolar / bipolar / Pseudo-bipolaire} is independent of {differential / CSR / Pseudo-differentiel}.

    The 6008/6009 don't use 'Pseudo-bipolaire', which means that each differential input should be positive with respect to the ground.

    Best regards

  • Size of USB data acquisition 2008/USB 2009

    We have several USB 2008 Renault in my company, and we plan to go to a USB 2009. We use them in some regions of space is counted rather however, and I was wondering if there is a difference in the physical size of 2009 compared to the 2008 USB USB.

    Thank you

    There is no distinction between 2008 and 2009. Could you be confusing a with a 6 2 and talk about the 6008 and 6009? If so, the dimensions are in the User Guide , which is something that comes with the units.

Maybe you are looking for