Two DAQ tasks in a certain sequnce

Hi everyone
my mission includes two DAQ task, one is AI (voltage input), the other is DO(counter PWM output). the problem lie in the somewhat time sequence. that is,
in a word, the recording (AI) is a little longer than generating (DO).
for clear description, there are three episodes, 
1. recording began and last  50ms, at 1000Hz rate,
2.the PWM generation began after recording began 50ms, the PWM frequency and duration could be set by a controler, meanwhile, the recording go on
3.when the PWM output ends, the recording   keep last 100ms, then recording completes.
the point is that the recording couldn't be disrupted by the PWM in the whole mission.
How could I  arrange the two task ?
my card is a M series one.
THANK YOU advanced

Yamaeda 已写:
- Setup the two tasks
- Start AI task and Read 1D array of 50 values (samples)
- Start DO task.
- Poll Task complete in a 0ms wait loop
- wait 100ms
- Read AI task 1D array with -1 samples (grab all)
/Y
Thank you very much! Yamaeda.
I am freshman. May I ask more clearly?
1.Do you mean that it doesn't obey syntax? when a task line include more than one "DAQmx read.VI", and as a matter of affect, the recording isn't interrupted between two DAQmx raed.VI?
2.How to merge the the two"read.VI" output in one awaveform chart  rather display them separately in two chart?
3.How to insert a wait in the DAQmx task? use a sequence structure with a "programing/time/wait" or a "time delay express VI"?
thank you again!

Similar Messages

  • How can I combine these two DAQ tasks???

    I am using LabVIEW 11, Windows XP, cDAQ-9174 chassis, two NI-9205 modules.
    Please see my code for reference. I am very new so i will accept all suggestions.
    I am acquiring 12 volatage signals in a producer/consumer structure giving me a queue of 1-d array of waveform(dbl). Then I am acquiring 12 voltage signals in another loop giving me 2-d array of waveform(dbl).
    There is an issue creating the channels. How can I combine these two tasks?
    Thanks,
    ~Chris
    Attachments:
    WaveTest_6.2.vi ‏558 KB

    Hello chrisbe723,
    When you say that there is an issue creating the channels, are you getting a specific error message when running your code? Also are you referencing the same set of channels for the two DAQ task you are configuring?
    Paul-B
    Applications Engineer
    National Instruments

  • How do I use two DAQ cards in one Labview code? Current I'm getting error " error 200558 occurred at DAQmx Create Channel.vi. One task cann't contain multiple independent devices". Can someone help me?

    The two DAQ cards are NI PCI-6070E & NI PCI-6052E. The Labview I'm using is labview 7 Express and the Window system is Window XP. I'm using NI SCXI-1000 chasis and SCXI-1102 & 1102B two modules plus a feedthrough SCXI-1180. 1102 is connected through SCXI-1349 cable to DAQ card 6052E while 1102B is connected through SCXI-1349 cable to DAQ card 6070E. SCXI-1180 is connected to 6070E through SCXI-1349 adaptor on the back of 1102B.

    Sarah, thank you for replying my question. It seems that I'm making progress everyday (smile). I'm able to run the test using both daq cards in my code now. But as I'm moving forward, I'm getting new questions too. How do I use one STOP button to control both tasks and how can I save data into one single file?
    I attached my code here hoping you can get the specifics on my application by looking at the code. Thanks very much!
    Thanks.
    Attachments:
    DAQmx_Task_Example_plus_voltage_2.vi ‏416 KB

  • What is best implementation for two human tasks?

    I am trying to find the best way to do this,
    I have two human task workflows that I have created. The application we are making uses one of these workflows based on a parameter you give it through a text box. So lets say you have workflow A and B. If you select A it will run and do workflow A and vice versa. These workflow also have different inputs associated with them for review.
    My question is what is the best way to implement this?
    My first thought is to create two separate projects, one that does workflow A and the other does workflow B and deploy both composites to the server, and have two separate form projects in the Application deployment.
    There is also another way I was thinking about doing this which is to have a mediator that takes in input and either goes from one bpel process or another bpel process, my problem with this is I don't know how to make certain fields in the webservice payload not mandatory. So any advice on this would be helpful.
    Is there any difference in the performance of these two ways? Which way is better?

    I am trying to find the best way to do this,
    I have two human task workflows that I have created. The application we are making uses one of these workflows based on a parameter you give it through a text box. So lets say you have workflow A and B. If you select A it will run and do workflow A and vice versa. These workflow also have different inputs associated with them for review.
    My question is what is the best way to implement this?
    My first thought is to create two separate projects, one that does workflow A and the other does workflow B and deploy both composites to the server, and have two separate form projects in the Application deployment.
    There is also another way I was thinking about doing this which is to have a mediator that takes in input and either goes from one bpel process or another bpel process, my problem with this is I don't know how to make certain fields in the webservice payload not mandatory. So any advice on this would be helpful.
    Is there any difference in the performance of these two ways? Which way is better?

  • How many DAQ tasks per loop?

    Hi to everybody, I hope anybody can help me with the next case:
    I am working on a system in which I have to read signals of 5 different sensors which have different ways to communicate (4 - 20 mA, voltage, RS-232, ModBUS, etc.) with the DAQ Device (cDAQ in my case), at same time when I am reading the variables I must check for the state of several digital inputs to verify connections and if any is interrupt I must stop the Data Acquisition.
    My question is if is recommendable to put all the tasks in a single loop with the logic shown in the attached image.
    Or if I should divide the tasks in a multiple loop architecture.
    If the answer is the second, my next question is: How many DAQ tasks per loop is OK?, my doubt is based on the number of variables that I am going to read
    and the different ways to get the measures, specially which are by protocols (ModBUS, RS-232), all this by the response time.
    Thanks in advance, all suggestions are welcome!

    I would recommend using a loop just for control and UI events.  It should only have an event structure.  Don't use the timeout case, since that just turns the system into a polling.  Use Queues to send data from the controller loop to your other loops and User Events to send data back to the controller looop.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • OIM - starting two process tasks simultaneously

    Hello,
    I have a process definition with many process tasks. If a certain trigger/event happens (eg. Change Last Name) I want to run two particular process tasks. How do I achieve this? My guess was to use the option to generate new tasks based on the response code, but I didn't manage to build such a task yet. How do I configure a new task that only initiates/generates two other tasks?
    Joost

    Hi Ryken - each background task is its own entity, so each task should get 16Mb of memory as described
    here.  Also, each task gets its own 2 seconds to execute.  The tasks do not combine resources.  I do not think that you can share statics between the processes,
    but you're welcome to test it out and prove me wrong.
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • Start - stop with two daq counters

    I have the following problem:
    I have two channels. One channel consist of one ttl pulse, repeated with a frequency nu1. The other channel consist of two ttl pulses (with a certain distance in time deltat1= (B-C)), repeated with a frequency nu1.
    The scheme below should help to visualize
    ......][......A....................][.....
    ......][............B....C........][......
    I would like to measure the time difference B-A, and C-A.
    Is there a simple way to do that using the counters? I have a DAQ card of NI with two counters on it and LV 6.0. Any suggestion would be greatly appreciated.
    Thanks you a lot
    -Claudio

    Hi,
    What you need is 'Two Edge Seperation Measurment', and this is only available on a NI-TIO based devices (660x family). This can not be achieved with the card you have - I assume it is an E-Series card. There is a shipping example that ships with LabVIEW 6.0 that would measure edge seperation (Two Edge Seperation Measurement (NI-TIO).vi).
    Regards,
    RamziH.

  • LV 8.21: strange behavior with DAQ tasks, parallel running VI's and shift registers

    Hello,
    I have made a VI using DAQmx vi's. The VI uses shift registers to store DAQ tasks and other (internal) information. I have implemented  several modes of operation (enum control with a case structure) like 'init', 'read AD', 'config AD' etc. If I use this multi mode VI in a single main VI everything work as expected. I have attached a jpg that shows one example where the DAQ VI is called from 2 parallel running while loops. One loop aquires the data (LOOP 1) while the other loop configures the aquisition task (LOOP 2). If I implement the same thing by putting LOOP2 in a different VI that runs seperately from the first VI I get an error message (200428):
    Possible reason(s):
    Measurements: Value passed to the Task/Channels In control is invalid.
    The value must refer to a valid task or valid virtual channels.
    Task Name: EasyDAQ_AD
    Of course, the second VI is started manually after the 1. VI has passed the initialization part. The error message is triggered from the 1. VI that executes the DAQ task. From my understanding of the LV execution system this seems like a bug to me. Does anyone have an idea what could go wrong here?
    klaus
    Attachments:
    problem.jpg ‏30 KB

    1. In general, this kind of technique is something I've been using successfully for years.  (Ben recently wrote up a very nice treatment of these "Action Engines" as a "Community Nugget.")  So I don't start by expecting this to be a bug in the LV execution system.
    2. Your description of the problem sounds almost backwards.  You say you manually start the 2nd vi ("Config AD") *after* running the 1st vi ("Read AD").  Seems like you'd need to do the Config 1st and then do the Read, right?   I kinda suspect you actually did it in the right order, but described it wrong.
    3. The next likely scenario is that the Config failed, but you didn't trap the error and were unaware of it.  Then it makes sense that the Read would also fail.
    4. A couple issues I regularly deal with in these DAQ Action Engines is internal error handling.  I often keep a shift register inside to store errors generated inside the Action Engine.  But it can get a little tricky doing sensible things with both the internal error and any other error being wired in as input.
    I said all that so I can say this: if you have complex nested case statements, or lots of different action cases to handle, double check that the task wire makes it from all the way from left shift register to right.  Sometimes they get lost if they go through a case statement, the output tunnel is set to "use default if unwired", and 1 or more of the cases don't wire the output.
    -Kevin P.

  • DAQ task update during running task

    Hi,
    I hope sombody can answer this question.
    Is it possible to update a running DAQ task without stopping the task?
    In my task I have an analog output and I want to change the amplitude and/or the duty cycle of the output waveform.
    Stopping the task and starting again with new parameters needs to much time.
    Thank you,
    Robert

    If you're just looking to write new data to the task then there shouldn't be any need to restart it (you can use AO with non-regeneration like DianeS mentioned).  I wanted to make sure to mention that we have an online example that does just this:
    Update Multiple Channels of Analog Output On-The-Fly
    Additionally, there are some properties that are settable while the task is still running (e.g. AO Sample Rate can actually be changed on-the-fly on many of our Multifunction Boards).  Other properties (e.g. AO Voltage Range) cannot be modified without first stopping the task.  If you need to stop the task and reconfigure, Ben's method is a good idea.  I am aware of an example that does this for Analog Input tasks but I don't think we have one for AO.  Here's the link to an AI version in case anybody is interested (unlike AO, the AI Sample Clock is not changeable on-the-fly):
    Switching Between Multiple Analog Input Tasks in DAQmx
    From what it sounds like, the first link should be exactly what you need and you shouldn't need to worry about restarting your task.  Just add Duty Cycle to the control cluster and wire it into the
    correspnding input of the Basic Function Generator.  If you have any questions about it or run into any issues don't hesitate to let us know!
    Best Regards,
    Message Edited by John P on 03-25-2010 06:35 PM
    Message Edited by John P on 03-25-2010 06:36 PM
    John Passiak

  • Synchronizing the read of two timer tasks (Period and Two Edge Separation)

    Hello,
    I am using labview 2011 and need to latch the data from two timer tasks of a 6602 board at the same time and then perform the read. One task is a period measurement the other is a two edge speration.  It sounds pretty simple and I am sure it is, I just haven't located the correct information yet,  If someone would point point me in the correct direction.
    Thanks,
    Mike

    While it's true that a digital edge arm start trigger can help to sync the tasks to begin together, the nature of the measurements you're making also have a big impact on whether you can depend on the buffered data remaining "synced."   Both measurement types will latch measurement data at times determined by the signal(s) being characterized.  You cannot configure either task type to sample at a known constant rate.  You can only accept samples at the rate dictated by the signals' own edges.
    Ok, so having said all that, here are some implications:
    1. a cumulative sum of all your period data will effectively give you timestamps for all the active edges, with t=0 set by the arm start trigger edge.
    2. there is no information inherent in a two edge separation measurement that can identify the time relative to the arm start trigger.  You'll get a bunch of measured interval times with completely unknown times between those intervals
    3. caveat: if you are somehow using the same signal edge for both measurements AND getting one measurement of two-edge separation for each and every period measurement, ONLY then would you be able to reconstruct the timestamps relative to the arm start trigger edge.
    So I'd caution you that the idea of latching readings in sync or reconstructing relative edge times between the measurements is pretty unlikely to work except under some very specific circumstances.
    -Kevin P

  • Two output tasks on one device

    I would like to learn the best way to configure two output tasks on one device. Both tasks employ the same channels. Task 1 outputs a 2D array (raster pattern on some channels and DC on others) for which the array values and array timing may change during the rastering. Task 2 outputs only DC values in a 1D array: one value for each channel. There is a Boolean that turns the rastering on and off.
        Should I have two separate tasks or one task where the DAQmx Timing and DAQmx Write change according to the raster on/off switch? Do the tasks need to Start each time an array value is changed? I've come close to making it work both ways and the major problem seems to be a "resources are unavailable" error when I want to stop everything and send 0 to all the outputs.
    Thanks, Peg

    Dear Paul,
        Thanks for your response. I have managed to produce a vi that seems to work with just one task. When changing back and forth from rastering to non-rastering, the task is stopped and started, but never cleared until the vi ends. What I don't understand is why new values are output even though I don't call Start Task each time a value is changed. I'm happy it works but I'm nervous that I don't know why. I have attached it in case you (or anyone) has the patience to take a look.
    Thanks,
    Peg
    Attachments:
    DAQmxAO Write DC& Raster switch.vi ‏280 KB

  • Custom Scale behavior with DAQ Task running

    Hi to everyone, I am implementing a Polynomial Custom Scale for a sensor, but I have doubt about what happens if I change a Custom Scale and my DAQ Task is running, I suppose that the Custom scale does not change on the fly but my questions is if I have to clear the Task to apply the new custom scale or is enough with Stop the Task and Start the Task again.
    I am using the DAQmx functions for the code. Thanks for your help.

    Hi AYanez!! 
    Thank you very much for using NI Discussion Forums!!  I found a post that deals with the same issue you are trying to solve for your application.  It seems that you have to stop the task for the new scaling properties to be applied.  Take a look into this thread:
    Programmatically applying a custom scale in an active VI
    Hope this helps!
    Regards,
    Anuar R.
    National Instruments México y Latinoamérica
    Ingeniería de Aplicaciones
    www.ni.com/soporte

  • DAQ Task in Project is incorrect in distribute​d copy

    Greetings all,
    I have a question that I can't find the answer to w/ the search.  This is odd, but I've generated a DAQ Task in Project in LabWindows that reads a thermocouple and displays temperature in F.  It works well until I created a distribution disc & installed it on the computer where it will live.  The task works properly, except it displays temperature in C... how can this be? Have I missed something in the distributions section, or is there something else I have to do to the destination machine?
    I will add, I have 2 of the DAQ cards, both 6036E.  Would it be that I'm using a different card in the destination?
    Thanks,
    Rob

    Rob,
    There should be an option in one of the Advanced Tabs when you are building the distribution CD/installer for Including your hardware configuration with the installation. (It should be something along the lines of "Include my Hardware Configuration"). Ensure that this is checked when you are building the distribution so that the hardware configuration can be associated with the program and not just the card. It sounds like moving the 6036 over with the system worked because it was already configured to read in F whereas a different card might now have been without the program storing the hardware configuration information.
    Timothy
    Timothy S.
    PXI & VXI Platform Product Support Engineer

  • Export DAQ Task created in Labview to MAX

    Hi,
    Is it possible to export a DAQ Task that was created in labview so that it appears in "Data Neighborhood / NI-DAQmx Tasks" in MAX?
    Thanks,
    James
    Solved!
    Go to Solution.

    Never mind...
    Found it as "DAQmx Save Task"

  • Is it possible for a DAQ task to just stop responding to commands?

    The software I am working on controls a NI USB-6501 digital I/O device using the NI-DAQmx library.  When the software initializes, it attempts to create 10 "tasks" (for different I/O lines of the device) using DAQmxCreateTask().  If any of the tasks cannot be created, the software should close with an error message. 
     if ((!CreateTestModeTask(&TestModeTask, USBdevname)) &&
         (!CreateChooseDUTTask(&DUTSelectTask, USBdevname)) &&
         (!CreateChargeStatusTask(&ChargeStatusTask, USBdevname)) &&
         (!CreateInitLinesTask(&InitLinesTask, USBdevname)) &&
         (!CreateChargeEnableTask(&ChargeEnableTask, USBdevname)) &&
         (!CreatePassFailEnableTask(&PF_EnableTask, USBdevname)) &&
         (!CreatePassFailResetTask(&PF_ResetTask, USBdevname)) &&
         (!CreatePassFailStateTask(&PF_StateTask, USBdevname)) &&
         (!CreatePassFailWriteTask(&PF_WriteTask, USBdevname)) &&
         (!CreateResetDUTTask(&ResetDUTTask, USBdevname)))
         continue running the software
    else
         show error message and close software
    Once the tasks are created, the software goes on to use them to manipulate the I/O signals of the NI USB-6501 device with DAQmxWriteDigitalLines() or DAQmxWriteDigitalU8().  The software does not check whether these functions return an indication of success or not... The assumption is that it works every time.
    This is my question:
    At run time, is it possible for a successfully created DAQ task to simply stop responding to commands?  This is what I believe happened.  I observed it only once out of hundreds of trials, but it is still a great concern.  Only 1 task stopped properly controlling the NI USB-6501.  All of the other ones continued to work properly. It continued to misbehave until I closed and re-started the software (thus re-creating all tasks).
    And if it is possible for a task to simply stop responding, is there any way to prevent it?
    -Mike

    Your assumption that instructions will work every time without facing errors is excessive in my opinion. I never observed a daqmx task simply stopping responding to commands: every time it happened, an error condition was raised explaining the misbehaviour.
    I would add some error checking where you are manipulating the daq board and look into the informations the error message gives you.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

Maybe you are looking for

  • How can I move an iMovie Project to an external drive in latest version (10.0.7)

    I am trying to transfer an iMovie project from my desktop to my laptop to work on it anywhere. I have seen ways to do this in earlier releases but they do not work for the current version (10.0.7.) I have a Mac OS Extended (journaled) USB drive. Prev

  • Webservice returning bean

    Hello All, I have one web service which returns java bean, this bean internally incorporated different beans so my response is like this: <S:Envelope xmlns:S=" http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:GetConfigResponse xmlns:ns2=" ht

  • My MacBook pro airport is not picking up IP address, how do I fix this?

    All this started after an automated update by the computer. Anyone else with this problem?

  • Routing creation with material assignment

    Hello sap gurus,     I have created routing for semifinished product.Now i want to create routing for finished material but i want to use the same routing as we created for semifinished product by material assignment function in routing.when i go to

  • Microsoft Office:Mac for iPad2

    I recently installed Microsoft Office:Mac on my iMac. It came with license to install to up to 3 computers. I want to download it to my iPad 2 so that I can use Excel, Word & PowerPoint on it. Is that possible? Does anyone know how to do this? Thank