DAQmx task start-up delay / quickly generate arbitrary output voltages

Hello

(Sorry, I m new to this forum and could not find a reasonable solution by using the search)

I develop a c# multithreaded application that generates a waveform in the 'background' using output buffering simultaneously, captures the images via a firewire camera and treat them. I have a second channel DA free that I would use when debugging a marker in real-time so that I can check on an oscilloscope which is the relative condition of simultaneous processes, i.e. output a voltage of 1 V while treatment step 1, 2 Volts to processing step 2 etc. or I would be out a short spike at some critical point. This is done using a task as

DA_Task_sgl = new Task();
DA_Task_sgl. AOChannels.CreateVoltageChannel ("/ Dev1/ao0", "DA0" - MXVOLTAGE, MXVOLTAGE, AOVoltageUnits.Volts);
DA_Task_sgl. Control (TaskAction.Verify);
DA_Task_sgl. Timing.SampleTimingType = SampleTimingType.OnDemand;
DA_Writer_sgl = new AnalogSingleChannelWriter (DA_Task_sgl. Stream);

then, when I want to change the tension

DA_Writer_sgl. WriteSingleSample (true blood);

A similar technique worked pretty well using Traditional NI DAQ, but with NIDAQmx and the concept of task, it seems that a voltage of output value takes about 1.5 ms (also of time CPU) which is too slow in many cases. With Traditional NI DAQ two consecutive calls to AO_VWrite() may generate a COB with only a few µs endeavors instead. I guess that the delay in the NIDAQmx is mainly determined by start and stop work, etc.

Is there a way to avoid all this (in NIDAQmx) and more direct access to the underlying hardware?

(Please Don t tell me that it is a limitation of Windows, NOR-Trad code clearly shows that it was possible, clearly the thread may be interrupted during the output voltage, but is also my treatment, exactly what I want TO check with this technique, but that 1.5 ms the delay is still there!)

(Currently used card PCI-6014 with NIDAQmx 9.x, but I think that it s not the card which is itself too slow, I can get the update rate Analog > 100 kHz on the string of voltage waveform via DMA)

Thank you

Joachim

Hi fabwes,

The snippet you posted on request AO.  This means that whenever you write we go and search equipment to generate tension.  Your assumption is correct, the slowness that you see is because of the job template.  Whenever you are calling WriteSingleSample the task is launched, the tension is out, and the task is stopped.  I suggest the following code:

DA_Task_sgl = new Task();
DA_Task_sgl. AOChannels.CreateVoltageChannel ("/ Dev1")

("/ ao0", "DA0" - MXVOLTAGE, MXVOLTAGE, AOVoltageUnits.Volts);
DA_Task_sgl. Timing.SampleTimingType = SampleTimingType.OnDemand;

DA_Writer_sgl = new AnalogSingleChannelWriter (DA_Task_sgl. Stream);

DA_Task_sgl. Control (TaskAction.Start);

DA_Writer_sgl. WriteSingleSample (false / * since we are already started, this parameter is essentially ignored * /, tension);

This slight change gets the load to start the task of the road before start you writing.

Tags: NI Hardware

Similar Questions

  • PCI 6221 generating an output voltage

    Hi all

    I'm trying to use a card PCI-6221 to provide a voltage of 5V analogue output and use it HAVE read the returned signal using labview. Anyone know how I can do this using this hardware device?

    Thank you

    Hi lrving9,

    First you need the DAQmx driver, here is the link for you to install the latest version.

    NOR-DAQmx 15.0.1
    http://www.NI.com/download/NI-DAQmx-15.0.1/5353/en/

    If you already have it, so go ahead and take a look at this example:

    It shows you how an analog DC output voltage.

    Community: Output analog voltage constant
    https://decibel.NI.com/content/docs/doc-18631

    So you have a block of connection to connect the signals?

    If you do, then you can simply create a task to read a continuous voltage entry, as in this example

    Community: - Input voltage
    https://decibel.NI.com/content/docs/doc-25105

    If you do not have a connection block and have no way to connect the OD to HAVE, then you can read the inner channel of AO, as shown in this link (there is an example at the bottom):

    It is Possible to read the value of the digital or analog output channels?
    http://digital.NI.com/public.nsf/allkb/CB86B3B174763C3E86256FFD007A2511

    Also when you install the driver a few examples are installed as well, this shows you how to get them:

    Where are the examples of NOR-DAQmx installed?
    http://digital.NI.com/public.nsf/allkb/E3BAF6FC4017960B8625755A00525D37

    Kind regards

    Caroline

  • Start-up delay triggers real beginning of the acquisition of waveform on SMU-6535?

    How long does take a condition of trigger start happening to the actual start of the acquisition of waveform on an SMU-6535?  In my case, it takes ~ 70ms, who seems to be too long.  The delay times, I found in the manual are all down in one nano-second two-digit range.

    Here's a little history: I'm trying to measure a PWM signal to report cyclic verity, generation of total time, frequency, etc.

    The PWM signal is entering in the SMU-6535 on line Port3/3, and I rider Port3/Line3 to PFI5 on my map of derivation.  Start trigger is configured to fire on the PFI5 front, with the acquisition of waveform happening on Port3/Line3.  PFI5 and Port3/Line3 consider both the same waveform PWM, which is the yellow signal out of range.

    The task is configured to use a sample of 10 Mhz clock frequency and collect samples of 2 500 000, coming at a time of acquiring signals 250ms.  You can see on the scope probe that there is a gap in the PWM signal.  I want to collect just the first section, and I know that the article is (or should be) long 250ms.

    However, I am very clearly this gap and 70ms ~ the next wave PWM of the PXI system.  PXI signals is checked 250ms.  The problem is that it is delayed by ~ 70ms when the first time PFI5 goes high when it actually starts the acquisition.

    Ignore the ringing.  The probe is not the best reference.

    Here's the installation code:

          readPwmTask = new NationalInstruments.DAQmx.Task ("task of reading PWM");
    readPwmTask.DIChannels.CreateChannel ("PXI1Slot6, Port3/line 3", ", ChannelLineGrouping.OneChannelForAllLines);

    readPwmTask.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger ("/ PXI1Slot6/PFI5", DigitalEdgeStartTriggerEdge.Rising);
    readPwmTask.Timing.ConfigureSampleClock ("", 10000000, SampleClockActiveEdge.Rising, SampleQuantityMode.ContinuousSamples);

    Reader = new DigitalSingleChannelReader (readPwmTask. Stream);
    drive. SynchronizeCallbacks = true;

    drive. BeginReadWaveform (2500000, New AsyncCallback (DataReady), readPwmTask);

    Narrowed it down.

    This problem only occurs when it is the first acquisition of signals in the life of the application.  If I do a 'normal' acquisition before attempting to use the departure function acquisition, it works much better.

  • DAQmx task Read DAQmx with sampling frequency of 10 Hz produced much too much data

    I have a simple configuration with a strain of channel 4 OR-9237 amp holds a carrier of series C of WLS - 9163 (wired ethernet mode) - Details probably does not matter.

    I used MAX to create a DAQmx task associated with which all four gauges samples.  The calendar setting is "Scan Loads" is continuous sampling, 2 k buffer (read samples) and 10 Hz rate.  I guess that this task would generate 40 data values per second - 10 for each channel.

    I have a simple loop of reading using DAQmx Read.vi that works always (without any stimulation time).  Playback is set to read all available data and then pump it into a table.
    In the attached example, I also added a few words of debugging to stop the loop after N iterations.

    As the loop is programmed with a 0.2 second period, I expect each pass of the loop to read about 8 samples or 2 samples per sensor.  Instead, I get hundreds each passage.  It's like reading has substituted the sampling frequency specified in the task of the unit.  I absolutely need data to be material to the rhythm.

    Where have I lost?

    Thanks Adnan,

    I changed your example I selected 'Strain gage' entry analog and then lowered the minimum and maximum thresholds to +-1-2.  What happens is that each other in the loop, I 2048 samples or zero samples.  The display flashes a whole line and then it clears any other past.

    In response to your second post, I understand that the loop cannot run quite right that I select.  I think that, but at a sampling frequency of 10 Hz, I have to sleep on the software side for nearly a minute before I built 2 K samples.

    I played with the frequency of sampling, assigning to various values from 0.1 to 10000Hz.  The behavior is the same until I approach the high rates where available samples remains to 2048-4096 sometimes, the display becomes continuous.

    Ahhh, Darn.  Yet another search was this link that points to the root of my confusion.  The 9237 can taste arbitrary rates using its internal clock.  Duoh!  I wish that the pilots are smart enough to warn you if there is a discrepancy between the selected sampling rate and capabilities of the device

  • Programmatically, create a multi-channel DaqMX task

    Is there a way to create a task of multichannel DaqMX programmatically, without having a task to copy?

    Yes and it is an easy way to find a way to do it.

    Start by creating a task in MAX (Ben, but I want to avod MAX!) Don't be afraid that it's just a one time event that will allow us to know what are the steps)

    Go to a block diagram and steady decline DAQmx task on the diagram and choose the task you created in MAX.

    Right click and select 'create configuration and example '. LV will create the code that goes with the taks.

    Study the config VI that was created. It will show you what it takes to create a task without MAX.

    I hope that helps!

    Ben

  • How to set up wizard DAQ or DAQmx tasks using an external text such as a CSV file?

    I work in an environment were we have a lot of users VI. I develop the VI and technical personnel using the GUI (cover Page) to collect the data. In order to control the input parameters used on multiple hardware platforms, I'd like to develop a generic VI which will import or read a text file I created, and configures the DAQmx tasks to perform data acquisition. In fact, I have the generic VI full and need to understand how to make configurations DAQmx more transparent for the end user as long as the end user has the text file to import. For example, to generate the wizard DAQ DAQmx tasks based on information from text file?

    I don't have time to do more than just a small example. The VI below contains a table with table fixed index functions. This would have changed to get automatically the correct rows and columns, but I hope that you have an idea. I does not have any code to define the type of temperature measurement or to set the correct configuration of Terminal. All of this plus all other possible options will be treated similarly to the definition of the type of channel and min/max which is located in the example.

    Edit-attach VI

  • Convert DAQmx task IDS in a string

    I'm using LabVIEW to perform a generation analog DAQmx and I call my LabVIEW of CVI code via a dll.  I want to make two separate calls, one to start a task DAQmx and one to stop the task, so I need to either:

    (1) move a task ID DAQmx CVI and then again to LV

    or

    (2) convert a string of the ID for the task, pass it to CVI and then back to LV and then convert back to a task ID in LabVIEW.

    I'm sure that option 2 is the easiest option, but I don't know how to convert back and forth between a string and a task ID DAQmx.  Can anyone help with this?

    Thank you

    Joe

    Nathand is correct, it's pretty easy convert from/to the task DAQMX and String.  The two below

    Hmmmm is note expected or a bug?

    Feedback probably need an expert of DAQmx to answer that - I think it might be related to level DAQmx tasks

  • I lost the bar background tasks, start menu and help on my windows 7__

    I lost the bar background tasks, start menu and help on my windows 7

    Hello
     
    1. are you able to use the icons on the desktop with success?

    In addition to the suggestion of BurrWalnut you can see the methods below.

    Method 1.
    You may have set the taskbar to auto hide, check the settings below:
    a. Click Start and select Control Panel.
    now, (b) go to the menu bar of tasks and put in service and click on it.
    C. on the taskbar tab, check if there is a check mark next to auto-hide the taskbar.
    d. If there is remove it, then click on apply and then OK.

    Method 2.
    Please check if you are facing the same question when working in safe mode.
    a. restart your computer.
    b. when the computer starts, you will see your computer hardware are listed. When you see this information tap the F8 on your keyboard key repeatedly until you are presented with the screen Windows 7 Advanced Startup Options.
    c. using the arrow keys, select the desired option of Mode without failure.
    d. press the Enter key on your keyboard to start in safe mode of Windows 7.
    e. when Windows starts and check if the problem still persists.
    For more information, see the articles below.
    Start your computer in safe mode
    http://Windows.Microsoft.com/en-us/Windows7/start-your-computer-in-safe-mode
     
    Troubleshooting in safe mode
    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshooting-problems-while-in-safe-mode

    I hope this helps.

    Thank you, and in what concerns:
    Shekhar S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.
    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • How to determine the number of highlight ' to write ' for DAQmx generate analog output?

    On the configuration of the stage for DAQmx generate analog output, there is a field "value to write.  I can't find any explanation for what it is, how it determines the value to enter, nor what he writes.  I am trying to go through the tutorials and it cling.

    Someone would give an explanation?

    Hello

    To write value specifies the value to write in the channels, lines or ports selected in string parameters. In other words, this value will be the value of your DC output (for example if you enter 5, your output will be 5V). To get information on different fields in SignalExpress, access help"context-sensitive help. A pane will appear in your work environment that displays the coordinates of the field when you place your pointer over them.

    For new users of SignalExpress:

    Generation of DC signals with NI DAQmx devices: step in the DAQmx build, select 1 sample (on request) in the generation Mode dropdown. You can select a programmatic input to generate, or you can remove the check mark from the check box use programmatic input and specify a value for generating in the field of value to write . NOR-DAQmx help also provides additional information about the data generation.

    Best regards

    M Ali

    Technical sales engineer

    National Instruments

  • How to add DaqMX task to an existing project

    I use Measurment Studio 2010 with Visual Basic. I created a NI Daq Windows application with an element of task Daq to analog input.

    Now, I have to add additional DaqMX tasks (tasks in digital and Digital Out) to the existing Visual Basiic project.

    How can I do this?

    Thank you

    Mike

    Hello

    Here is a link that shows how to add a task to a .NET project

    http://digital.NI.com/public.nsf/allkb/290D84D10809D4C086256FF20076F8B8

    Curt

  • SE AcceesViolationException NationalInstruments.DAQmx.Task.UnregisterAsyncWaitHandle

    Hello

    I use my own .net application which communicates with NationalInstruments.DaqMx.dll (version 9.7) in order to activate NiDaq in the following configuration:

    Chassis PXI-1033 at two locations PXI-6284, measure differential voltage. This app worked already for a few months and has been tested under high performance - high sampling rate and long hours, without no problems so far. Recently, we tried a new use case - short sessions (60 min) measures running in sample rate = 100 and samples per channel = 100 after a few iterations, we continue to get access violation exception:

    Exception info: System.AccessViolationException

    Battery:

    to NationalInstruments.DAQmx.Task.UnregisterAsyncWaitHandle (System.Threading.WaitHandle)

    at NationalInstruments.DAQmx.Internal.DaqAsyncResult.AsyncOpDone)

    at NationalInstruments.DAQmx.Internal.AnalogMultiChannelMemoryOptimizedMultiSampleReadAsyncResult.WorkItem (System.Object)

    at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object)

    at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

    at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)

    at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem)

    at System.Threading.ThreadPoolWorkQueue.Dispatch)

    at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback)

    Keeping the sampling rate 100, but his definition of samples per channel at 1000 seems to solve this problem.

    Can someone explain to me what is the cause of this exception?

    Thank you

    Hadas


  • How to store a DAQmx task properties effectively?

    Hello everyone and happy new year!

    I would like to be able to keep track of all the DAQmx task settings (and canals) in a file, regardless of the content of the DAQmx task / channel is. So far, the only way I've found is to use a task DAQmx / channel property nodes and treat every property possible. However, since they are so many properties, each being is not valid for any material or task / channel type, it's a really big job and I'm rather lazy

    So I ask here if someone has already dealt with THIS or have any idea?

    Hi Hillman,

    Thank you very much for the link. Related documents Silly me had neglected tdm... Your link is indeed very useful, as I do right now exactly the same way it's done the:

    • DAQmxTaskInfoQuery.vi
    • General info.VI DAQmx TEDS

    As part of the download in the link you gave.

    Exepted this code is much more readable than mine, so I guess I don't need to view my ugly code incomplete. Many things interresting, thank you very much. I'll be back if I have something better to give as a reference.

  • DAQmx task: MAX or lvproj?

    Experts,

    What are the benefits to declare tasks DAQmx either in the lvproj or Max?

    My question because I'm calling a VI of TestStand test, and when the DAQmx task constant is declared in the project (lvproj) which holds the criterion VI, it does not perform properly, saying can't find the reference or something.

    If I change the DAQmx task to be a global task in MAX everything works as expected.

    What is the best practice to do this kind of things?

    Thank you very much

    LR2

    TestStand does currently not support execution of VIs a project. So unfortunately, we expect the behavior that you see where to call a VI that uses a DAQmx task defined in a project does not work. For now, if you do want to keep your configuration of the task outside the source code and you want to use these task for TestStand, you must store the Max.

    We are looking for by adding support for the performance of screw a project in a future version of TestStand.

    David Rohacek

    National Instruments

  • Computer started to delay the result with a click of a button, etc. by seveal seconds.

    Have aw computer laptop Dell Inspiron 1501 XP SP3. Computer started to delay the result with a click of a button, etc. by seveal seconds.  A ran the anti-virus, malware search, keylogers search and found nothing.  The delay also occurs when you use an application such as CorelDRAW, Word, WordPerfect programs, etc.  any ideas what is happening or where to look? Thank you.

    You experience this delay all the time, or they occur from time to time?

    Could complete you the following procedure to obtain information about your current system and post here, so I can be more specific in suggestions.
    0 close the programs as open as you can before the first step.
    1 copy the following line below exactly as it appears:
    Taskpad cmd /C /V > tempo & tempo notebook
    2. press on + R
    3. paste copied line run window and press enter or click Ok.
    4 copy all the information from the Notepad window. (The list can be long, you can use + a combination to select all)
    5 paste info copied to the next reply.
    6. after that you can close the Notepad window.

  • Change the color of the task/start bar

    I am trying to change the color of my task/start back to the standard blue bar but I can't find it anywhere please help!

    Try:

    Right click on Desktop > properties > appearance tab > under colors, select 'default (blue) '.
    Microsoft® Security MVP, 2004-2010

Maybe you are looking for

  • Apple Watch MLCF2 Sport

    Hello I know that this community is on the problems and bugs, but I couldn't find an answer anywhere on the web of th My question is what is the Sport of MLCF2 Apple Watch and what differences there are between this and the Apple Watch Sport. Thanks

  • Skype is disabled

    I have put Skype in place for automatic start at the start of my computer. However it will be random for disabled in the menu in the Task Manager in windows 8.1 my startup. Anyone know why it continues to be?

  • Guard MS Update offers updates of product (s) /Ko who IS / has BEEN installed

    When I launched Windows Update, (IE8 > tools >...) using Express or Custom, it is show three updates to install. and all 3 are installed. After I saw what I checked history update [SP (silkscreen)] which show the update has been installed sucsessfull

  • Recovery Does not reinstall Windows on HP Pavilion dv5 - 1127cl

    Hello Recently, I tried to do a reset to factory my laptop. I used the recovery partition by pressing F11. He traveled all the HP software reinstall it but then would randomly turns off when you try to reinstall windows. I tried the process of recove

  • import libraries/modules Groovy?

    Is it possible to use a Groovy library into the FMS to extend the functionality? I want to run an LDAP query to check the status of an AD object and then possibly send an email. I think I can do that by triggering a command or action of the remote co