Re: DAQ write+read analog channels

Thank you Dan,
The device used is NI_USB 6211 and the tests will be done by another person.
So from your email I understood that is not recommended to use Hardware Timed Single Point.
 And just for my information: in your example what happened if I will try to read two adiacent analog channels (that means analog->multiple channels->single measurement)? It is possible? I'm asking because then we have a multiple point...right?
Do you think this USB device will work at 5 KHz rate?
Anyway it seems it must be used sometime even at 10 KHz.
So I still waiting for a guaranted solution!

unintentional dup post.  see here for discussion
Jeff

Similar Messages

  • DAQ write+read analog channels

    Hi,
    I need some urgent help to solve a simple problem:
    My job is to write an analog channel to a DAQ device and then to read two analog channels from the same device.
    These should be done at the 5 KHz rate.
    For smaller rates I can do it using normal loops (or timed loops). But I don't know how to do it using DAQ features.
    Please give me an example.
    I have found something but I am not sure if it can be used in this way (see the attachment)
    Thank you!
    Solved!
    Go to Solution.
    Attachments:
    DAQ Test write analog+read analog.vi ‏49 KB

    Mcdan wrote:
    Quick correction to my last post... I did not notice that your original VI called DAQmx Start.  In this case I think it is preferred to call start before your loop rather than calling commit, since start will put the tasks in running state outside of the while loop.  In Jeff's proposed change, the tasks would need to transition from committed to running and then back to committed each iteration of the loop.  As originally written, the tasks will be in the running state before the while loop and remain there until they are cleared.
    Dan
    Dan- You missed the Autostart(T)-  and, ALL tasks go from committed to run and back to committed,( unless abnormally terminated by a explicit abort while running starting from a state other than committed,) the commit state is the least overhead for any task that is not continuous or regenerating.  The original post started the task from Verify state- and required DAQmx to reserve and commit the DAQ resources for each read or write and then (since it Started from verify) implictilly uncommit and un reserve the resouce after "running" in each loop iteration.  Sean N "Popped-the-hood" and gave difinitive advice on the DAQmx task state handeler in this post (warning ----wrap head with duct tape before reading) 
    Sorry to derail the thread but, accuracy counts too.  I can't let a user stay stuck behind an "8-ball" with misconceptions (nice avatar by the way)
    Jeff

  • DAQ write DAQ read synchronisation

    Hi,
    I want to create the Low Pass Filter Tester with TestStand. I want to generate sine wave with frequency form 1 to 1k Hz and read amplitude before and after the filter. First of all I have to ensure synchronisation between DAQ read and DAQ write[ http://i79.photobucket.com/albums/j122/thor_tory/1_zpsab4a4c00.png~original ]. I already used a bit modified examplary sine wave generator to analog output VI and read from analog input VI. I put them as subVIs into one VI and then called it in TestStand although the read apmlitude was in many cases not even close to the generated amplitude (like the read was performed too soon). I put all subvis one by one, I also tried flat sequence structure but it was not ok because it stopped in first stage while generating sine wave.
    Have you any idea how to make synchronisation between generating signal and acquiring amplitude? And what to match it to given frequency (value of frequency is increased in TestStand)?
    Michał
    Solved!
    Go to Solution.

    Thanks for showing me that example, I have somehow problems finding it myself What is the difference in using that built in clock?like in this example:https://decibel.ni.com/content/docs/DOC-26326
    Having set the acquisition finite I get an error:
    Possible reason(s):
    Attempted to read a sample beyond the final sample acquired. The acquisition has stopped, therefore the sample specified by the combination of position and offset will never be available.
    Specify a position and offset which selects a sample up to, but not beyond, the final sample acquired. The final sample acquired can be determined by querying the total samples acquired after an acquisition has stopped.
    Attempted to Read Sample: 50
    Property: RelativeTo
    Corresponding Value: Current Read Position
    Property: Offset
    Corresponding Value: 0
    Task Name: _unnamedTask<4F>
     I've been changing all the values but I keep on getting that error. Is there any way to make everything dependent on the frequency of generated signal(I know it is )? I mean like sine wave f = 100Hz
     so the f_sampling = f * 2.5 (to prevent aliasing), same thing with samples to read, does the amount of them have to be the same for every channel?
    Michał

  • I have a DAQ Assistant configured to read multiple channels at the same time. When I wire a graph indicator to the output, I see all of my signals jumbled together. How do I split them up into seperate signals?

    I have a DAQ Assistant configured to read 2 channels at the same
    time. When I wire a graph indicator to the output, I see the 2
    signals jumbled together. How do I split them up into seperate signals?
    When I wire any type of indicator it is showing just one output of a single channel.
    I want 2 indicators showing 2 different signals as expected from the 2 channels configured. How to do this?
    I have tried using split signal but it end up showing only 1 output from 1 signal in both the indicators.
    thanks in advance.
    Solved!
    Go to Solution.

    Yes you are right. I tried that but I did not get the result.
    I just found the way. When we launch split signal, we should expand it (split signal icon) from above and not from below. It took me a while to figure out this. 
    thanks 

  • Error 200302 in DAQ-mx global virtual channels when reading 0Hz

    Hello, I am attempting to calculate flowrate via frequency (by counting the pulses for a given time).
    The frequency read seems fine when the operation is running. However, when there is no flow (only tested by reading the channel with the operation off) there is an error 200302 (Signal being measured is slower than the specified measurement time.Increase the measurement time, or use a different measurement method.).The concern is to make sure that when there is actually no flow rate while operating that the returning information is confirmed to be valid.
    So far the only solution I've found is just ignoring/hiding errors. Any further help would be appreciated and if I have not been thorough enough please let me know.
    Thank you for reading.

    Hi JRoe,
    You can change the timeout to -1 where no timeout will occur and consequently no error; however, until a sample is read the DAQmx Read will wait before progressing onto the next while loop iteration.  This is another option to consider in addition to handling the error exception. 
    Regards,
    h_baker
    National Instruments
    Applications Engineer
    Digital Multimeter Resources

  • Best structure to measure voltage across 8 resistors in parallel via 8 separate analog channels

    Im setting up a simple circuit w/ 8 resistors in parallel. It will be connected to a PCI 6036E DAQ. I need to measure the voltage across each resistor, take x amount of samples, and then automatically move on to the next resistor and so on and also save the values to a file.  Im going to connect each resistor to a separate analog channel.  I have already setup a vi to read the voltage across one resistor and take X amount of samples, display the waveform, and also save the data to a file.  
    What would the best structure be to run this test?  I am thinking a Sequence structure, but it seems like people tend to avoid using that. Or would a case/while loop be better?
    From my understanding, the data will not pass out of a sequence structure until it is finished. this doesnt seem to be that big of a problem for me, as I only want the data at the end....
    thanks for the help!

    Use a for loop.  Put your code inside the loop, but delete the analog channel number.  Make an array constant and poplulate the array with each analog channel number.  If you wire the array to the loop (left side), you will see the terminal is a hollow box.  This means indexing.  The loop will operate on the first array element, then repeat with the second array element, and so on until all array elements have been processed.  Wire the hollow box to the point in your code where the analog channel number was deleted.  Now the loop will execute the same code using a different channel each time.  If you wire the output to the right edge of the for loop, you will again see the hollow box.  All of your measurements will be contained in an array at that hollow box.  Process the outputs as you like, maybe display the entire array, or index the array to get the individual elements, whatever.  The advantage of the for loop is that you have to write your code only once.  Everything is seen on one screen making it easier to read.  Sequence structures are not good programming practice because a lot of the code is hidden, and you have to go to different sequence frames to see the hidden code.  Also, why duplicate the code in each frame when the loop will do it all.  Good luck.
    - tbob
    Inventor of the WORM Global

  • Data aquisition from spectrophotometer in two analog channels, X-Y plot

    Dear colleagues!
    I am new to LabView and I am only starting to learn the system (I have never been a programmer, I'm a chemist to be precise).
    I have before me a task to interface an old analog scanning spectrophotometer to PC via LabView.
    It has two output analog channels: one is wavelength (two ranges, currenlty let it be 190 to 390 nm; it reads on multimeter as 0.19-0.39 V range) and another one is absorbance (0-1V range). An UV spectrum sholud be an X-Y graph wherein X is wavelength and Y is absorbance.
    I am able to read one channel OR another. I am able to read BOTH channels simultaneously, but how can I plot them AGAINST each other, not against TIME?
    I am using DAQPad-1200 (LPT interface) and LabView 6.1 (that's why I am unable to read most of the VI's posted on the forum ).
    Is such an interfacing even possible given my software and hardware limitations???
    Thank you all in advance!

    Thanks a lot, johnsold!
    I am now able to get something which looks like an UV spectrum! %)
    1. I will post an image (later); however, my primary objective is to get two columns of numbers, not necessary to see an X-Y graph onscreen.
    2. Without inserting arrays like I did LV always tells about error connecting this data line from two channels to save "2-D data to file" option telling me that input is 1D!
    3. I have a manual for the device, it has all of the schematics. I am no electrician though. I will post scanned circuit diagrams then when I manage to scan them.
    Now I see two more opportunities to control the device.
    A. There is a circuit (+12V DC) on the rear of one of the modlues, which, if shorted for at least 500 milliseconds (according to Tracor manual) can initialize automatic scan. How can this be done using Labview and DAQ device? My first guess is to use an analog output and some kind of a relay, either electromagentic or semiconductor one. Is there any other possibility?
    B. In my code I am always asked to write to a file after I initialize the sequence. Can this be done AFTER the sequence is finished?
    C. Finally, is it possible to automatically stop the While loop when the number generated by shift register becomes equal to 190?
    Here are attached a new code and a sample of data.
    Attachments:
    Tracor970A-v1.0.vi ‏53 KB
    UV-test-01.txt ‏15 KB

  • Simultaneously reading multiple channel types programatically

    Hi, I'm completely new to using NI DAQ so please forgive me if this is trivial. I am need to be able to simultaneously read 5 analog lines and up to 20 digital lines of an M-series multifunction card completely programatically, i.e. with no involvement of MAX, LabView, etc. (it's going to be incorporated into a Matlab program and has to be as independent as possible). I simply want to write a piece of C code that reads these channels at 2KHz and stores the data for later analysis. Is this possible with the NI DAQ library? (and if not, why not?) From what I've read so far, for some reason it doesn't seem to be a supported function of the DAQ library. Any advice welcome. Many thanks
    Tom

    Your M series board is not supported by the old NI-DAQ driver. It can only be used with the newer DAQmx driver included with the board. and while you can't have true simultaneous analog acquisition you can synchronously acquire 5 analog channels 20 digital inputs. The DAQmx driver includes some C example programs. You can download the latest version of DAQmx by going to http://www.ni.com/support/.
    If you're not going to use LabVIEW for the data acquisition, you shouldn't post to this message board. There is a dedicated Multifunction DAQ forum and Measurement Studio vot VC++ message board.

  • Need quick help, please!!! How do I scan the counter and analog channel in parallel, synchronized?

    Hi,
    I'm using LabView6.1 and a PCI6014 DAQ card.
    I have to scan simultaneously an analog channel and the counter on the card. My project requires me to measure in parallel a force (a voltage on an analog channel) in correspondence to a distance (measured with a counter) and I have to display a force-distance graph.
    So, can someone please tell me how can I program the counter and an analog channel to take 1000 measurements in parallel, and then, by reading the buffers to have two sets of corresponding measurements?
    I've tried some things and I've got only an error message, that says that there is no free DMA channel available (the error comes from configuring
    the analog channel). I attached one of these programs that gives this error, maybe somebody can tell me what I do wrong.
    If somebody could send me an example (in LabView6, I have no 7 :-( ), I would be grateful.
    Thank you,
    pixooxiq
    Attachments:
    Scan_Test_4.vi ‏177 KB

    Hi pixooxiq,
    unfortunately, your Card has only one DMA-Channel.
    If you want to use two Channels simutaneously, you have to tell one of them to use an Interrupt instead.
    This option can be set with the "Set DAQ Device Information.VI"
    Just see the Bitmap, I've attached.
    Perhaps, you now get Performance-problems, cause the IRQ does not directly write the Data but involves the CPU. In this case the only possibillity is to use an other card with more than 1 DMA-Channel...
    Regards
    Peter Weber
    NI Germany
    Attachments:
    Interrupt2.bmp ‏159 KB

  • Crosstalk among Analog channels

    The setup is this :
    1. Card is PCMCIA 6024E.
    2. Software is LV 7.1 and all reads are with DAQMx functions.
    3. 6 analog channels configured in differential mode ( AIN_0 to AIN_5)
    4. Connected to the card via BNC2110 connector.
    If I connect only one channel to a signal, it is reflected in all the other 5 channels at different levels.
    I do know that I can solve this problem by two means :
    A. Ground the unused channels to AIGND.
    B. Use alternate channels with one grounded channel in between two active channels.
    In my case since I need all 6 channels at times, so option B does'nt exist.
    Question is, can something be done in the software without resorting to option A.
    I have attached the snap shot of my problem. The straightline plot is the channel that has a signal on it and the other "followers" are free channels. At 15:49:43 I made the active channel zero and you can see all of them dropping to zero. Then I started another channel and all of them pick up !
    Kindly help solve this.
    Raghunathan
    LV2012 to Automate Hydraulic Test rigs.
    Attachments:
    FuelPump_06-04-05 _PM 03-50-08.jpg ‏86 KB

    SE_Hoard wrote:
    I would be interested in any solutions to your problem also. ... When I input a signal on CH0 it also appears on the other 7 channels. ....
    I was searching the tutorials and application notes on the NI site. Located this PDF which discusses the aspect of amplifier settling times in a multiplexed front end of a multi channel DAQ setup. Just read through the recommendations and see if they can help to reduce crosstalk in your case :
    http://zone.ni.com/devzone%5Cconceptd.nsf/webmain/B9B5D37A04C772B58625686500695C20/$File/AN045.pdf
    Raghunathan
    Raghunathan
    LV2012 to Automate Hydraulic Test rigs.

  • Noise problem on analog channels

    I have 18 analog channels connected in differential mode to a 6225 DAQmx card. I am trying to measure 14 pressures and 4 temperatures. I have connected the transducers directly to the AI connectors on my SCB68:s. I have also connected the shields from all transducers to the shields crew on the SCB68 to aviod noise.
    My problem is that I still get noise on my analog channels. I have configured the channels using MAX in differential mode. I have read the post "Field wiring an dnoise considerations for analog signals" for a better understanding of analog data aquistion using NI-DAQmx, still I am stuck with my noise.
    Can anyone help me? I have ran out of ideas.
    I get the best result using an capacitor between the positive and negative terminals on the daq board.
    PLEASE HELP!
    /Anders

    Hi Anders,
    Quite unlikely that card is inducing some internal noise.
    By selecting the range btw 0 to 1 V, you are only changing the ADC gain settings.
    What i suggest is that, you give a standard input of fixed voltage ,say like a dry cell or a function generator to the Analog input and check if you are still getting the kind of noise you are getting with your sensor attatched.
    Check this for both the ranges you talk about with suitable inputs.
    Now, if you do not get noise, then connect sensor in a suitable single ended mode and see if this gives you a better reading.
    If you are still getting noise, then i would suspect for improper chassis grounding
    do tell if this solves your problem
    Regards
    Dev

  • I want to use two analog channels and one digital simultaneo​usly

    Hello and thanks in advance for reading this!
    What I am trying to do is generate two different signals from the output channels of my interface card (PCI6024E) and simultaneously use a digital line so that I can switch two tranzistors (one NPN, one PNP) which actually control the "flow" of the two signals. This means that both signals need to be "active" while the VI is running and at the same time whenever I want to choose the signal not in use I need to use the digital line so that I switch the tranzistors and I get the desired signal.
    I have already created a VI which activates a digital line and while I was trying to add with the NI-DAQmx Assistant the first digital output, I discovered that it c
    ould not be used simultaneously, because there was the error code -200324 saying that "Device not available in NI-DAQmx. It is possible that the device is being used by Traditional NI-DAQ or that the device is being reset."
    I did reset the device but as I get it when VI runs, it cannot have an active digital channel and an analog output channel at the same time (not to mention two analog channels). Correct me (And make my day if I am wrong but this seems to be the case. Thanks a lot for your time!

    Hey Shootist000,  Thanks for the replies.  First off, I am actually okay if we both have each other applications so I am not concerned about that. It is still unclear from what you have said as to whether I can in fact, use these two separte time machine backup to create two separate profiles on the new hard drive.  If that in fact can be done, then - will it create two copies of the apps we both have in the ROOT of the drive as well as placing all the ones we each have separately?
    And reading your second reply, makes me think that maybe the partition is the way to go to begin with and then down the road - after I am in the new iMac, I could reformat the iMac 27 with only one partion and restore my son's latest back prior to the reformat thus giving him full access to the 2 TB of the drive.
    If this is still making sense, does this mean :
    replace the 1TB with a 2TB - but have it partitione - 1.5 TB & 500 GB.
    Install(Restore using Time Machine) my latest back up prior to the  1.5 partition
    Install (Restore using Time Machine) my son's latest back up prior to the 500 gig partition
    Lastly, in order for us both to be using the partioned computer - I am assuming Switch user can no longer be used - so would we need to restart and select our respective partions in order to use the computer?   And if so, how would we each be able to be using time machine to back up - two separte external hard drives - with each one dedicated to only one partition? Or ? 
    Thanks so much.
    Ironically, I am only trying to do this so that I don't need to manually install all his apps, setting, games, blah blah for this temporary period.  :-)

  • DAQ USB6215 でのアナログデータRead

    LabVIEW Ver8.0.1、DAQ USB6215を使用して、データの収集を行っていますが、
    スタートしてから2秒間程、データが読み取れません。
    プログラム手順
    1.「DAQmx Create Task.vi」(自動クリア=TRUE)にて、タスクを作成。
    2.「DAQmx Create Task.vi」(自動クリア=FALSE)にて、出力されたタスクを使用し、
      「DAQmx Create Channel (AI-Voltage-Basic).vi」にてチャンネルを作成。
    3.「DAQmx Timing (Sample Clock).vi」(サンプルモード=連続サンプル、ソース=OnboardClock)に
      レート=256を指定
    4.「DAQmx Start Task.vi」にて、タスクスタート
    5.「DAQmx 読み取りプロパティノード」にて「チャンネル毎の有効なサンプル数」を取得
    6.「DAQmx Read (Analog 2D DBL NChan NSamp).vi」にて、サンプル数に5.で取得した有効サンプル数を
      指定し、データを読み取り
    5,6の処理をWait1000msecを置いたループで連続で処理していますが、4でスタートしてから
    2秒間程(2回ループ)は、5の有効サンプル数の取得にて、データ数が0や1など、少ない値した取れません。
    スタート後、数秒間のデータは取得できないのでしょうか?
    よろしくお願いします。

    UNI21様
     ティックカウントを眺めていたらどういう動きをしているかが追えます。添付VIをご参照ください。(8.0形式で保存しています)
    順を追って記述しますと、
    1.ループ実行開始(1回目)
        ↓
    2.サンプルがまだ溜まっていない(サンプルレートが低いため)※250Hzだと1サンプル取得するのに約4ミリ秒必要
        ↓
    3.サンプルが0なので読み取り関数はデータを0個取得して次の処理へ(この間待機関数は並列で待機している)
        ↓
    4.待機完了(次のミリ秒倍数まで待機だと、1秒よりだいたい短い)
        ↓
    5.次のループに突入(2回目)
        ↓
    6.前のループが1秒より短い時間で終わっているので、250サンプルより確実に少ない
        ↓
    7.読み取り関数が全バッファ内データを取得(この間待機関数は並列でシステムタイマ値がきっちり倍のミリ秒まで待機する)
        ↓
    8.待機完了、次のループへ突入(3回目)
        ↓
    9.今度は前のループがきっちり1秒待機しているので、1秒分のサンプルが取得できる
     と、なります。ご確認ください。
     なお、いくつかサジェスチョンがあります。
     1. DAQmx読み取り関数でNサンプル読み取りは、指定したサンプル数が溜まるまで待機するので、
     ループ内に待機関数は不要です。(もっとも、指定したサンプル数が溜まっているかポーリングするので
     効率が悪いといえば悪いです。)
     2. 利用可能サンプルをプロパティノードで取得していますが、読み取り関数の読み取り数を未配線に
     すると、自動的にバッファ内のデータを全て取得します(「-1」が指定される)。
     3. 次のミリ秒倍数まで待機関数だと、システムクロックが指定した数値の倍数になるまで待機する、
     という働きをするため、1回目の待機が指定した秒数より短くなる場合がほとんどです。最初の1回から
     指定した時間ループを回すには「待機」関数を使います。
     4. 今回の挙動は、待機関数を並行して待機させているから、ということもあります。もし待機関数を
     使用するのであればシーケンスストラクチャを使用して、読み取りの前に待機するようにさせた方が
     良いと思われます。
     添付VI:DAQ_N_Sample_Acq_DF.viを実行すると以下の流れが確認できます。また、添付の
    DAQ_N_Sample.Acq.viが一般的なNサンプル読み取りのVIとなります。サンプルファインダの中に
    入っているサンプルもこの形になっていると思いますので確認してみてください。
    添付:
    DAQ_N_Sample_Acq_DF.vi ‏42 KB
    DAQ_N_Sample_Acq.vi ‏23 KB

  • Log an analog channel and counter period channel to hard disk simultaneously

    We are in a rush, and need to log one analog channel and one counter period measurement to disk simultaneoulsy using card controlled timing and set # of samples. Should be easy, but can't figure it out. Labview 6.1 we have & DAQ 6013E we just bought.

    Greetings,
    With regards to logging analog input data to file, I would suggest that you examine the examples available in the following location:
    Examples >> Hardware Input and Output >> DAQ >> Analog Input >> Stream to Disk
    Because you are interested in a finite number of samples, you should look at Acq N Scans to File (wdt).vi.
    With regards to logging period measurement data to file, I would suggest that you examine the following example:
    Examples >> Hardware Input and Output >> DAQ >> Counters >> DAQ-STC >> Measure Buffered Period (DAQ-STC).vi
    This example does not log to file, but it does demonstrate how to program a buffered period measurement. You will need to add the logging functionality to this VI as demonstrated in Analog Input >> Stre
    am to Disk.
    Good luck with your application.
    Spencer S.

  • Reading multiple channels for multiple graphs

    Hey I am fairly new to Labview and am using it just temorarily. My project is to take in readings from a Gaussometer (X,Y, and Z axis) and graph them in read time. The Gaussometer outputs a DC Voltage equal to the gauss of the magnetic field. The X,Y,Z all come in on three differnet channels. Connected to a NI USB-6009
    I know I can use the Express> DAQ Assistant, however that outputs "Data" and I was hoping to use this in an Array. So I used the DDT to Array to convert it to the Array format that I needed (thanks to the forums for the help there). My only problem is that I don't know how to do this with multiple channels at the same time. But I have possibly been going about this all wrong.
    So I just wanted to know if I could get some help on how to read multiple channels and write to them to three different graphs in real time that would be of great help.

    Whether or not you use the Convert From Dynamic Data or the Split Signal, your data should be shown as soon as the DAQ Assistant returns. How you format the data is irrelevant. If the number of samples you request is greater than the sample rate, then it will take longer to acquire the data and there is nothing you can do about that except reduce the number of samples and acquire in a loop. You can append new data to old and display everything in a graph if you want.

Maybe you are looking for