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

Tags: NI Software

Similar Questions

  • Cannot create the multi channels Tx two USRP-2943Rs Session with driver

    I have problems of implementation of several USRP-2943R devices in tranmist both of their channels at once.  Right now my configuration is a configuration of four chains composed of two devices of RIO.  I am only able to transmit at the same time successfully CH0 and CH1.  I'm creating a session using two devices and my aim is to perform Tx on CH0 via CH3.  In addition, my goal is to use the LabVIEW driver without any synchronization, because I test fix synchronization through post-processing and you want the VI be as simple as possible without the hassle of FPGA programming. I realize has the Simple models OR - USRP Streaming Sync in LabVIEW, but additional synchronization and FPGA programming is too much for such a simple project like mine which would require no synchronization USRP.

    My VI and some screenshots of the error messages resulting is attached.  I am able to succesfully implement multi-channel Rx deals and attached is my multichannel Rx VI.  My question is why I can open and operate a session of Rx mult-channel without problem, while a multi-channel Tx session will give me errors?

    My final goal is to merge my multichannel work Rx VI with a mult-channel Tx VI work for measurements in order to test some synchronization post-processing routines that are performed in Matlab.

    I think that I found a solution to my problem.  I thought to post it here to help others.  It is important to use some sort of device to synchronize several USRPs.  However. I found that you must reset the device by setting the node of reset function blocks that open and session Rx or Tx.  "" If it is not defined, then the ' niUSRP Signal.vi configurethe ID of the specified attribute is not valid for the scope specified (or channel)." error occurs, any circuits that you define.  After the node Reset true and place an empty string for my channels Enabled, all was fine.  Also, a full duplex system you will be only to first log of Rx with a reset of the device, followed by the opening of a session of Tx without a reset of the device.

    One more thing, it is that there seems to be a bug if you feed a Tx process a table whose number of lines does not match the number of channels Tx.  This will result in weird errors funny will disappear only after doing a hard reset of the units.  So, just something to take note of.

    I hope this information will help others and this message can be marked as resolved.

  • Extract single channel DAQmx task

    Hello

    I created a task DAQmx output, which contains two channels.  Is it possible to extract the individual virtual channels of the task to be dealt with by two parallel processes?  I tried to bring out the ownership of channels using a task property node, but then I get the error that the channel is not part of an active task (see excerpt)

    Could someone advise on a better approach, or how to obtain this feature - if that's possible?

    Concerning

    Dave

    Sorry, that VI does not have much sense. You must use a unique DAQmx writing for both channels and 1 sample mode, simply build an array of signals as shown below.

  • Multi-channel DAQmx - output function generator


    Never mind... I got it running by connecting a constant Boolean true to reset the signal of the Signal to simulate vi.   Thanks for your help

  • How can I autoindex looping for to create several channels daqmx

    I'm trying to autoindex create a loop FOR containing the DAQmx vi to create AI multi-channel voltage with identical settings, except that I need to apply specific channel names using a constant and specific physical channels using a constant of channel. Wiring of a constant DAQmx of physical channel does not work because the data type is incorrect. Similarly, I don't understand how to use a string constant to autoindex through the channel names is or how to configure the constant string (s) to assign names. Also, when I try to make one of these, I get a tunnel to exit the DAQmx autoindex create channel, rather than a task out. I can achieve my goal using several explicit DAQmx create calls to channel, but for high channel count, it is very time consuming.

    I use LV 8.5.

    I'm hoping to find the code showing how to perform the conversion type, flattening, or what to do.

    Diane has.

    I have an array of clusters.  Each element of this array is a cluster.  The cluster consists of a (scalar) string and input/output (also scalar).

    In addition, my TI attachment extracted.  I think that your file has been LV2009.  If so, you can drag the image from the browser and drop it onto a diagram.

  • 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

  • Multi-channel AI program 6008 USB in c#

    I am writing a program in c# to collect data of voltage.

    I want to allow the user to toggle the channels they wish to collect of (up to a maximum of 4), refers to the number of samples and the sampling for each frequency and write the log to a file of PDM. I think Task.AIChannels.CreateVoltageChannel call four times to create the four channels and Task.Timing.ConfigureSampleClock four times to set up the sampling parameters individually.

    Similar threads seem to indicate that a single channel of AI must end sampling before another channel of AI could begin. Is this true? My method would work?

    You right about that, there is only a single clock controlling the task, so there is no possibility of setting the channels at a different pace, and the API would use a final which has been set up.

    A common practice when different high sampling rates are required is to sample the fastest rate required for all channels and then "decimating" data for slower channels, so you can get the number of samples that you expect.

  • 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

  • How to copy DAQmx task without the help of MAX?

    Howdy-

    I hit a bit of trouble here I think points to a fundamental misunderstanding I can have on DAQmx channels and tasks.  I can hack together a workaround, but I would like to know how to do these things, common sense.

    In a Word, I prefer to do everything in the code and not use MAX.  For my application, I would like to create a single channel/task initialized with all the scaling, the physical channel parameters and units (it is what is, in my case, a 'channel').  I would then like to create copies of this channel/task and configure each with parameters of specific task of sampling... corresponding to what I would call the "tasks" to use "Channel".

    I'll have no chance, so of course, I do not understand what I do.  Any reading/posts I've met use MAX.  Here's what I've tried so far:

    Even when you try to use MAX, I am the breath.  Any help straightening on my confusion here is very appreciated.

    Thanks in advance and have a nice day.

    -Brad

    In fact, you're not confused.  In this instance of National Instruments is perhaps...

    See the links ofthese ideas in the link.

    But a 'task' is really just a section in an XML file.  If this file is named *.lvproj the project has access to tasks.  If this file is *.nce any labview application has access to tasks.  If this file is created by the RTE that vi has access to the task.  In short, the "tasks" are never really defined by 'Code' but by the XML code to the file than declairs them and teir properties.  Tasks need to be defined a time-preference during design - project

    Yes, it's a bit simplistic but a good analogy!

    Go ahead and kiss MAX to set your tasks... use DAQmx property nodes if you need to programmatically determine a task property.   "do everything in code" as you say is just not really the way it is... the way I think you hear it...  'S really not 'made it in the code"but rather how LabVIEW is inherintly multithreaded.  The IDE just handles it for you "So easy that could encode a cave man!  Relax and let it work the way it does work for you.

  • 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

  • Now not DAQmx task correctly

    Hello

    I created a state machine structure that is designed to set up a number of different channels DAQmx data acquisition (the code with indication of analysis section is attached).

    The first time I run this vi, I get a table containing the names of specified job in (with a first line empty), but subsequent executions raise an error that the name of the task is already specified, leading me to believe that the tasks are not properly shut down, but I don't know how to set up the fence vi the task in this case.

    Also, in the State of the initialization, I placed an empty array that obviously gives me my first empty line, but if I withdraw this, he breaks the vi as one of the terminals of the enclosure is then unwired.

    Anyone would be able to guide me to a more correct solution, please?

    -dave

    Purely given this example, here are a few things I would change:

    Use a loop FOR instead of a while loop.  No point in the case of Initialize.  You want to use a shift register to add channels to your task.  It takes only a single task for thermocouples, a task for lubricating oil, etc.  See attachment for a quick example.

    In this example, I think that your error comes from the fact that you create a 2D tasks table.  Each line must have the same number of items, and you get a bunch of NULL tasks.

  • 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

  • Can I create a digital line written task in another digital line written task (NOR-6723)?

    Hello! I need to build an application that follows these steps in the order shown:

    1. create a task that writes a numeric value ('1 ' or ' 0') on line1 digital to a NOR-6723;

    2. create a task that generates a clock on the same Board $line0 pulse. So, when the value of the line of $line0 has been set, a transition from '0' to '1', and then '1' back to '0' must be made on the $line0.

    So, I have the following pseudocode:

    1. create Task1

    2. create digital output channel ' Dev1/port0/line1.

    3. write bits of data ('0 ' or ' 1') on digital line1

    4. stop & erase Task1

    5. create Task2

    6. create the digital output channel ' Dev1/port0/$line0.

    7 write bit '0' on digital $line0 data

    8 write '1' on digital $line0 bit data

    9. write the data bit '0' on digital $line0

    10 stop & erase Task2

    After I stop & erase Task1 (step 4), the digital line1 remains in the State that gave step 3. But, once I created a digital channel for $line0 (step 6), line 1 is in the State of initialization (high State - because of the low pull-up), so when Task2 generates the clock on $line0 pulses, the data written bit on line1 is compromised (it will always be '1').

    My question: should I move 4 step after step 10? I mean stopping and disabling Task1 bring Task2 AFTER WHAT had been arrested and cleared?

    Is that what this ensures that value of Line1 remains unchanged until the end of the entire application (once Task2 completed)?

    Please help me!

    OK, don't know the exact calls in labwindows, is perhaps the easiest thing to create a taste of writing on the complete port.

    In this case you write every line for 8 lines of the digital port at the same time.

    Use is some form of a variable (U8) and associated function which can hide and update the bits in a number of U8

    I guess that there is a form any to make an OR operation bitwise or function AND to hide the bits of interest

    1 Create variable (U8) = b0000000

    2. create Task1

    3. create a digital output PORT ' Dev1/port0.

    Update 4 line 1 by 1 in the variable: 00000010 (this should be a routine you create - see crude example below)

    5. write variable to Dev1/port0

    Update 6 line 0 with 1 in variable: 00000011

    7 write variable to Dev1/port0

    Update 8 line 0 0 in variable: 00000010

    9 write variable Dev1/port0

    10 stop & erase Task1

    Function UpdateVariable (line; variable value)

    If line = 0 then

    If value = 0 then

    variable = variable AND b11111110

    on the other

    variable = variable OR b00000001

    otherwise if line = 1

    If value = 0 then

    variable = variable AND b11111101

    on the other

    variable = variable OR b00000010

    Hope that helps

    Katya

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

Maybe you are looking for