I2c Using cDAQ 9174

I am trying to communicate to an mpu6050 on a g-521 breakout board. I have a cDAQ 9174 with a 9205, 9211, and a 9401 c series modules. I am trying to talk to it using I2c protocol. I am just getting started here and havnt found much information on this. Can anybody give me somewhere to start?
Thank you

Defested wrote:
I am trying to communicate to an mpu6050 on a g-521 breakout board. I have a cDAQ 9174 with a 9205, 9211, and a 9401 c series modules. I am trying to talk to it using I2c protocol. I am just getting started here and havnt found much information on this. Can anybody give me somewhere to start?
NI 9401c can be used to implement the digital communication protocol (I2C in your case)
Here you should look at: SPI and I2C Driver API
I am not allergic to Kudos, in fact I love Kudos.
 Make your LabVIEW experience more CONVENIENT.

Similar Messages

  • Slow Log Rate Needed using cDAQ-9174

    All,
    I am logging strain data for a thermal sweep we are doing on one of our products.  The sweep occurs over a long period of time (48 hours) so I realistically want to log one signal per second.  I tried using a continuous sample and then subsetting it, but I can't get it to 1 sample per minute which is where I want it to be.  Does anyone have any suggestions on using the subset (or another method) to slow down the capturing of data for the log?
    Thanks,
    Adam

    Nice, sounds like you've figured it out.
    The 9235 does indeed have a minimum sample rate of 794 S/s when using the internal timebase.
    For future knowledge, here's what I would do to simplify things a little:
    Set your "Samples to Read" to match your "Sample Rate".
    -Since we have a limitation of nothing less than 794 S/s just set them both to 1k for simplicity.
    Create an Amplitudes and Levels step and select your strain channels as the "Export to DC Value"
    -This is a step I use for almost every test, strain especially. It will take your raw Waveform signal and turn it into a Scalar signal. Honestly not sure whats going on behind the scenes here but there's some averaging it does between the samples to read and the sample rate. Basically it works out to be a smoothing filter which yields a much cleaner signal for your final output signal.
    To determine your actual sample RATE when recording scalar signals, divide the samples to read into the sample rate.
    In our case 1000 samples to read divided by 1000 Hz is 1 S/s. Try it, I think it'll be inline with what you're looking for. I just ran a test file to be sure and with the above settings I recorded for 10 seconds and got 10 data points in my data file.
    I never save my data to log file either, I save to ASCII exclusively but the results should be the same whether you use the "Record" option or "Save to ASCII" step.
    Hope that helps!

  • Memory Overflow cDAQ 9174

    I running into an error (-200361) when I run my state diagram using a cDAQ 9174 chassis.  I have a 9214 is slot 1, a 9237 in slot 2 and, 9207 in slot 4.  I have tried a couple of workarounds to get this VI to work, but I have not yet been able to figure it out.  I have a hard time believing this is hardware related and am thoroughly convinced it is because of the way I have wired this VI together.  I have looked at all the links provided in all of the responses I could find to similar problems without resolution.  What data is being written so fast that the processor is unable to keep up?  See the attached VI.
    Solved!
    Go to Solution.

    I made the above mentioned changes, cleaned up some unecessary/repeated functions and am now faced with lossy data.  You can see in the attached picture, every few seconds or so the data reports zero.  What is happening that is causing this?
    Attachments:
    LossyData.jpg ‏356 KB
    ThermistorStateMachine.vi ‏129 KB

  • Using cDAQ timers to repeat a hardware-timed finite-sample pulse train clock

    Hi all,
    As part of a complex project, I must implement an acquisition hardware interface for a linear motion sensor using the Synchronous Serial Interface (SSI) output common in industrial motion control. (I have a fair bit of experience in digital electronics, but I'm new to hardware timer-synchronized digital I/O in LabVIEW.)
    To do this, I need to create a hardware-timed bursted pulse train TTL clock signal. Each burst consists of 25 high-low transitions with a full-cycle period of 2.67 microseconds (375kHz). The output must then be held high until the next burst, which occur at 1ms intervals.
    Using cDAQ timers and a NI 9401 (based on the example at http://www.ni.com/example/30256/en/), I've been able to create the pulse train burst as described (see attached VI image). Next I need to configure another timer to trigger this burst to repeat at 1ms intervals.
    Does anyone have any pointers about the best way to accomplish the hardware timing for repetition of the pulse train?
    Any suggestions of alternative strategies or observations as to the ways my noobish code is stupid or inefficient are welcome as well!
    Thanks!
    Solved!
    Go to Solution.
    Attachments:
    Hardware Timed Pulse Train Clock.jpg ‏102 KB

    Hey Ryan, 
    A picture of the behavior you are seeing would be helpful. The NI 9411 should only be reading 50 bits every 1 ms.  
    It may not be possible to read 25 bits (do you mean 50 bits? 25 high 25 low) and push it to a queue without encountering an overflow error. If you take a look at the above code the digital input will receive 50 sample clocks every 1 ms. This is equivalent to acquiring 50 points every 1 ms which is an acquisition speed of 50 samples/1 ms=50 kHz. The read loop must keep up with the 50 kHz rate otherwise the buffer will overflow. In the above example I’ve set the read to pull 5000 samples (x) with the assumption that the loop will take less than or equal to .1 seconds (y). This yields a software acquisition speed of 50 kHz (5000 samples/100 ms). If the loop speed is faster than 100ms then the 10 seconds timeout on the DAQmx read will allow for the read to block so the FIFO may be filled.
    The options available for question 2 are below. They may be used separately or in conjunction.
    Move the DAQmx Read for the NI 9411 to its own independent while loop, set the DAQmx Read to acquire 50 samples, do not graph the data, and pass the data to a Queue for processing in a consumer loop. This will increase the loop speed which may allow you to keep up with the 50 kHz acquisition speed. This may not work because the loop speed will need to be 1 ms or less.
    Increase the value of the Samples per Channel control that goes into the DAQmx Timing VI. This will increase the DAQmx Software Buffer size. This buys time until you receive an overflow error because the DAQmx Software Buffer is being filled faster than samples are removed.
    Read in 5000 sample chunks (producer loop), push this to the queue, and perform the analysis in 50 bit chunks (consumer loop). The additional queue created should allow for the acquisition loop to keep up.
    Regards,
    Izzy O.
    Product Support Engineer
    ni.com/support

  • USB 9162 VS cDAQ 9174

    Bonjour,
    J'ai déjà crée deux autres post sur mon problème mais cette fois je m'attaque au produit lui même!!!
    http://forums.ni.com/t5/Discussions-de-produit-de-NI/Probl%C3%A8me-DAQmx-buffer-convertion/td-p/1187...
    http://forums.ni.com/t5/Discussions-de-produit-de-NI/cDAQ-rapidit%C3%A9/m-p/1184553#M35939
    Mon application met 250 ms à faire un traitement du signal lorsqu'elle fonctionne avec le NI USB 9162, et lorsqu'elle fonctionne avec le cDAQ 9174, elle met 750ms!!! Avec exactement les mêmes paramètres d'acquisition, de traitement et d'affichage.
    Vous voyez le problème??
    D'où ma question: le transfert de données par le hi-speed USB 9162 est-il plus rapide que celui sur le cDAQ 9174??
    Si c'est le cas, comment ça se fait? Et y a t-il un moyen d'overclocker le cDAQ?
    Je souligne le problème, car si celui-ci s'avère exacte, l'utilité de mon matériel serait remis en cause et cela m'amènerait à revoir mon jugement sur NI  !!!
    Merci
    Arnaud

    En faite cela concerne simplement le temps d'acquisition, car j'ai essayé sans le traitement du signal et le problème est toujours le même.
    En faite, au départ je suis parti d'un vi express!! Ensuite j'ai généré le code pour comprendre comment cela fonctionné et pour avoir accès au paramètres style sensibilité!!
    En générant le code, un sous-vi se crée (voir mon autre post 1er lien) ou on retrouve tout les bloc DAQmx (créer,..., supprimer), et avec les différents essais je m'aperçois que c'est se vi qui est plus lent ou du moins c'est se qui se passe qui est plus lent en fonction du USB-9162 ou du cDAQ 9174!!!
    D'ou la question sur la rapidité d'echange des données entre les deux USB!!!!

  • NIMax NI cDAQ-9174 Simulation

    Hi everyone
    I am trying to simulate a NI cDAQ-9174 in NIMax.
    I am right clickiing on devices and interfaces, creating a new simulation, selecting compactDAQ Chassisand choosing NI cDAQ-9174.
    I get an error message that says "Create new failed. The required device information was not present on the target. Please update, install, or re-install the software associated with this device".
    I assumed I didnt have the relevant driver installed so I went to the NI website and went to NI cDAQ-9174 Support, and under drivers it just has NI-DAQmx 14.5.1 listed, which I already have installed on my machine.
    Any ideas why the new simulation device won't install?

    Hi Dawud,
    no problem with my MAX5.3.3 (with LabVIEW2011).
    It seems you did not install the complete DAQmx driver with all needed parts…

  • How to create a trigger using 9211 modules with cDAQ-9174?

    I am trying to create posttriggered acquisition with an analog trigger using 9211 modules that are reading 4 thermocouples.  I would like the data aquisition to start once a temperature of 90 degrees C is reached. I am not sure what I should put for the source of my trigger in my VI.  Are these modules capable of using triggers, and if so, how do I go about creating one?  Attached is the VI, thanks.
    Attachments:
    Thermocouple.vi ‏151 KB

    The 9211 doesn't have any analog triggering capabilities.  You'll have to implement the trigger in SW (like this example).
    Best Regards,
    John Passiak

  • Unable to read 5th channel using cDAQ 9178 with NI 9219 modules

    Dear LabView user,
    I've made a VI for reading the measurements of a couple of LVDT sensors, a load cell and a couple of strain gauges. When I connect 4 of these sensors to my cDAQ 9178 with using 1 slot of NI 9219, then there is no problem for my VI. But if I use 2 modules, and connect the 2 LVDT sensors and the load cell to the first module, and the 2 strain gauges to the 2nd module, then my program only will show the readings of the first module and the readings of only 1 strain gauge on the 2nd module. I've found that there occurs an error for the 5th channel in the 'zero' state. It says my buffer size is too small... How can I solve this problem? I can't work with finite samples because it is a continious measurement. 
    I also have the cDAQ 9171 USB module, if I only connect 4 sensors to this module, the sample rate is high (100 Samples/sec), when I use the same configuration, but connect this with the cDAQ 9178, the sample rate is much lower however I use the same NI 9219 module to fill the slots. Is there some kind of setting I need to make when switching over to the cDAQ 9178?
    I've attached my VI.
    With kind regards,
    Pete

    Dear RavensFan, 
    Thank you for your answer.
    "Have you tried swapping the modules between the slots and see if you still have the same problem or if it moves?"  When I use the cDAQ 9178, I always use the first 2 slots next to the power suply and the usb connection, you mean that I should try for example the 4th and the 5th slot or other slots? I will try this on Monday, and I will let you know.
    About the states machines inside a state: How is it possible then to use several buttons, like start and stop measurement and the 'home' button inside the state "measurement"? Should I make another simple state machine inside this state? 
    What about that 5th channel that I'm unable to read? The problem happens in my "zero" state: to acquire my "zero elements", the loop does the job for the 5 channels for the first 8 samples, after that, it doesn't want to sample the 5 channels anymore, it only does for 4 channels... It's something about the buffer size, but I don't know how to fix that.
    With kind regards,
    Peter

  • What is error 200284 with counting ticks?

    Hi,
    I am trying to write a VI that will count ticks of a rotating encoder wheel. I was able to run the test panel in MAX and count total ticks during rotation with no problem.
    Next, I tried writing a VI that would do the same, but, I am getting errors that I do not understand, especially,  " 200284, Some or all of the samples requested have not yet been acquired."  It also tells me to supply an external clock...how do you do that, and how do you know which external clock is the correct one?  I tried many clock options, but, continue to get this error...
    Ultimately, I would like to have a VI that counts ticks per unit time, e.g. ticks/100ms etc.  For now, I am trying just to get it to count total ticks, and I am stuck here.  Really stuck.
    I am using cDAQ 9174 and NI 9401.
    Thanks!!!  Please help!!!
    Dave
    Attachments:
    forum_april_11.vi ‏21 KB

    Hi dav2010,
    An explanation of error -200284 can be found here. Furthermore, I would recommend starting from a shipping example, when developing your counter measurement task. Lastly, the NI cDAQ-917x User Manual contains information about the various counter input applications, starting on page 5-3.
    The default sample mode for the DAQmx Timing.vi is Finite. The sample clock for the counter task(s) may be set to Continuous but if the sample clock is not set to Continuous it is set to the default value (Finite). When the sample clock is set to finite without the samples per channel wired, it will set a default buffer size based on the rate. Once the buffer is full the sample clock stops and the counter task stops latching the counts because the clock source has stopped. The counter task(s) which are set to continuous will continue expecting more clock edges but will timeout giving error 200284 when it doesn't receive any more. Setting the sample clock source to Continuous will allow the clock to continue providing clock edges for the buffered counting task(s).
    Tunde S.
    Applications Engineer
    National Instruments

  • DO wave in step-ncreased frequency, possible?

    Using cDAQ 9174 + NI 9402 DIO,
    To generate DO wave in gap-step-up mode,   Is it possible and how to set that step-increasment?
    for example : one pulse-width + step-changing gap time between pulses

    Yes, you can do this with a digital output task by writing the correct waveform to the buffer, or with a buffered counter output task using implicit timing (see this example).  I'd suggest using the counter output (less data has to be transferred, higher timing resolution, easier to program).
    Best Regards,
    John Passiak

  • I2C data send using USB-to-I2C converter

    Hi guys me again
    Just when things started to look good another trouble comes
    We thought we will buy NI-8451 to implement I2C. We contacted NI also but suddenly another student comes and says we can implement I2C using Devantech USB-to-I2C converter..
    Can it be implemented using VISA(all operation of I2C like read, write, ack, clock stretching)???
    Thanks in advance

    I never used that device, but ran across it while searching for alternate I2C and SPI devices. That uses a standard FTDI interface chip, so the device shows up as a serial device. So, yes, you'd be able to use VISA to communicate with it. Please check the documentation for the device in the future.

  • Using crio9004 with digitalI/O 9403 to read I2C

    Hi every one,,
    i want to read my gyro sensor using cRIO9004 and the module NI 9403
    is it possible to do so ??
    can i have any tutorial or guide to do so ??
    thanks

    I also want to connect to i2c using NI 9403 ans cRIO 9076
    did you manged to do it?
    I know that you need to add pull-up ressitor and install i2c driver API avilable online
    http://sine.ni.com/nips/cds/view/p/lang/en/nid/210637
    also ther is possible way to use full fpga soloution example
    http://www.ni.com/white-paper/3479/en/
    https://decibel.ni.com/content/docs/DOC-1151
    Or Hirshfeld
    אור הירשפלד

  • Frequency counter unreliable using rotary vane anemometer

    I have set up an anemometer to measure air flow speed, with the signal being acquired by a 9402 module in a cDAQ-9174 chassis (4 slot). I am using Signal Express 2011 to program the instrument.
    I have set up a frequency counter task, using a maximum frequency of 1.8 kHz a minimum frequency of 250 mHz, rising edge and 1-counter (low frequency). The output is scaled using y = 0.0111x + 0. This gives 20 m/s when the frequency is 1.8 kHz.
    The readings given by Signal Express give a very noisy signal, at a frequency much higher than the bandwidth of the anemometer. The range is in the order of 20% of the mean. I have attached a PDF of the signal, for two different air flow sources, the seproj file and the tdms file for one of the runs. I have also observed that the counter output is rounded to the nearest multiple of 10, e.g. 490, 470, 480, 480, 470, etc.
    Is this consistent with a digital bounce issue? Is this consistent with an earthing issue? Is this consistent with a sample rate issue? Any other ideas for investigating this issue?
    thanks
    Attachments:
    EXPT 20 - ANEMOMETER NOISE.pdf ‏49 KB
    EXPT 20 Anemometer Noise.seproj ‏637 KB

    I have logged the voltage signal coming from the anemometer, using our 9239, a report of a few cycles is attached as a PDF. The graph clearly shows a small digital bounce. The noise is small compared to the signal, is there any way it can be filtered when acquired by the 9402?
    Other tests that I ran showed a background noise in the order of 50 microVolts and a frequency of 50 Hz, this is very likely a background noise from a power supply (we run at 50 Hz in Aus) but is many orders of magnitude smaller than the signal, I assume it would be ignoredby the 9402.
    Attachments:
    EXPT 20 Anemometer Noise Voltage.seproj ‏261 KB
    EXPT 20 Anemometer Noise Voltage.pdf ‏19 KB

  • Using counter and output at the same time

    Hi all,
    I'm using a NI 9401 high speed digital IO module (with a cDAQ 9174 chassis) that has 8 digital IO channels, to perform two tasks at once in Labview. I can get both of them to work independantly, but when I put them together to run simultaniousy in parallel, it does not work. My two tasks are simple: 1. Generate a continious pulse train square wave output using one of the counters linked to one of the output channels (PFI7) and 2. Output a 'high' (5V) with one of the other channels (PFI1)  when a certain logic condition is met.
    When I run my code (attached), the pulse train output works, but the output on the other channel doesn't work when the logic condition is met. I should note that the logic condition is that when RMS current exceeds 3A, I want to output a 'true'. I am measuring current using another analog input card connected to the same chassis and this part is all working well. I think the problem is that there is some sort of interference between the pulse train output which is linked to PFI7 and the other output which is PFI1.
    I know there is a limitation with the 9401 card that if the channels are in two groups, 0-3 and 4-7, and you must use a whole group as either all inputs or all outputs, but I don't think this should affect me, as I am using both my channels as outputs anyway, plus I am using channels 1 and 7 anyway.
    If anybody has any ideas as to what could be wrong with my code, I would greatly appreciate it.
    Attachments:
    DSDBI Vegetation testing program.vi ‏115 KB

    OK, you've shot yourself in the foot.
    It is a very bad idea to modify the shipping examples.  Like testing bungee cords by juming off a cliff-  sometimes you only get to try it once.
    Now why on earth did you not add the DI code following the example's method of wiring the error chain and closing the task after the loop?  You have duplicated code in both cases of your case structure the only difference.........(wait for it..........) There is a true constant in the true case where the false case contains a false constant.  A wait for task complete is unnecessary for a 1 sample DI task-  really the write just completes and the task stops all by itself.  the only needed thing here is a DI Write 1 Ch 1 Sample no case structure, and wire the compare output to data to write.
    You should probably add a control task vi with a "Reserve" input prior to each start task on the CO and  AI Tasks and after the Create Task on the DO.  Its a bit technical but the result is like taking vitamins- you'll just get better performance.
    Jeff

  • Ran updates, LabVIEW & MAX will no longer recognize my cDAQ?

    As stated, I ran updates yesterday through NI Update Service... it suggested SP1, and a couple of others.  Ran them, and today my computer doesn't see my cDAQ (9174). 
    Running...
    Win7 Pro 64bit
    LabVIEW Professional Ver. 12.0.1f2 (32-bit)
    MAX Ver. 5.4.0f0
    Tried to run my VI I was working on day before... obviously, if it's not seeing the cDAQ then it can't get data... ran MAX and it still shows up on the list, but doesn't' register as being hooked up.  I tried powering it down and back up, rebooted computer, restarted LabVIEW, unhooked the unit from the hub it's normally hooked to and retried everything above with it plugged directly into my laptop.... nada. 
    I'm at a bit of a loss here.  Anyone have any suggestions?  I'm going to take the laptop over to my other systems and see if it recognizes any of them.
    Thanks!
    Chad

    Kyle,
    Yes, I have taken the hub out of the equation.  Correct, I have plugged this laptop into my other control pannels that are running cDAQ's and they are not recognized either.
    Other computers question... I have two laptops that I use in lab, the one currently in question (call it laptop1) was working fine until I ran the suggested updates on it... SP1, and some others and that brings us to where we are now.   My other laptop (laptop2) was working fine until I started running the suggested  updates on it, and now it's doing the same thing.
    FYI, I have a support ticket open with NI, (Ref#-7383377).... Leah, has had me uninstall the DAQmx drivers and install the newer drivers... still no recognition in MAX and now my computer doesn't chime when I plug in the unit directly.
    Nor does the cDAQ show up in the device manager anywhere. 
    Tried something....
    I have a spare cDAQ that hasn't been used yet.. I plugged it in and it seem to recognize it until I ran MAX and it doesn't show up in there either.  It did chime when I plugged it in, and it told me it was installing drivers.... Seemed to work for a second, but now it's telling me that it's an "Unknown Device" under the Universal Serial Buss controllers.
    Still no joy in the device manager with my original cDAQ.  I plugged in the spare, it did it's thing... I unplugged it, and plugged the original back in, I got a chime, but no recognition... after that, no more chimes and doesn't show up in the Device Mngr at all.
    Other ideas?
    Thanks!
    Chad

Maybe you are looking for

  • I need to delete Creative Cloud software from my PC and install on a new iMac.  What do I do first?

    I have had a Creative Cloud membership for several years and have installed all the related software on my PC.  I recently purchased an iMac and will be decomissioning my old PC.  What steps do I need to take to deactivate and unistall the software o

  • App installed halfway - now can't get rid of it

    My wire got disconnected halfway installing an app. Now it's forever stuck at the 'waiting' status. I'd like to get rid of the app and put it on again, but I can't. There's no X for me to click on, when I'm on the iPhone to uninstall. iTunes uninstal

  • Run a NAS as Time Machine on a MacBook Pro

    Run a Synology DS211  and trying to get Time Machine on my MB Pro (Lion) to work with my NAS as backup. It show work...but...My Macbook Pro doesn't recognize the NAS when opening Time Machine, it doesnt show the NAS as an option. However, in Finder i

  • Movie won't play now - searching for movie data in file "Rolling Credits"??

    I have a movie I made with iMovie (I have v3 or so). I know for a fact it used to play (it's saved as an MPG-2) on my laptop (10.3.9). All of a sudden, when I try to play it, it says "searching for movie data in file "Bounce Across 01"", or "Rolling

  • RIpped cable - a way to make it last longer?

    Here's what happened to my MacSafe power cord. I noticed that the cable itself, instead of being smooth, became more and more twisted. The plastic "clip" had never seemed to fasten on that well from the start. Finally, the rubber insulation at the ca