Analog input and contrary to the worksheet

Hello

I m trying to get an analog input (volts of a sensor) and a counter with an encoder. I ve long time looking for a solution and I ve already found some very useful examples that I ve used on the VI (thanks for that ).

The program is very close to what I want, but there are still a number of things that I don't understand (I m very new with labview and I still Don t know exactly what I m).

-J' read in an example here that I should use "Single Point timed material" and use the "wait for next sample clock VI' to get samples always with a period fixed (rate). It's works! Before, I used "continuous sample" and it was a bit jitter. Well, could someone explain to me please what is the difference between continuous and timed, material and how the 'Harware Timed Single Point '.

-My second question is about the string formats that I receive on the loop of the wave. I ve tried with very different formats, but it doesn´t work as I expected. I have a format string like this on the 'Date Format VI': %S % 3u-online seconds with 3 decimals?

And on the format I have on the 'picture to a worksheet VI string' should I used %5.7f to get 5 decimals on the output (spreadsheet file). Why?.

What I m trying is to get the analog input with counter clock (I think I already do), given a graph and a file with lines of 3: 1 °-time with 3 decimals, 2 °-v with 5 decimals (positive and negative) and 3 °-position (positive and negative integer).

Software: Labview 2013, pilot DAQmx 9.8, Windows 7 32-bit

Material: NEITHER 6321 PCIe, Intel Quad 9550, 4 GB RAM

I hope that his undestable, I should learn some English to.

Thank you

Hello

Thanks again for the response. I tried to implement the code as you say, but it's always a mistake to time. I solve it with a timestamp.

The idea of a producer consumer loop was very good. After"a bit", I managed to solve it too. Here's the code.

Thank you

Tags: NI Hardware

Similar Questions

  • 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.

  • How to synchronize the analog input and the output of two different USB data acquisition boards

    Hi all

    I have two tips very different USB NI USB 6008 case, which I use to acquire the data (analog input) and a USB of NI 9263 is a output analog only site I use to route a signal (in this case a square pulse). The reason why I use the outputs analog 6008 is because I need to deliver negative tension and need the full +/-10 v range.

    Looking at similar positions, I'm pretty sure that I can't use an external trigger or a common clock, I also tried to use the timed synchronization of the structures but no cigar.

    I'm including a quick vi I whipped showing how the jitters because of the lack of synchronization signal. The OD of the 9263 connects to AI in the 6008 in this example.

    I talked to a specialist in the phone and tols me that's not possible.

  • Analog input and output using 5640r

    Hello world

    I'm Christine, I'm implementing OFDM on fpga using 5640r.

    The code that I have, which is good in the simulation using labview and also using 'nor 5640r treatment only' but I want to implement in "analog input and exit vi" so that I can send and receive on the same card 5640r

    After so much attention in this regard, I am still unable to find the issue, then the soultion to this question. something that I am able to understand that maybe there would be some questions (ADC and DAC) clocks the clock setting

    I have attatched that vi. Please take a look at

    Concerning

    Aqib

    College of aeronautical engineering

    Risalpur

    Sorry

  • synchronize the inputs and outputs on the USB-4431

    Hello

    I have an application that needs to send a signal on the USB-4431 and then capture it with an entry on the same device.

    Aware that I use two tasks to do this, one for input and one for output. I discovered that a trigger (on the RTSI bus) can cycles of sending/capture sychronisé departure operations so that it can be a constant offset between the captured signal and the output signal.

    Unfortunately, the code I found is for Matlab. I can't find an equivalent for it in the C API of NIdaq. The method is described here; http://www.mathworks.in/help/daq/synchronize-analog-input-and-output-using-rtsi.html.

    What I can't understand is how to implement this on the analog input:

    ai.ExternalTriggerDriveLine = 'RTSI0';
    

    Can someone shed light on how to do it?

    The rest of the things described here, seems to be feasible with a normal trigger:

    ao.TriggerType = 'HwDigital';
    ao.HwDigitalTriggerSource = 'RTSI0';
    ao.TriggerCondition = 'PositiveEdge';
    

    Thank you

    Nirvtek

    You can synchronize the HAVE and AO by sharing the start of relaxation between your two tasks.

    Choose one of your tasks as the "master" and the other to be the "slave" (any).

    Set up a trigger to start of digital dashboard on the task of the slave, and set the source of the trigger to be the trigger of the master's departure.

    Assume the following:

    The name of your device is 'Dev1 '.

    I is the main task

    AO is the task of the slave

    Here's what you would do to sync the two:

    (1) create the tasks I and AO in order that you want to

    (2) set up "timing" on the tasks of HAVE it and AO (you choose the sampling rates must be the same or power-of-2 many of the other (for example 100 K, 50 K, 25 K, 12.5 K, etc...))

    (3) configure your slave (the task of AO) task to have a numerical advantage start trigger and make the source is the trigger for the start of the task of the master (the task to HAVE it). In our case, "Dev1, AI, StartTrigger.

    (4) write data (a sine wave, presumably) to your task AO

    (5) start the task from the slave (the task of AO).  The task of the AO is now in the 'Started' State, but given that you've set up a digital trigger early, it won't actually generate data until he sees a numerical advantage of 'Dev1, AI, StartTrigger.

    (6) to start the main task (task to HAVE it).  The task of the AI does not have a trigger digital early, so the software will immediately generate a start trigger, which also causes a numerical advantage on "StartTrigger/AI/Dev1", which causes the task AO start at the same time.

    7) read your job to HAVE.

    You will notice a few 0 at the beginning of your data to HAVE. It's a result of something called "Filter Delay" and it is an inherent characteristic of all DSA devices - see the manual to use DSA and this article for more information on what is and how to cope.

    I hope this helps.

    EDIT: I just noticed that you pointed out an existing C example. It's exactly what you want. I don't know why you have a resource error booked - I tried it myself and (after changing the AO will of +/-10V to +/-3 .5V), it works beautifully.  Try to reset your device to the MAX (or DAQmxResetDevice() of your program)

  • analog input and output synchronization

    Hello everyone, I seem to have a problem of synchronization of the analog input and output on my M-series USB-6211. My request is quite simple. I want to the production and to acquire a sinusoid at the same time. Theoretically, I should have the same 4000 data points through the input and output channels. The reality, however, captured on an oscilloscope, shows that the analog output is off more than 4000 data points. The entry (acquisition) shows 4000 samples. Please see below an excerpt from the creation of task, timing and execution. I'm afraid that the analog input and output are not attached correctly. Do you see something suspicious? Thank you very much! The task was created: DAQmxCreateTask("",&inTaskHandle); DAQmxCreateTask("",&outTaskHandle); Analog output channel Configuration, with 20Ksamples/s: DAQmxCreateAOVoltageChan (outTaskHandle, physChanOut, ' ',-10, 10, DAQmx_Val_Volts, NULL); DAQmxCfgSampClkTiming (outTaskHandle, "OnboardClock", 20000, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 4000); Configuration of the analog input strings: DAQmxCreateAIVoltageChan (inTaskHandle, physChanIn, "", DAQmx_Val_RSE,-10, 10, DAQmx_Val_Volts, ""); DAQmxCfgSampClkTiming (inTaskHandle, "OnboardClock", 20000, DAQmx_Val_Rising, DAQmx_Val_ContSamps, 4000); Set up the trigger: sprintf ("/%s/ai/StartTrigger", local_port, deviceName); DAQmxCfgDigEdgeStartTrig (outTaskHandle, local_port, DAQmx_Val_Rising); Output: DAQmxWriteAnalogF64 (outTaskHandle, (numberOfSamples * oversample), 1, 40, DAQmx_Val_GroupByChannel, input, & sampsPerChanWritten, NULL); Acquire: DAQmxReadAnalogF64 (inTaskHandle, 4000, 40, DAQmx_Val_GroupByChannel, readArray, 8000, & sampsPerChanRead, NULL); The tasks stop: DAQmxStopTask (outTaskHandle); DAQmxStopTask (inTaskHandle);

    Hello

    Change the finished continuous sampling method seems to solve the problem:

    DAQmxCfgSampClkTiming (inTaskHandle, "OnboardClock", 20000, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, 4000);

    Also, I wanted to say earlier to write 4000 samples:

    Output:

    DAQmxWriteAnalogF64 (outTaskHandle, 4000,1, 40, DAQmx_Val_GroupByChannel, input, & sampsPerChanWritten, NULL);

    Thank you

  • Synchronized analog input and output on myRIO

    Hello!

    A brilliant new myRIO just landed on my desk and I'm looking forward to learn how to use it.

    I have a question about the ability of the default FPGA personality.

    Is really similar synchronous HW in and output possible? Can configure you the necessary trigger and clock routing from within VI RT? To say ~100kS/s?

    I need to delve into a FPGA design to achieve this?

    Thank you!

    You will not be able to get your RT loop to run reliably at rates greater than 5 kHz, and we generally do not recommend trying to control I/O faster than 500 to 1000 Hz. This isn't a limitation of the default personality himself, it's just that some tasks are better suited for the OTR and some are better for the FPGA (it is important to understand when developing an application on the myRIO). Synchronization and the output of ~100KS/s signals are something that you have to do on the FPGA.

    http://www.NI.com/Tutorial/14532/en/

    There are some good tutorials in the link above. They use the cRIO instead of the myRIO but the functionality is basically the same. The biggest difference is that you won't have to add modules to your project, because all the inputs and outputs of the myRIO are fixed and must fill out automatically when you add a FPGA target to your project.

  • Measure the time difference between a digital output and an analog input that responded to the questionnaire

    Hallo,

    I use the following system:

    • OR PXI-1044 with controller NI PXI-8109

    • OR PXI-2564 switch module to turn on the monitor of my test device

    • Data acquisition multifunction NI PXI-6259 to measure the signal that responded to the questionnaire jump

    The two cards are the same - PXI trigger bus. For both, PXI-2564 and PXI-6259 I use DAQmx to set the reading and writing of the channels.

    Now, I want to measure the time between the digital output, my unit turns and the analog input, which measures the response of my system.

    I can't do work by myself, please help me!

    I thank Ludwig.

    Hi Ludwig,.

    If you can't give us any VI we have difficulties with to help you.

    Because I Donat knowledge how your program is mounted it is not easy to know where you should enter signals.

    Here's a question similar to yours:

    http://forums.NI.com/T5/LabVIEW/best-way-to-measure-time/TD-p/178704

    and 2 external links:

    http://www.ehow.com/how_8698983_measure-time-LabVIEW.html

    http://objectmix.com/LabVIEW/385152-how-can-i-use-LabVIEW-measure-time-between-analog-pulses.html

  • Subtracting the two waveforms, an acquired using DAQ voltage analog input and the other being generated internally

    Hello NOR community,

    I'm new to LabView and was hoping someone might be able to help with a question I have. Currently, I use a data acquisition unit to sample external sine and I would like to change this signal by adding another signal that I could control using the front panel. Whenever I try just connect entry with something like the waveform sinusoidal vi and put a subtraction sign between them it doesn't work (I get an empty waveform graph). To work around this problem, I've resorted to a signal (via an analog output) and followed by reading the signal to data acquisition, and then finally I add the two together. It works this way, but he wastes two channels and I imagine that there is a better way. I enclose my VI, and I have marked the location of interest "where signals get subtracted ', which is currently displayed using two entries.

    Thank you

    Leo

    You must ensure that your sampling frequency and number of samples is the same.  It seems that your sample (with default values) rate is the same (1 kHz), but your number of samples is different (100 to 1000 the acquisition wave vs simulation).

  • Open a synchronized session of the analog inputs and position

    I want to read 8 analog inputs (only three IA in the capture of code) with a PCI-6221 card at a rate of 100 samples/s, reading 10 samples/iteration. At the same time, I want to read the position synchronized with the analog inputs. Is this possible? If I just merge the position with the analog signal I get 10 readings of position for each 100 analog input readings (see chart - Red's position). For the control of the movement, I use the pci-7342 with UMI-7764 interfaces. Could someone help me out here please?

    Not necessarily. As said, speeds of up to 200 Hz should work fine with a 7342. If this is not enough, of course a 7350 could be used, but there is also a completely different approach that should work with your current hardware:

    7342, you may also route the phases of encoder to the pins of the RTSI. You can use a counter on the 6221 to measure the position of your axis based on the singlas you have routed the RTSI pins. Now you can use "Measure of Position buffered" (see DAQ examples) to measure the position with the same source of synchronization than your analog signals.

    I hope this helps,

    Jochen

  • How to merge and write analog inputs, and export data to a tdms file?

    I have a vi who writes analog inputs in tdms files. I also want to write the analog output signals, which are 2d table entries in the same PDM file with additional columns representing the analog output signals. How can I get this feature?

    Ashaironix wrote:

    Hey Crossrulz,

    So you're saying that writing two files tdms with entries as HAVE and AO, will write everything in a file single tdms AOs and Ais?

    N ° you write in the same file, just different GROUPS.  TDMS is a hierarchical data format.  You have the file, group, channel.  Waveform data will actually in the channel data.  But you can have metadata on any level.  So, I do a group I and a group of the AO.

  • NI USB - 6259 BNC DAQ: analog input signal cross on the question

    Hello

    I use the NI USB-6259 BNC DAQ unit to acquire a four-channel analog signal, and I'm having a problem with a signal that affect others. The circuit, I am running is:

    I have a wire connected to a battery (two AA batteries at ~1.5V), which then feeds the signal cable to a BNC cable, which feeds an analog BNC of data acquisition channel. The field of NBC feeds to another wire, which is attached to a conductive plate.  The idea is this: when I touch the wire connected to the battery for the metal plate, I complete the circuit and thus get a binary not anything at all about 3V.  When I tested with an osciloscope using two channels (each earth connection to the metal plate) I get independent steps whenever I touch any of the sons of the respective batteries to the metal plate (i.e. it works as expected).  However, when I use it with data acquisition, whenever I touch a wire, I get a response in all other channels (3 others), even if their respective sons does not touch the metal plate.

    No one knows why this happens, and how I might be able to stop this 'cross-talk '?

    Thank you

    Veritas

    I see, and you're right.  This request will have trouble with crosstalk.  Luckily the ground channel thing should help you.

    Configure your DAQ to collect twice as many channels as you need.  Connect your wires in the odd channels and short circuit (ground) the entries of those even.

    Now when you scan the channels it will always technically crosstalk, but it will come from a channel to the ground so that there will be nothing to interfere with your measurements.

    At least that's the theory.

  • Write multiple rows and columns of the worksheet

    Is it possible to write several rows and columns of the spreadsheet, with the ability to add data to the file and create a new file if it does not exist?
    I tried to write to table vi, but I couldn't make it work.
    It won't let me write several lines in the same column.
    Can someone please give me an example?
    Thanks in advance.

    If you want to use the tab character (\t) as the delimiter, then check the txt file.  Then Excel will open as you wish.

    If you want to keep the csv extension, then use comma (,) as a separator.

  • Display and by deleting the worksheet of variable size dolumns

    Hello

    I'm trying to make a move of two VI. The first step will read the first row of a worksheet and display this line as a 1 d array. There will be a second picture of the same length, filled with Boolean switches. These can be configured to determine which columns are preserved and which are deleted. The second stage will take in the table of Boolean and remove columns accordingly.

    I was able to do the second step without problems (feeding a picture preset of constants). I thought I had the first stage work, but now he throws me into a continuous loop to select a file for reading of popups so that I never get to the second stage. My biggest problem is that I need this VI guest to read spreadsheets of different dimensions for the table of Boolean control must adapt accordingly. I tried an array of generation and a loop for, but I get the file select loop of reading I mentioned. Most berries are restricted in size, I put to them, and the best that I could do was add a horizontal scroll bar. The whole point, however, is to see the column name, you're clicking off so I wonder if there is a way to automatically scale them or have scrolling occur together?

    Any advice is greatly appreciated.

    Thank you
    Yusif Nurizade

    Partial images diagrams are useless to us. Please join the real VI and perhaps a typical input data file.

    (Besides, what you show is illogical.) For example, what is upward with the part "equal to TRUE? What the point of the while loop that has just the same thing over and over again faster that the computer can?)

  • 6071E analog out and trigger to the end

    Hi, I'm here a trivial question: using PCI6071E, at the end of an analog output, is it possible for a trigger to output or update a number line?  for example, we hope when the last MONOSTABLE one sample is done, a digital HIGH is generated to power a switch.  I can think of have an analog and digital task task and the digital task at the end of an analog task in the program, but I don't know how long the delay would be. The best ways to do this? Thank you!

    Analog output: finished/large size but NOT via the trigger of FIFO, internal CLK software,

    on DAQmx / C + c++ / WinXP

    eLions,

    Analog task followed by a digital task that you thought would work, but it would be a delay of small software timed as you thought it would which can cause problems. If it's an analog output of finite size (say 1000 samples), what you can do is to synchronize the digital and analogue tasks together and have a digital low for 1000 samples, with the 1001eme exit on the digital line being the maximum. It would make no delay, as analog and digital line should be sharing the same frequency. C++ examples provided show how to sync analog analog output, which can be changed by the digital output.

Maybe you are looking for