Daqmx simulated digital input

I'm having trouble using the simulated digital input feature.
I create a simulated digital input in MAX - a simulated NI PCI-6534, single channel, port 0/line 0, acquisition mode is 1 Sample (On Demand)
When I click the "run" button I see the indicator flash on and off as I would expect.
However, when I bring this task in to LbView, I can't get the indicator to flash no matter what I've tried.
No doubt I've missed some basic concept. Can anyone tell me what I'm doing wrong?
(VI attached).
Solved!
Go to Solution.
Attachments:
digItst.vi ‏11 KB

You do not have N channels, you have 1 channel.  Use the appropriate DAQmx Read version.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Attachments:
digItst_BD.png ‏16 KB

Similar Messages

  • How to acquire serial data on a digital input line with good performance?

    Hello,
    we have a performance problem with our realtime controller. Our objective is, to read a 24-bit long digital waveform from a digital input line. To do this, we supply a clock signal (236 KHz)  to the PFI1 Line of our DAQ Board. On each rising edge of the clock, a new bit is set on the digital input DI0.
    Our hardware which transmits the data, is triggered through a digital output from our realtime controller. On each edge on this output, the hardware starts a serial transmission of 24-Bits.
    Everything works fine except the bad performance of our realtime controller. We want to acquire the 24-Bits in a 1ms timed loop. To measure performance we wrote a test program. In that, we only triggered the hardware and transfered the data to the realtime controller. The task which is doing this job, has a approx. CPU-Load of 30%, which is, in my humble opinion, very high. The task is not waiting for data or anything else! We have earlier implemented a control which is also using a 1ms timed loop. This control is sampling 2 analog input signals, 2 counters. Futhermore it's sending telegrams with CAN and doing many calculations. The strange thing is, this much huger program has a CPU-Load of 25%. Does anybody know where the problem is?
    For the better understandig I attached our test-program to this text.
    We're using:
    PXI-8175 realtime controler
    PXI-6221 Multifunction DAQ
    Thanks!
    Regards, 
       Crest!
    Attachments:
    dig_test.zip ‏51 KB

    Hello,
    First of all 30% CPU-Load is normal because the DAQmx-driver needs a lot of resources.
    In your programm you should place a wait (for example with 1ms) into the while-loop which causes
    lower CPU-Load.
    If this is not enough you should build your vi like in the following example.
    Regards,
    Christian
    Attachments:
    Read Dig Port.vi ‏51 KB

  • Obtain the determinat​e data from the NI-DAQmx Simulated Device

    Dear All,
           How to config in MAX in order to obtain the determinate data from the NI-DAQmx Simulated Device?
           For example, the vi will run when the Digital I/O line is High, but using the Simulated Device, the result is  random. In another word, I can't set the line is high or low.
           Would you please give me some suggestion?
           Thank you!
    Hugo

    Here is what I mean of stopping the DAQmx stimulated device. I do from step A - E; and step E is what I mean stopping the DAQmx stimulated device.
    3. Use the NI-DAQmx Task in VI Logger Lite to complete a data logging application.
    a. Open VI Logger Lite. If you do not have VI Logger Lite, download it or request a free CD.
    b. Right-click My System>>VI Logger Tasks and select Create New.
    c. Select Using NI-DAQmx and click Finish.
    d. Select the NI-DAQmx task for the NI-DAQmx simulated device. Leave all settings in the defaults, and click Run task in the toolbar.
    Figure 9. VI Logger Lite data logging task.
    The data logging task begins. Data from the NI-DAQmx simulated device is displayed in the Real Time Data viewer.
    e. Click Stop task.
    ====================
    =Labview 7.0 & 8.0 & 8.5=
    =====================

  • Triggering an event with a digital input

    Hello all,
    I'm writing my first Labview program.  I used an architecture I found on the forums here, and it has been very helpful in getting me started.  This architecture uses two while loops, one containing an event structure and one containing a case structure.  (This is a queued state machine architecture, I believe).
    Part way through the programming, we decided we needed a sensor to make sure the part was in the test fixture during the test.  If the part is removed during the test, we'd like to safely stop the test.  So basically, I need to monitor a digital input (on an NI-USB-6525 module) and enter the "Stop" case if the digital input turns off.  I would also like to make sure this digital input is on before entering the "Start" case.  I don't care if the input changes state when the test is not running, nor do I care about its state during the "Exit" case.
    I'm really not sure how to add this functionality to my "stop" case.  I don't even know if it's possible.  I've been researching DAQmx events, but I haven't found an example or answer that aligns with my particular problem. 
    I've attached my code.  It's incomplete right now - I still have a large number of steps to add.  I wanted to get this issue figured out before I programmed any more steps.  A preview of the code showing the basic architecture is shown in the picture below.
    Does anyone have any ideas or suggestions for me, or questions if my problem is unclear?  Also, if you see anything else in my code that will be problematic, please let me know.
    Thanks in advance!
    Attachments:
    Main_Loop_072412.vi ‏195 KB

    I should also add that I looked into event dynamic registration, but it seemed incompatible with my issue.  I don't want my top loop to run only when an event triggers it - I want it to run all the time so that it can immediately respond to button presses. Also, most of the triggering I found was based on value change.  I care about the actual value, not just that it changed.
    I don't want to do anything that will bog the code down too much since it is important that the system respond immediately to inputs, especially to the stop or exit button presses.
    I'm sure I am missing something very basic here.  I'm used to ladder logic, where everything is simple and straightforward. 

  • Comparing digital input and output from two different DAQs

    I want to create this program where the digital output lights up LEDs at random and push buttons are the digital input part of another DAQ are pushed. When the correct button is pushed, the score will increase by 1. My code doesn't work though. Can someone point my errors to me? Both the DAQs i'm using are USB-6008 DAQs. thanks
    Attachments:
    Untitled 1.vi ‏41 KB

    Let's start with the digital output
    What is this code all about?
    Do you want only one of the 8 led's to lit randomly or are multiple led's also ok?
    The two possible codes are in attached file SNAG-003.jpg
    Connect the output of the "Scale by power of 2" function or the "Multiply" output directly to the Write DAQmx vi
    I don't understand the purpose of the "Boolean Value" and "Replace subset array" thing, so I skipped it
    Attachments:
    SNAG-002.jpg ‏49 KB
    SNAG-003.jpg ‏22 KB

  • Simultaneous Digital Input and Output from NI 9403

    Hi,
    I was wondering if it is possible to digital output through one line in this module(NI 9403) while simultaneously reading from 10 other lines?
    Basically what I need is for line0 to always be closed(true), and read lines1:10 - at very least 1sample/second.
    I have attached a stripped down version of my code illustrating my error. I thought I was getting the error because the two tasks were using different clock configurations, but I tried using the same inputs and that doesn't work for me.
    Any input is greatly appreciated.
    Thank you
    Attachments:
    Digital I-O.vi ‏22 KB

    Hi Matthew,
    The behavior you're seeing is expected for the 9403 module, since it is a serial module. The DAQmx help has the following restrictions in the Digital I/O Considerations for C Series Devices section.
    Timed digital input/output restrictions:
    You cannot use parallel and serial modules together on the same hardware timed task. 
    You cannot use serial modules for triggering. 
    You cannot do both static and timed tasks at the same time on a single serial module. 
    You can only do hardware timing in one direction at a time on a serial bidirectional module.
    So you can only do timed input or output at one time, but not both. However, based on the VI you attached and the description of what you want to do, you don't necessarily need both timed tasks in your loop. You can create a static output task to update that one line and after that, you can just start your timed input task on the rest of the lines. This should maintain the state on the DO line, since you're not acquiring from it.
    Cheers,
    Cristina
    Cristina

  • Producer consumer with analog and digital inputs and outputs

    Hi everyone,
    I am working on a control system program for some practical test work. Currently I am working on the data acuisition component of the Labview program. My architecture is produced-consumer loops with a que. My system will have analog inputs, analog outputs, digital inputs and digital outputs. It's not a time critical sytem, but I would like all of the data acquisition to be synchronised. I have attached my program as it is at the moment. I am having trouble getting all of the data into the que since I have two data types. Also, I'm not sure if i've synchronised the four read/write sequences correctly. I would greatly appreciate if somebody could take a look at my program and give me some advice. Thanks in advance.
    Solved!
    Go to Solution.
    Attachments:
    control_v2_DAQ loop.vi ‏46 KB

    Robert, the specific error that I get is:
    Error -200462 occurred at DAQmx Start Task.vi:6
    Possible reason(s):
    Generation cannot be started because the output buffer is empty. 
    Write data before starting a buffered generation. The following actions can empty the buffer: changing the size of the buffer, unreserving a task, setting the Regeneration Mode property, changing the Sample Mode, or configuring retriggering.
    Task Name: Heater testing lab digital outputs
    This error occurs at the 'DAQmx write.vi' function. I just want to sent one sample per second, for each channel. I would like the producer and consumer loops to each run once every second.
    I have attached part of my code with just the data acquisition and writing. Any help would be greatly appreciated.
    Attachments:
    control_v2_ML_simple.vi ‏83 KB

  • Digital inputs NI6220

    Hello!
    DAQmx Version 7.3
    I want to read the digital inputs of a NI6220. There is no matter of timing,
    I only want the actual state.
    I get the error code -200077 from the StartTask, that means:
    "Requested value is not a supported value for this property.
     Property: DAQmx_SampTimingType
     Requested Value: DAQmx_Val_SampClk
     Task Name: MyDigital
     Status Code: -200077"
    How do I have to configure this device correctly? I didn't find the source with the properties.
    Thanks in advance
    Ralph Müller
    Here is the pseudo-code I use:
    deviceName                  = "Dev1";
    taskName                    = "MyDigital";
    rate                        = 1.0;
    lengthDataPerChannel        = uint32(2);
    lines                       = "Dev1/line0:15";
    nameToAssignToLines         = "DigitalChannel";
    lineGrouping                = DAQmx_Val_ChanForAllLines;
    numSampsPerChan             = int32(1);
    readArray                   = uint32(255);
    arraySizeInSamps            = uint32(1);
    reserved                    = uint32(0);
    status1     = DAQmxCreateTask(taskName,taskHandle);
    status2     = DAQmxCreateDIChan(taskHandle,lines,nameToAssignToLines,lineGrouping);
    status3     = DAQmxCfgSampClkTiming(taskHandle,"OnboardClock",rate,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,lengthDataPerChannel);
    status4     = DAQmxStartTask(taskHandle);
    printf("Handle, Status: %d; %d; %d; %d, %d\n",taskHandle,status1,status2,status3,status4);
    for n = 1:10
        pause(1);
        status1   = DAQmxIsTaskDone(taskHandle,isTaskDone);
        status2   = DAQmxReadDigitalU32(taskHandle,numSampsPerChan,0,DAQmx_Val_GroupByScanNumber,readArray,arraySizeInSamps,sampsPerChanRead,reserved);
        status3   = DAQmxStopTask(taskHandle);
        status4   = DAQmxStartTask(taskHandle);
        printf("Status: %d(%d); %d(%d); %d; %d, %d\n",status1,isTaskDone,status2,sampsPerChanRead,status3,status4);
        printf("Readarray = %d\n", readArray);
    end
    status1    = DAQmxStopTask(taskHandle);
    status2    = DAQmxClearTask(taskHandle);
    printf("Status: %d, %d\n",status1,status2);
    I get the following printout:
    Handle, Status: 530841864; 0; 0; 0, -200077
    Status: 0(1); -200077(0); 0; -200077, Readarray = 0
    Status: 0(1); -200077(0); 0; -200077, Readarray = 0
    Status: 0(1); -200077(0); 0; -200077, Readarray = 0
    Status: 0(1); -200077(0); 0; -200077, Readarray = 0
    Status: 0(1); -200077(0); 0; -200077, Readarray = 0
    Status: 0(1); -200077(0); 0; -200077, Readarray = 0
    Status: 0(1); -200077(0); 0; -200077, Readarray = 0
    Status: 0(1); -200077(0); 0; -200077, Readarray = 0
    Status: 0(1); -200077(0); 0; -200077, Readarray = 0
    Status: 0(1); -200077(0); 0; -200077, Readarray = 0
    Status: 0, 0

    Hello!
    thank you, John, for your hint. I tried the second part (ctr0internaloutput), but
    still get the same error (-200077).
    Here is the way I actually tried:
    Variables as in my former email, additional these here:
    taskNameCounter             = "CounterTask";
    counter                     = "Dev1/ctr0";
    nameToAssignToChannel       = "CounterChannel";
    units                       = DAQmx_Val_Hz;
    idleState                   = DAQmx_Val_Low;
    initialDelay                = 0.0;
    freq                        = 10.0;
    dutyCycle                   = 0.5;
    status1  = DAQmxCreateTask(taskNameCounter,taskHandleCounter);
    status2  = DAQmxCreateCOPulseChanFreq(taskHandleCounter,counter,nameToAssignToChannel,units,idleState,initialDelay,freq,dutyCycle);
    status3  = DAQmxStartTask(taskHandleCounter);
    printf("Handle, Status: %d; %d; %d; %d\n",taskHandleCounter,status1,status2,status3);
    Then the code of my former eMail, but I changed only one line to this:
    status3     = DAQmxCfgSampClkTiming(taskHandle,"/Dev1/ctr0internaloutput",rate,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,lengthDataPerChannel);
    The error is the same as before (the startTask of the normal taskHandle returns -200077).
    o.k. then stop and delete all tasks.
    Can you give me more details or an example?
    Thanks!
    Ralph

  • Can DAQmx write (Digital Wfm 1Chan NSamp) output to physical channels on multiple ports?

    I'm writing some code to manage waveform outputs across multiple devices. All of the hardware presently at my disposal has at most one port of timed digital output. However, this might change in the future, and I want to make my program as general as possible. Is it possible to build a virtual channel containing lines on multiple output ports and then write to all lines of this virtual channel using a single DAQmx Write (Digital Wfm 1Chan NSamp) call? Is DAQmx Write (digital Wfm 1Chan NSamp) restricted only to lines on the same port? Do I need to use a separate virtual channel for each output port? Thanks.
    Jason Rolfe

    Hello Jason,
    You can create a task that contains lines from different ports of one same device. You can also define the "lines" input of your Digital Output DAQmx Create Channel vi to be for example Dev1/port0/line0, Dev1/port1/line0. DAQmx Write (digital Wfm 1Chan NSamp) is not restricted only to lines on the same port as long as it's from the same device. No, you don't need to use a separate virtual channel for each output port.
    Hope this helps,
    LA

  • Measure rpm and PWM signals using digital input of NI9401 module

    Hi, is there a simple way how measure rpm (to 5000 rpm) and PWM (about f=3kHz) signals using digital input of NI9401 (ultrahigh-speed digital I/O)  module plugged in NI 9172 ?  I will wellcome any suggestions and VI examples (bether still). I'm begginer using LView 8.2. I apologize for my poor English. Many thanks.

    Hi CUA,
    Since you have already the right tools, you just need to get started with the software. The NI-9401 will give you access to the counters that are inside the cDAQ chassis 9172.
    You need to place the module in slots 5 or 6. You can read in how they work and how to configure them in the counters section of the user guide found here.
    Now to measure rpm, you can either measure the period of the signal (seconds) and multiply by 60 to have minutes and the number of ticks per revolution. You can find a shipped example to read period called “Meas Dig Freq-Buffered-Cont-Large Range 2 Ctr.vi” found under Hardware Input and Output » DAQmx » Counter Mesurements
    To measure PWM, it is similar procedure and you can read the semiperiod (high time or low time). There is also a shipped example called “Meas Semi-Period.vi” found under the same location.
    There is great information for these kind of task at this page or just post back if you need to.
    Hope this helps.
    Gerardo O.
    RF Systems Engineering
    National Instruments

  • I want to measure rpm using 100 ppr incremental encoder via digital input

    i want to measure rpm using 100 ppr incremental encoder  via digital input max speed (4000 rpm)
    am using 9178 c-DAQ chassis and 9426 digital input module
    pl provide me example code for this

    Hi asaccullo.
    The recommended settings for encoders are using the counters in the daq cards. Using digital I/O’s is not recommended, the encoders send digital signals but one of the main differences between using digital IO vs counters is that counters are designed to handle these type of events.
    Here I found several examples in ni.com/code that you might check:
    Imitation Quadrature Encoder with DAQmx Counter Tasks
    Use Counter Frequency to obtain an Encoder Rotational Speed
    An Elvis is a daq device, so this should work for you.
    I also found an example for myDAQ, it uses the DIO but with a counter task in the set up.
    Regards,
    steve.bm
    AE | NI

  • Warning 200015 occurred at DAQmx Write (Digital Wfm 1Chan NSamp).vi:4

    Hi,
    Attached is the VI I write. But there is a warning: Warning 200015 occurred at DAQmx Write (Digital Wfm 1Chan NSamp).vi:4
    I want to use digital channel to create an output. The duty cycle change from 30% to 50% to 70%. At the same time, measure the input of another 2 channels.
    Do you have any idea about this?
    Thanks.
    Attachments:
    Digital pulse_DO Channel-1_mod2.vi ‏39 KB

    Hello,
    The situation that you are seeing here can be identified as 'glitching'.  Glitching occurs where there is potential for previous samples in a buffer to be mixed in with newer samples written into the buffer, causing a signal output that is a mix between the old and new data you are trying to output.  In the DAQmx Help document, search for 'glitching' and you will be directed to an article which explains glitching, mentions Warning 200015 is thrown where there is a potential for this to happen, and then offers suggestions on how to work around this issue, as well as two pictures that clarifies what could happen with glitching.
    This warning pops up in your application since you are writing one set of data and then writing a second set of data afterwards.  If you do not see glitching on your signal, you can modify your code to ignore this warning.  Read through the help document for suggestions on modifications that will work for your application.
    Kyle A.
    National Instruments
    High Speed Digital I/O Product Support Engineer - R&D

  • Digital input and digital output at the same time

    Hi all
    I have a PCI-6503 board. I have done 2 task that run simultaneously: the first one is port0_16 output and the second one is port2 input.
    I get sometimes (not every times...this is strange...) error-200587 saying:
    'Requested operation could not be performed, because the specified digital lines are either reserved or the device is not present in NI-DAQmx.
    It is possible that these lines are reserved by another task, the device is being used through the Traditional NI-DAQ interface, or the device is being reset. You might also get the error if the specified resource is currently in use by LabVIEW network variables bound to the DAQ Channel, or if the DAQ Channel is being used in any OPC Client software.
    If you are using these lines with another task, wait for the task to complete.  If you are using the device through the Traditional NI-DAQ interface, and you want to use it with NI-DAQmx, reset (initialize) the device using the Traditional NI-DAQ interface. If you are resetting the device, wait for the reset to finish.'
    In the attached VI i have recreated the basic structure of my real VI (the error is present even here of course...).
    How can i do?
    I want to have both digital input and digital output with the same PCI-6503 every single cycle... Is it possible?
    Please help me!!!
    Kind regards.
    I love the smell of napalm in the morning
    Attachments:
    DIO simultaneously error.vi ‏31 KB

    Hello Maverick,
    Did you have any luck with the example Raven sent you?
    In Raven's example, it properly passes the DAQmx task from one SubVI to another to avoid having to open the task again. These errors are likely to occur when you have multiple DAQmx calls in a VI that call the same task again without clearing the previously opened task. If at any given time you try to open a task that already is being used, you might receive an error "resource is reserved"... similar to your original example.
    If you are interested, here is an awesome link that gives a detailed explanation of the LabVIEW dataflow paradigm
    Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications
    Thanks and good luck!
    Jordan Randall
    National Instruments Italy

  • Virtual digital input problem

    Hello,
    I am trying to learn DAQ on labview. So, I made a basic digital input vi, with a virtual digital input device. For some reason I cannot get it to output anything other then zero, but when I run the daq assistant (when setting up daq assistant) the boolean values toggle between 0 and 1. But, in my VI I cannot get any input other then zero.
    I have attached my VI.
    Thank you
    Solved!
    Go to Solution.
    Attachments:
    ReadDigitalInputs_11-3.vi ‏46 KB

    You should wire up your stop button to the Stop input on the DAQ Assistant.  You are openening and closing the task each time when you do not do that.  I think that is also resetting the toggling of the simulated device.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    ReadDigitalInputs_11-3.png ‏58 KB

  • Polling digital inputs

    I am trying to simulate an annunciator panel on a WIN_XP PC with LV7 and DAQMx hardware. This is part of a much larger machine control code.
    The number of digital input channels is 17.
    For those who wonder what an annunciator is :
    When an input becomes active I have to switch on a LED indicator on the PC screen and switch on an alarm. When the user presses the ACK push button, the alarm is silenced, but the LED remains lit till the relevant input becomes inactive.
    The response time for (reading) each input must be about 20ms.
    Question is, what would be the best possible way to code this without loading the CPU heavily ?
    I am not listing the possible options, lest the replies should end up discussing the pros and cons of my suggestions. In other words, I simply do not want to bias the replies...
    Thanks for your time, friends.
    Raghunathan
    Raghunathan
    LV2012 to Automate Hydraulic Test rigs.

    I am not familiar with DAQmx but here is a vi that shows the basic principle behind gathering data in one loop and processing it in another.  The data gathering loop puts the data in a queue.  The processing loop reads the queue and acts on the data.  I have also added an alarm LED and an ACK button to show you how that could work.  You will have to figure how to get data from your DI and put it into the queue.  If you get an array of data at a time, create a loop to index the array and stuff each element into the queue.  This loop would go into your data gathering loop.  The best thing to do is to program the DAQ to get one value at a time.  If you are using a DI and your data is boolean, change the queue element from a DBL to a boolean at the beginning of the vi at the Obtain Queue function.  You would also have to change the alarm condition code.
    - tbob
    Inventor of the WORM Global
    Attachments:
    DaqAck.vi ‏42 KB

Maybe you are looking for

  • Third party encryption plug-in for a pdf form.

    We are looking for an Adobe approved third party encryption plug-in for a pdf form. 256 bit, assymetric, two key, one public (embedded in form) and one private (accessible only to our organisation

  • Default valuation type - PO and Delivery

    Hello, Is it possible to default valuation type for a particular combination of vendor and material when creating purchase order? Also can a particular valuation type be defaulted when creating outbound delivery depending upon storage location? Thank

  • Getplus+(R) has stopped working

    Ok before you guys ask, I've tried everything, researched everywhere and cannot find a solution to this problem. Everytime I attempt to install flash player, adobe reader, etc I get this error. Someone here must know what is causing this. I've uninst

  • I'm not allowed to put transitions in. Why?

    I'm using iMovie 4 and can not put in a transition. I'm getting error message 4960, "error in system operation". I've successfully added transitions up until now. What gives? Thanks.

  • Switching numbers between acounts?

    Hey, I have 5 lines on my account and I'm looking to start an additional individual plan. Say I get a new phone during a Black Friday deal. What I want to know is if I will be able to switch one of the phone numbers from the existing lines to the new