excute twice DAQmxwrite in a single task

Hello community,

I work on a generation of signals, it looks like this

because of the short time, making the whole of the signal as a wfm is not a good idea, so I want to do like this,

so it turns out that he will write twice in each cycle of the loop, but there is an error (error-200288 code), I can't really in trouble on.

I need your help.
I hope that I made it clear.

Thanks in advance.

badstone

Hi Melaniee,

Sorry, I did not clearly.

but I fingured solution.

Thanks again for the help.

Best regards

badstone

Tags: NI Software

Similar Questions

  • combine two daq physical channels in a single task

    Hi all!

    I use a PCI-6120 with a BNC-2120 to generate two signals: one is used to control an optical device which must be characterized, and the other signal is sent to a digital video camera to trigger the acquisition so that it is synchronized with the first signal. Everything is controlled with Labview.

    I want to give the possibility to the user to choose which channel to use for the first signal and channel to use for the second signal, depending on how the devices connected to the BNC-2120. So I would like to put two different "physical channel" screws on the Labview command window.

    My question is:

    What I need to create two different tasks to the signals to be generated on the appropriate channel, or can I combine two channels (and how?) think I handle only a single task to two channels always but do not forget that each signal is generated on the corerct channel, depending on the channel selected for each of the two signals...?

    Thanks a lot for your answers.

    Nice day.

    Luke

    Hi LucG,

    If you use only a single Council to create only a single task for two generations.

    You can choose several channels by clicking on "Restaurants" in the channel control physical choice multiple channels thanks ctr + click, or by concatenating multiple channels with a comma as on arrival at the VI.

    Then, when you provide data to the VI of writing, the data should be organized in a table, each channel is on a line and the order of the channels is the same as in the control of the physical channels.

    I hope this can help!

    Thank you

  • The easiest way to add several single-task in a new task of multiple channels

    Hi all users of LV!

    I've created several single tasks in MAX. To simplify things, we will assume that they are all of the same type (analog current - voltage). In addition, each task is characterized by specific properties such as the custom scale, the final value of configuration, max, and min, etc..

    I ask you to show me (if it exists) a simple way to add programmatically (merge) all of these channels in a multichannel new task, now clearly all the specific properties that I mentioned earlier. For 'simple', I mean fast, which is not need too much coding and reduce as much as possible the use of knots of property for these specific properties (see photo).

    Thank you in advance!

    Marco

    aRCo wrote:

    Infact, in this case, my colleague tasks needs to make acquisitions directly in MAX in order to validate the hardware and with virtual tracks overall is not possible, see that a global virtual channel does not have the ability to set the frequency of acquisition and other functions. Furthermore, I can't change all of a sudden the situation and the way that someone else works.

    Then he makes a task using the global chain.  Then you can reuse the channels!

    But it could work for you by creating global channels that you currently have.

  • How to configure multi analog channels inputs in a single task

    Hello I want to acquire two signals of the two channels (input 1 analog acceleration; analog input voltage 2) without using wizard DAQmx because I have to use standard vi I use usb NI 9234 any suggestion please I tried with a chanel and I got good result but when I try two delivery channels I errors please hep me

    Hi Broutchoux,

    What are the errors you get when you run your code? This is a mistake-50103?  As long as your acceleration and your task of voltage use the same synchronization settings, you can combine the two channels in a single task.  This should fix the error you receive.  The article below has a picture that shows the configuration I describe:

    With the help of different Types of Global DAQmx channels in the same task
    http://digital.NI.com/public.nsf/allkb/3296BA2AEF586B7386256D6D00528E3D?OpenDocument

  • PXI-13 6133 in a single task OR DAQmx?

    Is it recommended to use the PXI-13 6133 in a PXI-1044 + PXI-8106 in a single task?

    Installation program:

    PF0 trigger every 40ms

    Sample PF8 103kHz clock

    samples of 1020 per channel

    Hello Jainsch,

    just a little addition:

    Please set the speed of the fan in the back to 'HIGH' and insert a Slot-blocker in all empty slots to improve airflow (cooling).

    http://sine.NI.com/NIPs/CDs/view/p/lang/de/NID/206303

    Kind regards

    N. Ralf

  • Dedicated for each channel from multiple channels in a single task task disadvantage

    Hello

    My current acquisition software (C + c++ / GCC) encapsulates the methods rather clumsy niDAQmx C to interface with the data acquisition equipment in a class that represents a task of acquisition. This way I can create several instances, for example counter input, analog input, analog output, their terminals and the class supports all work low level as ensuring input analog fake internal is started if there are only counter entries such as the sample clock starts, or configure reminders N-sample, etc.

    It seems to work very well, and also the time seems to be good, because first of all the tasks on multiple instances of my wrapper. For triggered early, that I use

    DAQmxCfgDigEdgeStartTrig(mTask,mTriggerTerminal.toAscii().constData(),DAQmx_Val_Rising)

    in-house.

    Now my real question: what is the advantage of multiple channels, when everything seems to work fine with multiple tasks and only one channel per task? I don't see the disadvantage, it would first classify necessary acquisitions in types (I, ao,...) because several strings in a single task must be of the same type. With my approach I need not care because each channel still gets its own task.

    I don't know I'm missing something here. Maybe someone can explain it to me, maybe some limitation of multi-tasking, I have not yet read.

    Hey!

    Unless you specified for managing the it (simultaneous sampling) or modular instruments and hardware devices (see link )

    You cannot perform two tasks at the same time that access to the analog inputs, for example, because the

    ADC is a shared resource that is connected to a multiplexer, and that only one task can work in it at a time given. (see here )

    Similar restrictions often apply to other types of operations.

    I'm not aware of any performance issues, perhaps a little more memory could be used.

    So as long as your hardware supports what you are doing, you should be ok, I think,

    and it is only a question of clarity and intelligibility, ease of use and structure.

    As you use classes, I'm sure you've heard about encapsulation - so it is a

    question of how you want to design your application.

    In addition, when you work in LabVIEW, tasks feel more natural to the principle of data flow, because you have a thread for your data acquisition,

    and it works very well with our modes of standard design.

    So, if it is better for you (and works with the hardware), you can give all the channels its own task.

    Hopefully this might clarify some things,

    Kind regards

    Rome

    OR Germany

  • High sampling rate for 18 strings in a single task - DAQmx

    Hello

    My current experiences require the acquisition of 18 channels (6 HAVE custom voltage with excitement, voltage AI 12) data at a sampling frequency of 50 kHz. My question is if it is faesible using a single cDAQ-9172 chassis. Used modules are 2 x NI 9237 and 4 x NI 9215.

    The previous researcher on this project used 2 different Renault to do this, but I was hoping that I could reduce it to a single DAQ to simplify the synchronization of all channels.

    I wrote a *.vi (attached) to do this and write to a TDMS file using a structure of producer-consumer; However, when I run the * .vi, I can run for minutes, but the number of samples recorded for the PDM is rarely more than 100 k. Subsequently a buffer size error (attempted to read from the samples that have been overwritten) with less than 200 k samples ever record. I checked the max sampling rate (using a property timing node) with the configured task as in the * .vi and it shows a maximum of 235kHz.

    I can't say if I make just the structure of the producer consumer incorrectly or if I ask too much of the cDAQ-9172 unique?

    Any help would be much appreciated.

    See you soon

    Bart

    Hi bart.s,

    TiTou speaks sampling aggregate not simultaneous, so sampling rate 50kS/s is the same for all channels.

    I see the problem in the loop of the producer. If your sampling frequency is 50kS/s/ch and you read that a single sample/ch you will lose data because the producer loop cannot run so fast. You should read more than one sample. I recommend you also to move your tracing to the consumption loop code and work with larger amounts of data.

    The second problem may be with the error handling in your loop of consumer. Merge the mistakes of loop of consumer and producer and also add a few general for two loops off if the error occurs (for example, using local variable).

    Best regards

    CaravagGIO

  • Perform a single task, if comparison 2d tables do not match

    Hi all

    Unfortunately I can't post my VI but I hope I can explain my problem well enough. I have a program where I ask for data every 10 seconds of my object to measure. Currently, I have the data (strings) output in a 2D array. As the table is very large, I essentially want to set up my code to compare the current table 2D captured with the 2D picture I captured 10 seconds ago (I use a shift register in my loop) and save the current 2D in its entirety in a file only if a items have changed (more precisely ", I save the original table and then continue to save each table which is different from the previous). I don't know how to compare berries. When I use the "not equal?" function, the output becomes an array of Boolean true/false and I do not know how to use an array of Boolean to control a structure dealing with my file save. Is there something that I'm on or a way to do this more effectively?

    Thank you!

    Right-click on the function of equal to equal, point to compare mode and choose "compare the aggregates.  This should output a single value true / false.

  • several usb-6289 maps and a single task

    Hi people!

    I use two cards usb-6289 and I want to write 64 samples (one per channel).

    Since each card has only 32 e / digital s 16 more lines PFI, I need an adicionnal 16 e / s digital in the second

    USB-6289.

    When I try to send the data, I get an error saying that "the several maps are not supported in a task.

    How to work around this problem?

    I also try to read the data of 16 lines of analog inputs in the first card USB-6289.

    PS: I am trying to send data are the Bits of the address to 16 multiplexers ADG-406

    Any help would be apreciated!

    See you soon!

    You can go there.

  • Select multiple channels for a single task - control and shift keys do not work

    Hello

    Following the advice of several other positions, I try to choose several physical channels in the drop-down list so that I can then use the function "unflatten channel channel" later. It seems that if I hold this key is pressed or cntrl, I should be able to select multiple channels in the list, however, this does not work for me. I tried to go in the "navigation key" property for the control channel to task, but there not all listed associations. Someone else has encountered this and found a solution?  I previously around that by declaring several channels by a colon (for example, ai1:3), but it does not work for the unflatten function.

    Thank you

    Claire.

    If I understand correctly, I think that you need to do is use a task property DAQmx. Try to use the channels property to get an array of strings.

  • Access a single task

    My client, a user can see several activities (using books). Customer has an application that the user must select 1. activity to work on. The idea is that it's a kind of queue and the user should not be able to choose the activity.
    We tried a solution using "lists", but the number of records in a list is not configurable, and of course the user can still click in the following link to get the next set of records.
    Any comment or idea on how to get this working?

    TXS.
    Antonio

    Hi Antonio,.

    You are right, you cannot configure the number of lines displayed in a list.

    I don't think there is a solution to your problem, because the reports do not automatically refresh.
    We use the list of activities here too and a lot of users working simultaneously on the same list. They know that they face activities in the order expiry date, so during their training, they said they must choose the first of the list and the first change the status (of waiting) to have the activity out of the list (so nobody else can take the same activity).

    I think that it is a management problem, if people don't follow instructions and start choosing their activities.

    I hope this will help, do not hesitate to ask for more!

    Max

  • Multi-channel acquisition - simultaneous Acquisition of sampling 1 & 2-channel single sample in a task

    I am able to get a multichannel simultaneous sampling on my acquisition of data (USB-6363) without problem. But what I want to do is make multi-channel acquisition in a single task where sampling requirements are different for each channel. For example, I want I want to acquire a total of 1000 samples on 3 channels in a single task with DAQmx as follows the characteristics of sample:

    • AI0: Analog Wfm 1Chan NSamp (998 samples)
    • AI1 + ai2: 1 d analog NChan DBL 1Samp (1 + 1 sample/channel)

    I know I could do just a regular multiple sampling multi-channel acquisition through all three channels then average down from channels 1 + 2, but I don't have that several samples to spare. AI0 is a bandwidth hog in my application and consumes all the samples of data acquisition (2. MECH / s), but I can save a few samples to make analog measurements further (for example, temperature, pressure).

    Ai0 takes place also permanently so additional analog measures on ai1 + ai2 need to be included in the same task.

    I don't know how to go on this matter or if it is still possible. Any ideas or thoughts would be greatly appreciated.

    Currently I use a second DAQ to read these additional channels at a lower rate but I need to pass a single data acquisition.

    How should continuous ai0 really be?  You of course can enjoy on ai0, and one of the other entries at the same time, then there would be some gap in your data.  In addition, if you want to go to the full 2 MHz, you may sample ai1 ai2 twice in order to allow entry to set (the maximum specified multi-channel rate is only 1 MHz due to compaction of the constraints on the MUX I believe).

    DAQmx sort of you lets set something up like that, if you "cheat" it by configuring each sample as a single channel in your task (see an example similar here).  If your 998 + 1 + 1 (or 996 + 2 + 2) becomes a task of channel 1000 (takes a bit more memory, but should still be feasible).

    I would consider a 2nd DAQ card a better option if ai0 really needs to be continuous.  You can go with a (9174 or 9178) cDAQ chassis a 9223 (only 1 MHz if) for quick entry and your choice of module for the slower entries.  On the cDAQ chassis a module can run a separate task of AI from other modules (up to 3 tasks HAVE by chassis) at different speeds.

    Best regards

  • One or more devices do not support multi-equipment tasks.

    Hello

    I work with 2 X USB series Renault (6356 USB).  I am acquiring data analog voltage of all 8 channels on the two Renault (total up to 16 analog inputs).  I need data acquisition to synchronize and trigger from an external digital source (a signal that I currently wired in A PFI0 of Dev).  I use a sampling frequency of 800 kHz and a 400 kS buffer size.

    I tried to use an express vi for two devices; two separate express vis for each device; and recently changed to DAQmx icons (as seen in the attachment).  Anyway, I get an error (error-201426: one or more devices do not support multi-equipment tasks.).  He referred then DevA and DevB as devices that do not support tasks.  I was under the impression that tasks multi-equipment agree with property X of the series.  I use NI-DAQmx 9.5.5.

    In the attached photo, I left most while loop.  The part of the diagram that I left out is just for viewing and recording of data, I've included parts, I felt it necessary to describe my problem.

    I would appreciate all the advice really.

    Thank you

    Leslie

    I think crossrulz is right. No worries, as they must be in separate tasks, your data is always synchronized as you want. You'll just have to do some things in the software, because not all the data will be returned in the same Bay of waveforms. What you can do is to create two tasks (one for each device), build an array of tasks, and when you do a reading, do it inside a loop for. concatenate the waveforms of each reading and you have a table of waveforms with all your data as if you read it in a single task. You also need to configure your second task to trigger the DevB/PFI0 and divide your trigger wire, he PFI0 wiring on each device.

  • change of scale of a channel running from the DAQmxSetScaleAttribute task

    Hi all

    simple system configuration: AI channel is configured using OR max and also using a scale that is configured in NI Max.

    Once the system is running, the task of the program started and playback of data acquisition, everything's fine. now I want to do is get the value of a string and reading that the DAQmx reads on the channel by chaning the ordinate at the origin of the linear scale at zero. I tried to get the y-intercept value and the actual value of the existing interception and defining the DAQmxSetScaleAttribute with the new linear value and nothing changes on the sudtracting channel. Possible solutions, I tried shutting down and restarting the task but not clearing and reloading of the task.

    I also tried DAQmxSaveScale, but the value in NImax for interception does not change either.

    is it somehting in the order of calls which must happen, or I can even change the scale on a task without compensation or recharge it the task?

    OK, that's how I got it working again noted that the system is configured using NImax and all the channels to HAVE are in a single task, also an important feature is that I use the DAQmxRegisterEveryNSamplesEvent function. each channel also has its own scale.

    First you need to find is the next shift, you need to recalcualte the max and min to the beach of this channel and save everthing.

    DAQmxGetScaleAttribute ("1Dist", DAQmx_Scale_Lin_YIntercept, & readOffset);  \\get the existing scale value
    stopDAQ();
    GetCtrlAttribute (panelManual, MANUAL_1POS, ATTR_CTRL_VAL, & actualReading);   \\reading off the coast of data acquisition
    newOffset = (actualReading + readOffset) *-1;                                                                     offset \\calcualte
    ERR is DAQmxGetChanAttribute (gDAQTaskHandleAI, "1_Unit_Ext_Pos", DAQmx_AI_Max, & max, NULL);.   cahnnel \\get NIMAX Info
    ERR is DAQmxGetChanAttribute (gDAQTaskHandleAI, "1_Unit_Ext_Pos", DAQmx_AI_Min, & min, NULL);.      cahnnel \\get NIMAX Info
    newMax = max + newOffset;
    Max = newMax;                  ------It will be ediedited what I did was made max an int to get rid of the decimal points
    newMin = min + newOffset;
    min = newMin;                   ------It will be ediedited what I did was made max an int to get rid of the decimal points
                
    DAQmxClearTask (gDAQTaskHandleAI);                                 \\clear the task due to the attached DAQmxRegisterEveryNSamplesEvent will thow errors because it is attached to the task
    DAQmxLoadTask (DAQMX_TASK_TITLE_AI & gDAQTaskHandleAI);
                
    ERR = DAQmxSetScaleAttribute ("1_Act_Ext_Dist", DAQmx_Scale_Lin_YIntercept, newOffset);
    ERR = DAQmxSaveScale ("1_Act_Ext_Dist", "1_Act_Ext_Dist", "", DAQmx_Val_Save_Overwrite |) DAQmx_Val_Save_AllowInteractiveEditing | DAQmx_Val_Save_AllowInteractiveDeletion);
    ERR = DAQmxSetChanAttribute (gDAQTaskHandleAI, "1_Unit_Ext_Pos", DAQmx_AI_Max, max, NULL);
    ERR = DAQmxSetChanAttribute (gDAQTaskHandleAI, "1_Unit_Ext_Pos", DAQmx_AI_Min, min, NULL);
            
    ERR = DAQmxSaveTask (gDAQTaskHandleAI, DAQMX_TASK_TITLE_AI, ' ',)
    DAQmx_Val_Save_Overwrite | DAQmx_Val_Save_AllowInteractiveEditing | DAQmx_Val_Save_AllowInteractiveDeletion);
    DAQmxClearTask (gDAQTaskHandleAI);
    DAQmxLoadTask (DAQMX_TASK_TITLE_AI & gDAQTaskHandleAI);
    GetCtrlAttribute (panelDAQ, DAQ_PANEL_SampPerChannel, ATTR_CTRL_VAL, & sampsPerChan);

    DAQmxRegisterEveryNSamplesEvent(gDAQTaskHandleAI,DAQmx_Val_Acquired_Into_Buffer,sampsPerChan,0,EveryNSamplesCallback,);

    startDAQ();

  • concurrent tasks HAVE, AO, c, CI

    Hello

    I try to control a, AO, CI card SMU-6358 simultaneously and for that I built the VI attached. If I run the VI, it does the job without any problem, but if I connect the appliance on the pin of the IC [at the door of for example ctr0] to measure the frequency of the signal, less than a second, I get the error message "tried to play back samples that are no longer available" [image attached]. Can someone please advise me what I am doing wrong.

    Thank you.

    Hi Kriváň,

    The problem is that you have two tasks of entry in the same thread who buy data at different speeds.

    The task of IT is clocked at all that note you the value.  It crashes the loop so that the desired number of samples were acquired.

    The task of the CI is configured for 'Implied' timing, which means it will snap into place in a sample for each period of your input signal.  If the input signal is too fast then the loop (whose rate is regulated by the task to HAVE it) will not be able to follow.

    In almost all cases, if you have two tasks, acquisition of data in the same loop that they must be synchronized to ensure that a single task acquires data more quickly than the other.

    Do you need to acquire a sample of counter for each period of your input signal?  Depending on the frequency of the input signal, you might want to review the sample clocked frequency measurement method that is supported on your table for the X series.  The easiest way to get the program to work would however be to run tasks in parallel, or if you do not need to set buffer samples of your task of frequency, you could simply remove the schedule for the task of counter altogether.

    Best regards

Maybe you are looking for