entry with DAQmx and simple analog output

Hi guys,.

I did a vi that is supposed to a tension (and current), read and write a tension (and current).

Write processes both read the process works perfectly when activate them separately.

But I can't activate reading while I am writing the process is running.

I think that there is something wrong in my vi.

Is there anyone can understand what is happening?

I solved this problem by myself. It's because I put two loops (process of writing and reading process) case in a while loop. The while loop does not run until all the ends of loop case, which has made, I can only write or read.

To resolve this problem, I can either put the case loops in different loops or use while structure slave master.

Tags: NI Software

Similar Questions

  • Synchronize the analog continuous entry and continuous analog output using the unique PCI6024E data acquisition card

    Hello

    I want to generate the continuous signal and at the same time I want to read that signal that I generate using a single card DAQ. I want to generate signal and the received signal is synchronized and in phase.

    I looked at several samples on the sync, but it quiet confusing. One using the same clock of entry while the other use a trigger to start. I use the PCI-6024E DAQ card.

    Can someone help me in this regard?

    In two of these screenshots, the task to HAVE started first (that's what you want, because it is the task of the slave).

    Typically for AO, you can simply write a unique period of your waveform, and then regenerate again and again.  Your waveform would be preset before the task starts.  If you need to update the waveform on the fly according to enter programming during execution of the task, you would disable the regeneration.  In addition, if the wave form is such that it cannot be easily represented by a predefined buffer (for example, it is a strange frequency which is not a same ditch at the bottom of the sample clock), then non-regeneration is the way to go.

    Best regards

  • How can I improve the rate of acquisition with daqmx and usb-6008?

    Hello

    I am trying to acquire data of analog voltage with a USB-6008. I'm under Labview 8.5 student on an HP laptop with a 1.33 Ghz cpu and 736MB RAM, apparently. I tried using the Daq assistant and the low-level Daqmx functions. My best results come with a task set in MAX for my analog input, and using the function 'Daqmx read' the 'unique double 1 d sample' value in a while loop. I insert the values returned in a table which built in the while loop, and then when I'm done, I check the number of samples in the table. In the test VI attached, I also use the time to Get before and after all loop. The best sampling rate I made using this method, is around 40samples/second. I have attached a VI below that illustrates this concept. In my actual application, the data acquisition code runs at a time while loop with 1ms, parallel to other code that controls the device I'm collecting data of. The sampling rate is roughly the same for my test below VI and my application program.

    The 6008 datasheet gives the sampling frequency maximum 10 kHz. I'd be happy with 2 to 2.5 kHz, or as soon as possible; I'm sure that I can achieve a little more than 40 Hz. My first idea was tied to the hardware, but the 6008 cannot make acquisitions NI hardware.

    My question is: How can I implement a faster sampling of analog voltages to a USB-6008 in LAbview? If I can't do it, is there another way I can taste the data more quickly?

    Thank you

    -SK-

    To the best of my knowledge, the USB-6008 can do timed equipment acquisition. Don't forget that this is a multiplexed device, so if you add 8 channels so the maximum you can set is 10 k/8

    If you are new to LabVIEW, I suggest that you try this sample program first

    \examples\DAQmx\Analog In\Measure voltage. llb\Acq & Graph tension-Int Clk.vi

    Amit

  • multi channels data acquisition, a single frequency, counter a pulse, two voltage inputs, a power meter (by USB) and an analog output spontaneous and recording

    Hello

    I have a power meter which provide the USB driver and a Labview program to get the data and NI USB-6221. The project I am currently working on the needs of:

    1 acquire two signals (inputs of simple tension), pressure frequency KHz

    2. acquire a flow signal, the output signal is 0 to 5V pulse, each pulse means 0.4 ml volume. So I use a voltage inflows to count impulses in certain period of time (in this case, 1 S) for water flow. ; KHz sampling frequency and the 1 Hz update rate

    3. acquire a signal of engine speed. The output signal is pulse square wave whose frequency is related to the speed. I use a REIT port to measure the frequency. Sampling rate: Auto

    4 give output voltage sine or square wave, I use AO do that.output rate: Auto

    5 acquiring by VISA electricity meter data.  Data update rate: every 50ms

    Currently, all the 5 tasks work well separately. But when I put them together, some signals are beginning to hang, for example, pressure signals sometimes give nothing.

    Another problem is the data record. I programmed the VI in such a way that whenever I press the button 'save start', he begins to record data and save them in a .cvs file. For some reason, I always get only the data in the first table. Coult someone help me? I download my code as follows

    Hello

    What I meant by open, write, close.  For any type of file you are using.

    Open the file, which produces a reference, then put the mention in a registry to offset.

    Write data, using the function write (for this type of file) and the reference.

    When you are finished, close the file reference.

    Writing in the spreadsheet opens, written, close all at once.  It is very good for this type of application.

    ***

    The issue of the loop is more general.  I would like to say first of all, I want to say that since each loop works on its own, it is own VI, and that this program has put all this into a single VI, which has a method to solve the problem is to disable all the loops and allow them one at a time to see if there is a culprit responsible for.

    Using multiple loops executes the code at the same time, and some loops would be cycle faster than others, especially if some of them are loops just as they are.

    Communication between the loops is a test to the address if necessary.

    Running all these signals through different loops DAQ must also be examined.  Don't know what questions are for read and write somewhat randomly in the channels.

  • A2109 2 problems with networking and an HDMI output

    I had an A2109 for Christmas and have 2 occurring of questions that I need help on.

    1. I was never able to get the HDMI to work. I tried 2 different cables, as well as 2 different TV and when I plug the microphone to the Tablet and the TV, my TV cable don't say no signal source. I got this tablet specifically for the HDMI output and flash support, so I can watch sports on the internet on our main TV.

    2. in the last week or so when I wake up in the Tablet, my apps does not connect to the internet. In the taskbar it shows that I am connected to the network. I open up chrome and you get a DNS error. To solve this problem, I turn off the Tablet and then turn it back on. This happens whenever I wake up.

    I've not being updated to JB again because I don't want to lose the capabilities of Flash

    As I have a follow-up has been able to solve these two issues.

    HDMI: the cables, I bought two bad ones were apparently. I bought another and that he had "snap" in as well and the TV started to show what was on the shelves. How lucky I am with this one?

    Network: Restarted my router and after a few days there were no problem.

  • Simple examples of analog output USB-6343

    I've tried passing by 'find' examples and does not know how to find what I want.

    I'm doing a simple analog output on a USB-6343.  Examples of waveforms say they work with the USB-6343, but I really don't want a waveform, just analog of output does not exceed 10 Hz speed of renewal.  Some of the more simple examples show that they work with the pcie-6343 but do not list USB-6343.

    I worked with USB-6009 in the past, but when I try to use an analog output task that uses 1 sample on request, I get the error "not buffered operations clocked by the hardware are not supported for device and channel type.»  Set the size of greater than 0 buffer, do not set up the timing of the sample clock or the value Type of sample On Demand time"

    I tried samples N, 100 samples to write to 10 Hz - the same error.  Samples of continuous - same error.  1-sample - timed HW - same error.

    There is a series of examples of I/O for the X series?  Is it possible to search the device examples rather than go through all the examples and by checking the list of devices individually?

    Is 'size of the buffer' the 'writing samples"in MAX?

    After contacting the support I was provided with the names of the more simple examples for analog i/o:

    Analog output-Gen power Update.vi

    Analog Input-Acq & chart voltage-Int Clk.vi

    They are found in the getting started screen of

    Click 'Find examples' near the lower right corner

    Filter the results to material by clicking on the menu drop down for the material in the lower left corner and selecting USB-6343 (only connected equipment will be displayed)

    Don't forget to check the box "limit results to material" below.

    In the center pane, double-click 'Material Input and Output'

    Double-click DAQmx

    Path for the analog input - double-click Acq & chart analog measures - double click on tension - tension-Int Clk.vi

    Double click on analog generation - double click on Power - Gen Update.vi of analog channel output voltage

    The examples are for the single data point.  Samples and exit multiples are produced by putting the writing or reading VI inside a loop.  The beginning and the clear functions should be out of the loop.

    Additional information, I need technical support was how material-filter results and identification of more simple examples which were not obvious from the examples of names.

  • Generating analog output signals 4 with different frequencies

    Hi all

    I was trying to say to generate 4 different signals at different frequencies

    1. first waveform is a sine wave with 5000 Hz,

    2. other with 8000Hz,

    3. third, one is a square with 25 Hz waveform and

    4. fourth one with triangular waveform 50 Hz

    all waveforms must be generated simultanoeusly.

    I tried to generate with the task unique analog output and sample clock (clock rate is 100000). Cross in scope that I see only 5000 and 8000 Hz we generated correctly and the rest two waveforms show the incorrect frequency.

    I guess that's due to the frequency of high clock to sample for more low frequencies for ex 25 Hz and 50 Hz. If I reduce the clock rate to get the lower frequencies properly so I can't generate frequencies higher correctly. (there's a clsh between frequencies and the clock frequency)

    Is it possible to use DAQ board master sample clock and its magnitude downward revision (everywhere where it is necessary for each waveform separately) to generate all the signals at different frequencies at the same time in a single task?


  • Read analog output channel value internally

    According to this you can read the values of analog output of return without having to physically connect the wires.

    By using the technique described in the example given (DAQmx_Read_Output_Internal_Channels.vi) I'm reading a current area of OCCUPANCY on my compactDAQ cDAQ-9174 with a module of analog output current OR-9265.

    The output channel is created in MAX and my vi can write values to him without problems

    But when I try to create an analog input channel to read the output, an error occurs.

    What I am doing wrong?

    This is not supported by my hardware?

    Or is the example given in the above incorrect link?

    The example is 10 years old. Maybe, it does not work in LV2013.

    Hi Jocker,

    The link was not attached to your message, but I guess that's it: http://digital.ni.com/public.nsf/allkb/CB86B3B174763C3E86256FFD007A2511 as there the example of vi you mention.

    The error you are getting is due to the use of the channel for analog output and trying to configure the task as a task of entry. You must use _aoX_vs_aognd as the channel of the task rather than on the output channel. This compares to the ground for the analog output values.

    The NI 9265 is not on the list of the C Series modules that have internal channels:

    http://zone.NI.com/reference/en-XX/help/370466W-01/mxdevconsid/9211interchan/#GUID-E13ADE46-5CB8-491...

    So I guess that the module is not able to compare its output to ground. He would appear in the dropdown of the channel names if available.

    Pete

    Applications Engineer OR

  • Strange problem with analog output PCI 6251 and BNC-2110

    I'm controlling current source of third parties using the connectors of analog output on my card PCI 6251 and BNC-2110.

    The current source needs an input signal of 0.1V. I tested it using a battery, the potentiometer and the voltmeter, and by manually adjusting the voltage of power current works - current output with control voltage scales according to the specifications and is relatively stable.

    The data acquisition card works too - when I connect a voltmeter to the AO0 AO1, the measured voltage corresponds to the target with great precision value.

    But when I connect the current source of third AO0 AO1 data acquisition card, the measured output voltage drops and fluctuates. This applies to both channels of the AO.

    I wonder what is the problem here. I suspect it could be a matter of the grounding - the current analog control of the source is an entry with two floating terminals differential. I tried to return the switches FS/GS on the BNC-2110, but that makes no difference.

    Anyone knows similar behavior? Does anyone have any suggestions?


  • How can I check if the counter entry is synchronized with the analog output?

    Hello

    I'm working on an application for counting photons.  I use two channels of analog output on a PCI-6713 card to send a frame model to a set of XY scan mirrors.  I then a photon count unit that emits a TTL signal when the photons are detected as a result of this raster analysis.  I then use a surfboard USB-6211 to count the edges on this TTL signal.

    I have problems that seem due to synchronization problems.  I use the sample AO on the PCI-6713 card clock like the door of my meter on the map USB-6211.  I use a trigger to start digital to analog output and a trigger of arms for the entrance to counter early. Is there a way to check that the analog output and counter entry of start of operations at the same time and are are synchronized?  I basically want to monitor and compare the ao real sample of the PCI-6713 card clock door signal used by the jury of the USB-6211.  I was able to export the sample AO clock and watch it on my oscilloscope, but not the signal from the door of the USB-6211.

    Thanks for your help,

    Brian

    Update... It turns out that there is no problem of synchronization between my meter input and the analogue output.  There was a difference of impedance when I connected my unit of counting photons to my USB-6211.  This caused an error variable count rate.  After accouting for this shift, the problem disappeared.

  • How can I pause and resume the analog output using DAQmx?

    I use a DAQ hardware to produce an analog waveform.  I would like simply to break the output of the wave and then resume where it left off.  I use DAQmx and LabVIEW 2011.

    I've seen examples that use a digital or analog break trigger, but I would take a break in the software only.  How can I do this?

    -Joe

    Hi Joe!

    I spent some time thinking about it and I realized that you can technically use a fundamental mission of the analog output, as you previously wrote that runs continuously. However, the generated output samples are controlled by the sample clock pulses, and can be manipulated to fit our needs "suspension."

    To do this, we will need another counter task that generates a pulse train (see our examples of shipping under material input and output > DAQmx > generating digital pulses > generate dig Pulse Train - Continuous.vi) that stops and starts the user to choose. This can be in another quite VI or controlled by software. We will use this as the task of our output sample clock.

    Then, the task of the AO, wire a constant to the sample clock source and select ' DevX/CtrXInternalOutput"based on the counter that you specified in the task of counter. You will need to choose "I/o name of filtration" and check the box that says "include advanced terminals' and right-click of the constant. See picture attached as a reference. In this way, the task of the AO is constantly running, but it generates only actually all data when the meter running task.

    Let me know if you have any questions!

    Have a great day!

  • To input analog shutdown when the analog output is completed and synchronization

    Hello

    I'm trying to get my LabVIEW program to send analog output to a computer and read acceleration using the cDAQ-9184. Chassis output that I use is the NI 9263 and the chassis of entry is the NI 9234. I generate a signal of white noise using LabVIEW Express signal generator.

    The first problem I have is the synchronization. I had an old VI that has begun to measure the acceleration just about a second after the entry has been given to the machine. I used the LabVIEW tutorial on how to sync the analog input and output, only to discover that it does not work with two different hunts. Then I found another tutorial that shows how to synchronize different frames between them.

    The second problem is the cessation of the LabVIEW program. What I want to do is to generate the signal and then simultaneously send and read the input and output analog, respectively. It is because I don't want a phase difference or any shorter signal for a direct comparison. But as soon as the signal is sent to the machine, I want the entry to stop analog playback and then then the LabVIEW program must stop. I want to be able to choose any length of signal to be generated and stop as soon as the entire duration of the signal has been sent to the machine.

    I tried 'DAQmx stop', "DAQmx Timer" and 'DAQmx's task made?' and none of them have worked for me. It is also my first time on a forum posting, so I hope I gave enough information. I enclose my VI as well. The VI shows I read an entry for the analog input voltage, but I am only using this to try to get to the work programme.

    I'd appreciate any help I could get.

    Thanks in advance

    Peter

    Hi Peter,.

    I have some recommendations for you that I think you will get closer to your solution. First of all, I assumed you meant that you had 1 chassis (cDAQ-9184) who had two modules in it (NOR-9263 and NOR-9234). My next steps are based on this assumption, so if it's wrong, please let me know.

    For your first question about the synchronization, the code you provided is very close to what you need. You need to do, however, implement architecture master/slave for startup tasks DAQmx functions. To do this, you can add another frame to the flat sequence structure and put the master start task (input voltage) after the start slave (output voltage) task.

    To manage your second question and that the program ends at the point where you, the first step is to get rid of all the logic that you use with the local variable of length of time. Rather than use this logic, just wire the node "task performed?" of "is task performed?" operate to stop the loop. This will cause your loop to stop as soon as the signal is sent to the machine.

    I have some other recommendations for you that will increase the performance of your program:

    (1) rather than writing on file inside the last loop, you can use the DAQmx Configure Logging (PDM) .vi. You will place this VI between DAQmx Timing.vi and DAQmx Start Task.vi to the task of the analog input voltage.

    (2) after the last while loop, you want to stop the task and analog outputs as well with another DAQmx stop Task.vi.

    (3) rather than using a local variable for the entrance of displacement and wiring it in the DAQmx Write.vi, you can wire directly from the output waveform of the wave to build function node.

    That should help you get started in the synchronization of these tasks.

    -Alex C.

    Technical sales engineer

    National Instruments

  • DAQmx: Analog input directly to the analog output at the hardware level

    Hi all

    I searched for a while, but I couldn't find any suitable implementation for what I'm trying to do.  A person where I work introduced me to an interesting challenge.  Is there a way to set up a DAQmx task (or set up otherwise an MIO Board) to route an entry directly to an output to the analog analog hardware level?  You may be thinking, "why the hell would you do?  To reduce the electrical complexity, a colleague would like to concurrently read an entry while 'reproduction' of its signal on analog analog output.  I know that I can easily accomplish this while the buffering by the PC, but they are interested in ensuring that the output signal is also similar to the input at the level of KHz signal, by introducing a minimal difference in phase (shift buffering of the PC).

    For the record, we have for most old maps of the E series here like the PCI-6070E (PCI-MIO-16-1).  I was first asked if it could be done through SCXI, but I figured I would start by asking about the MIO tips.

    This looks like a long shot, and I've never heard of someone at - he never did this, but I thought I'd ask to be sure!

    Thank you

    Jim

    Hi Jim,.

    With the help of our driver is not a means of generating data directly from the FIFO of AI, it must first pass through the software.  You can try the following code to the output of one of THE duplicate on the AO line to see what kind of delay you can imagine.  It is similar to your original with a few adjustments code:

    Use delayed output Version of avian influenza in DAQmx AO

    It seems you need to do, you might consider instead the search by using a voltage follower to isolate the Vout wine.

    Best regards

    John

  • Bad analog output help Every_N_Samples-NI-9263 cDAQ-9172 chassis (works with cDAQ-9178 chassis)

    Hello

    The NOR-9263 analog output voltage geberation works correctly with the cDAQ-9178 chassis but gives wrong result using the chassis NOR cDAQ-9172.

    In the attached code example, a single cycle of a sine wave is composed of 40000 samples and came out in the background using Every_N_Samples at a rate of production of 5000 samples per second.

    The output buffer size is set to 10000 samples.

    Prepare us the buffer writing 10000 samples 1, then write the remaining data in the background using the Every_N_Samples callback.
     
    Bug: Using the cDAQ-9172 chassis, to the 5000 s/s sampling rate with the help of an external field (or through closure to another HAVE), we observed that 1 10000 samples came out twice, followed by the rest of the waveform. The last 10000 samples are never exits. If you are working properly, we would expect to see 1 full cycle of a sine wave.

    The bug does not occur with the chassis NOR cDAQ-9178. I use the driver NIDAQmx v9.2.1f0 on Windows XP
    The bug does not happen with simulation devices, so you will need to use harwdare real to reproduce.

    Please find attached an example of code C based on the example program OR "ContGen - IntClk.c" to reproduce this bug.

    Thank you

    whemdan,

    The MathWorks

    Hi whemdan,

    By default, DAQmx regenerate old samples if no new data is available.  To give the correct behavior, you can:

    Use DAQmxSetWriteRegenMode to disable the regeneration (DAQmx_Val_DoNotAllowRegen).  In most cases, this is recommended if new data are written continuously in the buffer as the build is in progress.

    If you just need to generate 40 k samples, you can write them just all at once, rather than in 10 pieces of k (the code you attached probably is just an example, so I'll assume that you have a reason to write the data into segments in your actual code).

    I think the difference in behavior between 9172 and 9178 can if explained by the different way, buffering is set up on each product.  The 9172 uses a buffer of 8 k (on the STC2) in all cases (source).  The 9178 uses an 8 k of memory buffer (on the STC3) If you use regeneration shipped, but uses the 127 samples FIFO cartridge, if you use no on-board regeneration (source).

    Then... on the 9172 8191 samples are immediately transferred to the FIFO.  By default, the hardware is going to request new data when the FIFO is less to fill (this is configurable with DAQmxSetAODataXferReqCond).  I'm not sure what the transfer data request size is in your case (you can set the maximum value with DAQmxSetAOUsbXferReqSize), but obviously it is bigger than the other 1809 samples that you have not yet sent to the Board of Directors of your first entry.  At this point, the pilot will regenerate 10 existing k samples so that sufficient data will be available to meet the demand of data transfer.

    The 9178 however use the FIFO of 127 smaller samples so you will not have the same behavior in your case.

    In summary, the behavior is explainable by the difference of material.  If you want to avoid to regenerate old samples, you should ban the regeneration using DAQmxSetWriteRegenMode.

    Best regards

  • Toggle the analog inputs and tasks of output on the same card in LabView

    Hello

    I'm relatively new to LabView and am trying to find the best way to switch between reading and writing tasks on my PCI-6024E. It seems this would be a common thing to do, but I found no good documentation or any relatable example program. Basically, I would like to be able to monitor certain analog inputs and then write that some outputs if an entry is in accordance with certain specific conditions (say > 4 Volts voltage). It is my understanding that you can only signal (input and output) types associated within a single task in DAQmx. I also understand that you cannot have multiple tasks running at the same time on the same material/map, otherwise you get a: 50103 error 'The specified resource is reserved. Calendar is not really all that matters to me, but quite synchronous and effective would be nice.

    I have attached a sample program that shows more or less what I'm trying to do. I want to follow several analog input lines (AI0 AI1, AI2 and AI3 and) effectively at the same time. If certain conditions are met, AI3 > 4 Volts, then write 5 Volts for analog AO0 and AO1 outings. I also want to maintain output at 5 Volts up to AI3 falls below 4 Volts. Is there a better way to pass the task to read and write than what I've done here? In a sense, all I really do is toggle of a state machine if the required conditions are met and if start/stop tasks of reading/writing necessary.

    One last question, is there a way to display the four channels in the waveform graph using the 1 d NChan 1Samp mode so I can have a time chart and indicators?

    P.S. I'm under LabView 2011 on Windows 7. Your ideas and suggestions are appreciated.

    Thank you

    KJ

    I also understand that you cannot have multiple tasks running at the same time on the same material/map, otherwise you get a: 50103 error 'The specified resource is reserved.

    This is incorrect.  You can't have two tasks of the same type running on a single card.  You can have an analog input and analog output task running simultaneously on the same hardware.

    You are right that each task can have only one type of task (entry or exit).  Discover DAQmx examples in the example Finder to get examples of synchronized input and output.

    PRO TIP: In the Finder of the example, go to the drop-down list in the lower left corner.  Pull down and select Add Hardware.  In the pop-up window, add your PCI-6024E to the right pane.  Click OK in this window.  Then in the main window of Finder example select your hardware from the drop-down list and check the filter results by the hardware.  The example Finder then only you will show examples that are out-of-the-box compatible with your hardware.  I am sure you can find something to fit your needs here.

Maybe you are looking for