Executing Acquire upon Digital Line State

I have a homework problem where a analog voltage measurement isn't supposed to start until a digital line becomes true.
I have it working, but just checking if there is a preferable way.
As a test, I used a T/F toggle switch inside a continuous while loop to simulate the digital line state. When I toggle the switch to True, I pass a True value out of the While loop. I pass this True value to a Case structure that accepts 2 values, True and False. On True, it starts the analog data aquisition, which works all OK.
Is there a preferable way to "wait" on a trigger, and then execute a block of code?
thx
Jeff

There are a number of examples that ship with LabVIEW that already incorporate digital hardware triggering.
The program you described will work, but the amount of time between the triggering event (toggling the switch) and the start of the acquisition will vary because you are monitoring the value of your digital line in software. The latency will depend on how many things your computer is doing at once, as well as the speed/memory of your computer.
By using hardware triggering, you eliminate the software dependancy and achieve a response time in the nanoseconds. You can find the triggering examples by choosing "Search Examples" from the LabVIEW splash screen. Once the help window comes up, choose "I/O Interfaces -> Data Acquisition -> Analog Input -> Triggering a
n Acquisition."

Similar Messages

  • NI-6023 digital inputs miss line state-changes

    I am using the NI-6023 DAQ to monitor digital lines. Occasionally (less than 1% of the time) the 6023 misses a low-to-high line state-change from . LabVIEW 6.1 polls the 6023 every 5 mS. The digital lines are normally low. When they go high, they remain high for only 50 mS.
    LabVIEW 6.1
    Windows 2000 Professional

    Hi Rchrd,
    If you're using a loop to poll your digital line, it's possible that you're not actually polling every 5 ms, since this is software timed. The speed is software/computer dependent, hence can depend on factors such as processor activity. Software timed I/O is normally used for low-speed applicatiosn that do not need hardware timed precision. You can do some troubleshooting by checking to see if there's a certain condition under which the state change is missed, and making sure you don't have other applications runing.
    Hope this helps.
    Thanks,
    Lesley Y.

  • Illegal operation occures running a 'Write Digital Line' vi in Test Executive

    I'm switching a single line of a PCI DIO 96.

    Hi,
    I have a PC set up with Labview 5 and Test executive 5.1. I'm trying to create a vi that can be run in test exec that will allow me to control any of the DIO lines of a PCI DIO 96. When I put the vi in a sequence and try to exit the edit screen the Test exec stops and an 'illegal operation' window appears.
    I have also tryed this with the DIO example that comes with labview 'Write 1 point to digital line.vi' and the same occurs.
    I hope this explains it better.
    Many thanks
    Rob

  • Help: Can you use software trigger on a digital line.

    Hi:
    We have a legacy DAQCARDard 700 which does not support hardware triggering.
    We have a trigger from our instrument that is 5 V+ and we would like to
    trigger when it drops to 0 V. We have several questions.
    1. Do we need to invert the signal in MAX or is that only for V that are
    negative?
    2. Is there a good example in the examples where the state of this digital
    line is used to trigger an analog acquisition? When we tried using the
    digital trigger examples, we had an error saying that the hardware did not
    support that mode.
    3. We have an analog software trigger mode (based on the Analog Software
    Trigger example) working which we would like to modify over to read the
    digital line, but we have done very little wi
    th digital I/O.
    4. The digital trigger has been assigned a virtual channel of dtrg.
    Any help would be much appreciated.
    Thanks in advance,
    Pete

    Thanks Doug,
    If we read the digital line instead of as an analog line would it improve
    the accuracy of the triggering. Everything works now except we have a
    little bit of timing jitter within about 1 data point scanning at 50 kHz.
    However, I've never done any digital i/o with LabView, but may I should work
    through some of the tutorials. If you thought that this might solve the
    jitter problem. Would checking the state of the digital line allow a faster
    response with softtrig, I guess is my question?
    Pete
    "Doug Norman" wrote in message
    news:[email protected]..
    > Hello Pete,
    >
    > You are correct that the DAQCard-700 has no digital (or analog)
    > hardware trigger. The analog trigger example t
    hat is working for you
    > is using conditional retrieval. This is where data is always being
    > acquired and the driver looks at the values to determine when to
    > "trigger" and read the data into LabVIEW. To answer your questions:
    > 1. I don't think you need to invert the signal. This is for when you
    > want a digital low (below 0.8 volts) to show up as a digital high, and
    > a high (above 2.0 volts) to be read as a low.
    > 2. I don't know of a good example. You would basically have to
    > monitor the digital line. When it goes from high to low you would
    > then start your analog acquisition.
    > 3. I think this could be your best bet. If you have enough analog
    > input lines, why not just connect this digital signal as one of your
    > analog inputs. Then use this example to trigger when the 5 volts
    > drops to 0. It won't hurt to acquire your digital signal on an anlog
    > input along with your other data.
    > 4. I don't understand this question.
    >
    > Best Regards,
    >
    > Doug Norman

  • PCI 6602:How can I use the digital lines of the board and in the same time to generate pulse train using a counter?

    Hello!
    My problem appeared when I tried to update my code from Traditional NI-DAQ Legacy to DAQmx.
    I am using 2 counters (counter 5 and counter 7)  from PCI-6602, to generate pulse train, and also the Digital I/O lines of the port 0 (the lines form 0 to 7). What I do in my application is that I am starting to generate the pulse train on the output of the 2 counters, and after that I am playing with the state of the digital lines.
    In traditional there was no problem using the counters and the digital lines in the same time, everything was going perfectly, but in DAQmx this is not possible.
    What happens: I start to generate pulse train on the output of the counters,  no errors encountered, but when I try to modify the state of one line of the digital port the generation of the pulse train is stopped. This is happening when I start the task associated to the digital port.
    My question is: it is possible to create a channel on the digital lines without altered the channels created for the counters?
    Another thing what I manage to see using the  "Measurement & Automation Explorer" and Test panels for PCI-6602, basically is the same thing, I generate pulse train on the output of the counter 7 and try to start a task on the digital line, but I get one error :
    "Error -200022 occurred at Test Panel
    Possible Reason(s):
    Measurements: Resource requested by this task has already been reserved by a different task.
    Device: Dev4
    Terminal: PFI8"
    Instead if I use the counter 0 or counter 1 to generate pulse train I don't encounter the same problem.
    Which resources are used by the counters 2 to 7 from the PCI-6602 board and the counters 0 and 1 do not use?
    Thank in advance for any replies!
    Ciprian
    Solved!
    Go to Solution.

    Hello Jordan, thank you for your reply.
    I am sorry but I can not see or run your example, I don't use LabView, I use Visual C++ for developing.
    Here is the code for generating the pulse train:
    GeneratePulseTrain(unsigned long ulCount1, unsigned long ulCount2)
        short nStatus = 0;
        nStatus = DAQmxCreateTask("",&m_taskHandle);
        nStatus = DAQmxCreateCOPulseChanTicks (m_taskHandle, "Dev4/count5", "", NULL, DAQmx_Val_Low, 0.0, ulCount1,ulCount2);
        if( bTriggerMode == true) // if hardware trigger is enabled
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_ArmStartTrig_Type, DAQmx_Val_DigEdge);
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_DigEdge_ArmStartTrig_Edge, DAQmx_Val_Rising);
            nStatus = DAQmxSetTrigAttribute (m_taskHandle, DAQmx_DigEdge_ArmStartTrig_Src,"Dev4/PFI17" );
        //set the internal timebase
        nStatus = DAQmxSetCOCtrTimebaseSrc(m_taskHandle,"Dev4/count5","20MHzTimeBase" );
        nStatus = DAQmxStartTask(m_taskHandle);
        return nStatus;
    And the code where I try to set the digital line:
    SetChannelState(short nState)
        short nStatus = 0;
        uInt8 wrtBuf0[1]={0};
        nStatus = DAQmxCreateTask("",&m_taskHandle);
        // Configure line as output 
        nStatus = DAQmxCreateDOChan (m_taskHandle, "Dev4/port0/line0", "", DAQmx_Val_ChanPerLine);
        nStatus = DAQmxStartTask(m_taskHandle);
        wrtBuf0[0] = nState;
        nStatus =DAQmxWriteDigitalLines (m_taskHandle, 1, 0, 0, DAQmx_Val_GroupByScanNumber , wrtBuf0, NULL, NULL);
        nStatus = DAQmxWaitUntilTaskDone(m_taskHandle,10);
        nStatus = DAQmxStopTask(m_taskHandle);
        nStatus = DAQmxClearTask(m_taskHandle);
        m_taskHandle = 0;
        return nStatus;      

  • NI-DAQmx Base - "Read or Write task without first setting line states"

    I am writing an application to interface with the USB-6501 hardware platform. In my application, I am first initializing all the lines on each digital port to be either read or write lines. After these lines have been initialized to the correct state, I would like to write data to a specific port, or read data from that port, without having to again define the line states (i.e. I'd like to write data to the port based on the already configured lines).
    Here's how I approach the problem. On initialization, my program will create a DAQmxBase task which will set the lines I specify as "Write" lines for port0, following this is another task which specifically sets the "Read" lines for port0. When I create a task to simply read or write data to a port (without again defining which lines are write and which lines are read) I receive the error "-200428 - Value passed to the Task/Channels In control is invalid.". If I define the read and write lines as a step in the same task which reads or writes data (respectively), the process seems to work ok.
    Can anybody offer any insight to whether or not I should be able to accomplish this task using this approach?
    Thank you for your help.

    Hello DarkCloud. Thank you for contacting National Instruments. If you create a task in the DAQmx Base Configuration Utility and set the direction of the line, you don't need to reset the direction in LabVIEW. There are some examples of how to do this at Start>>All Programs>>National Instruments>>NI-DAQmx Base>>Examples>>LabVIEW 7.1. Open the static example for DIO>>Write Dig Port. Please let me know if you have any questions. Have a great day!
    Marni S.
    National Instruments

  • Multiple VI's using different digital lines in one VI.

    I have created multiple vi's, each of which require either reading or wroting to a different digital line on the CB-68LP board. I need to put them all in one individual vi so that I can see everything on the front panel. When I have tried this the vi seems to send a confused signal and operate things which it shouldn't.
    Is it even possible to try and do what I am doing? If not, any ideas what I can do? Thanks.

    Multiple VIs are usually the better approach. What I would suggest is parallel loops. These are loops which do not have any data dependency on each other. One handles the User Interface - the front panel where you "see everything." Another which reads and writes from/to the digital lines. Maybe even a third which processes the data. Exchange data among the loops with queues or functional globals.
    Keep a record of the state of all the digital lines. When something is to be written to certain lines, use either a Write Line.VI ( I don't recall the exact name) or use AND and OR functions with masks to protect the states of line you do not want to change.
    BTW, the CB-68LP is merely a connection interface, not the digital I/O baord itself.
    Lynn

  • Reading/writing digital lines without external hardware (besides daq device)

    Hi,
    I have a USB-6259 (mass termination).  I don't have any additional hardware, just the USB device.  I  am trying to use the MAX utility (4.2.1) with NIDAQmx (8.5).  I eventually want to program digital lines (read and write them) using the NIDAQmx API.  I ran some of the VB6 samples.  I thought how it works is that I could run the WriteDigChan VB code to set line(s) on or off, then use the ReadDigChan VB code to read those lines I changed.  However that did not work so I started created some tasks using MAX however that does not work either.  I hope this is not too stupid a question but I am not too familiar with the hardware.  Do I need some additional hardware connected to my 6259 to keep those digital lines in one state or another?
    thanks, David

    Without regard to using it in VB, I am trying to understand the operation in MAX.  I am attaching two screenshots of 2 tasks that I am using.
    thanks for replying, David
    Attachments:
    ScreenHunter_004.jpg ‏180 KB
    ScreenHunter_005.jpg ‏233 KB

  • 32 Digital lines read simultaneously

    I have a following question:
    A this time i can read one single port of NI6507 configured as input, enough faster
    for my input signal (I read up to 10 Khz TTL square wave on single line), with the following
    instruction DIO_err = DIG_In_Port(1, 0, a%). But unfortunately i must read 32
    digital lines simultaneously whose maximum frequency is 2.5 KHz.
    I need some instruction that it allows me to read 32 inputs simultaneously,
    because i have seen in some experiments that if i use the instruction DIG_In_Port
    i can't read the 2, 3 and 4 ports at the same time of the 1 port.
    My sytem is configured as below:
    Pentium 3
    Windows NT os
    NI6507
    I drive the ni6507 with Visual Basic 6.0 and daq32.dll.
    Thanks.

    Hi Ron, unfortunately I have previously did that You say, in my program I have already used DIG_Prt_Config
    I have put this instruction (for each port obvious)
    in the "form load sub" (I use Visual Basic) and I use DIG_In_Prt for read the state of each port (I have put this instruction in one command button).
    Say You that I must repeat all instruction (DIG_Prt_Config + DIG_In_Prt) for each read-cycle?
    Say me more.
    Now i have found one example program named DIsingleBufHandshake8255.
    Because the nunmber of event that i need to capture are 4096 and I have a strobe signal I have used this example.
    I have configured the card as follow: iStatus% = DIG_SCAN_Setup(1, 1, 4, 0, 0) (where 4 is the groupsize) but I have seen that the groupsize is maximum = 2
    , if I put one number > of 2 one error was generated despite the help about this instruction say:
    "groupSize selects the number of 8-bit ports in the group.
    Range: 0 through 2 for most devices.
    0 through 8 for the DIO-96."
    at the end I are able to read only two ports simultaneously. ( i need to read 4 ports simultaneously= 32 bit)
    Can You help me?
    Thanks

  • Switching to BT soon - Worrying line stats.

    Hey everyone,
    I've been with AOL for the past 10 years for our broadband, finally ditching it and switching over to BT (option 3).
    We used to steadily sync at 4800kbps, however upon closer inspection the router was connected to the extension socket. Moving to the master socket, we now sync around 5600-5800kbps.
    However, from the router stats (Linksys WAG54G2), the line stats are always strange, even with a stable connection.
    Vendor: Linksys
    ModelName: WAG54G2
    Firmware Version: 1.00.19 , 2009-10-20T13:53:34
    Boot Version: 1.03
    Hardware Version: 0.01
    --- DSL Information ---
    DSL Driver Version:  E.25.41.39
    DSL VPI/VCI:         0/38
    DSL Status:          Showtime
    DSL Mode:            G.Dmt
    DSL Channel:         64
    DSL Upstream Rate:   448000
    DSL Downstream Rate: 5760000
                          Down         up    
    DSL Noise Margin:      25 dB      14.0 dB
    DSL Attenuation:     15.5 dB      29.5 dB
    DSL Transmit Power:  19.7 dBm     12.1 dBm
    Status:
    Up
    Downstream Rate:
    5760 kbps
    Upstream Rate:
    448 kbps
    From Attenuation, the Kitz speed tester says I should be syncing at 8128kbps, and that sync should be stable up to around 30dB. There's also a really high noise margin downstream.
    Note the exchange is on dslmax since 2006, has no LLU providers, no 21CN expected date, no plans for Infinity.
    I was wondering if there is a problem, and what the solution would be to it. 17070 option 2 is a dull hum, however it is on a wireless phone.
    My connection times I cannot post, the last disconnect was so long ago it has been culled from the logs because of the log limit.

    I'm assuming with a stable connection and stable sync, and with the BRAS profile from my old ISP my line isn't in training mode since the switchover.
    Switching to the new BT equipment instantly saw a rise in sync from 5880kbps to 6.2mbps.
    Line state:
    Connected
    Connection time:
    0 days, 05:56:38
    Downstream:
    6.219 Mbps
    Upstream:
    448 Kbps
    ADSL Settings
    VPI/VCI:
    0/38
    Type:
    PPPoA
    Modulation:
    G.992.1 Annex A
    Latency type:
    Interleaved
    Noise margin (Down/Up):
    15.3 dB / 28.0 dB
    Line attenuation (Down/Up):
    28.8 dB / 15.0 dB
    Output power (Down/Up):
    19.9 dBm / 12.2 dBm
    FEC Events (Down/Up):
    4003 / 5
    CRC Events (Down/Up):
    2 / 3
    Loss of Framing (Local/Remote):
    0 / 0
    Loss of Signal (Local/Remote):
    0 / 0
    Loss of Power (Local/Remote):
    0 / 0
    HEC Events (Down/Up):
    0 / 2
    Error Seconds (Local/Remote):
    2 / 3
    The attenuation is higher then the previous router reported, I assume that's a problem with the previous router. Noise also seems rather high, the atten I'm getting should be syncing at 8128kbps (I assume the reason it isn't is because of this high noise margin).
    Line state:
    Connected
    Connection time:
    0 days, 05:56:38
    Downstream:
    6.219 Mbps
    Upstream:
    448 Kbps
    ADSL Settings
    VPI/VCI:
    0/38
    Type:
    PPPoA
    Modulation:
    G.992.1 Annex A
    Latency type:
    Interleaved
    Noise margin (Down/Up):
    15.3 dB / 28.0 dB
    Line attenuation (Down/Up):
    28.8 dB / 15.0 dB
    Output power (Down/Up):
    19.9 dBm / 12.2 dBm
    FEC Events (Down/Up):
    4003 / 5
    CRC Events (Down/Up):
    2 / 3
    Loss of Framing (Local/Remote):
    0 / 0
    Loss of Signal (Local/Remote):
    0 / 0
    Loss of Power (Local/Remote):
    0 / 0
    HEC Events (Down/Up):
    0 / 2
    Error Seconds (Local/Remote):
    2 / 3

  • Replacing Digital Line with Network Communicat​ions

    Hi, 
    Does making the timeout for the 'EthernetIP Tag Read' VI zero, remove the ability for the VI to wait? When 'EthernetIP Tag Read' VI poll for the current value of the tag, does it add extra time if wait is zero ms?
    I have successful create a code that works using digital signal (see attachment 1). I want to replace some of the digital line with network communication.  Can I just replace digital line SV with 'EthernetIP Tag Read' VI?
    The replacement will happen in my non deterministic loop.
    Attachments:
    attachment 1.jpg ‏143 KB

    Thanks
    I benchmark the time it take to set a 'Digital line' SV and the time it take to use 'Ethernetip tag Read' VI. The ‘Digital line’ SV take less than an ms and the 'EthernetIP tag Read' VI take about 33 ms.   That mean every time the loop run it will take an extra ~33ms to run any of my states.  
     My initial question was asking how I can have the same level of smaller timing accuracy (similar to the digital line) using the networking communication.  From the benchmarking test I did, I do not think that is not possible. Am I right?
    What is a normal timeout time? What is a great way to handle EthernetIP timing out? Can you provide some exaples ?  or link to similar situations. 
    Attachments:
    Replacing DI line SV with Netwrok comm.png ‏23 KB

  • Read digital line e series

    Hi,
    This has got to be the simplest question, but how do I read the line state of the PFI lines on my 6024E board?  The 'digital channel' 0 is the only port I can access but I'm using those.  If I set the channel to '1' there's an error.
    How do you get at those other bits?

    A window pops up that says:
    Error - 10007 occurred at DIO Port Config
    Possible reason(s):
    NI-DAQ LV: A channel, port, or counter is out of range for the device type or device configuration; or the combnation of channel is not allowed; or the scan order must be reversed (0 last)
    Can someone walk me through how to configure the digital i/o pins, and how to read individual pin states?
    Thanks much!

  • Reading digital line and local variable

    I am using digital lines in my program to start and stop "Flat Sequence Structures"
    like time measurement ( 4 sequence, start and stop time with "Tick Count" )
    Is it good behaviour if i use once "Read from Digital Line.vi" and other starts and stops etc. with Local variables?
    Or can i just use "Read from Digital Line.vi" many times in my VI? (same line)

    Most experienced LV programmers try to avoid both sequence structures and local (and global) variables. The state machine architecture is often preferred. Look at the examples with LV and search for "State machine" on this site.
    I would probably use one read line or read port VI in a loop and pass the data to other, independent loops for processing (the timing) via queues.
    Lynn

  • We are trying to implement a process so that any document that needs to be printed through our Java application will be printed as PDF using Adobe Reader. For which, We created and execute the below command line to call Adobe Reader and print the PDF on a

    We are trying to implement a process so that any document that needs to be printed through our Java application will be printed as PDF using Adobe Reader. For which, We created and execute the below command line to call Adobe Reader and print the PDF on a printer."C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe" /T "\\<Application Server>\Report\<TEST.PDF>" "<Printer Name>". Current Situation: The above command line parameter when executed is working as expected in a User's Workspace. When executed in a command line on the Application Server is working as expected. But, the same is not working while executing it from Deployed environment.Software being used: 1. Adobe 11.0 enterprise version. 2. Webshpere Application Server 8.5.5.2. Please let us know if there is a way to enable trace logs in Adobe Reader to further diagnose this issue.

    This is the Acrobat.com forum.  Your question will have a much better chance being addressed in the Acrobat SDK forum.

  • How does one write to individual digital lines accross many DIO-96 ports?

    I want to be able to write to any individual DIO-96 line without having to repeatedly init. The available vi's can set up only 24 lines at a time. If it is desired to write to a line outside of those 24, another 24 lines must be initialized, then to return to the first 24 lines, those must be initialized once again. Very clumsy! Does anyone know how to init all lines one time and then allow random access to all 96 lines without further initialization?
    Thanks,
    CBD

    Hi Tom,
    try to use (or at least to insert) that control in another environment (like a Visual Basic form) in order to check if it's working properly. Also, check if you have the DLL with the same name in your system folder - this control it's just a simpler way to use that dll.
    You can use Write to Digital Line.VI, but pay attention to ITERATION terminal - if it is 0(default) LV will call DIO Port Config (find details in help).
    Hope I understood the problem...

Maybe you are looking for

  • UTorrent not running

    I recently wiped my harddrive since my computer was running slow and full of crud. I restarted the system and now I cannot get uTorrent to run (which it did prior to me wiping my system). The follow error is coming up: uTorrent quit unexpectedly. Pro

  • Error.Unable to use mx:CustomDateTimeAxis to implement the component.

    Hello. I have a modified class DateTimeAxis to show data labels in my own format: package      import mx.charts.DateTimeAxis;      public class CustomDateTimeAxis extends mx.charts.DateTimeAxis           public function CustomDateTimeAxis()          

  • How to combine output of two queries

    Hi, I have the following two OBIEE queries in one subject area: *1. number of daily new customers:* min(date)|customer unique number (aggregated in the pivot table as count distinct) day1 | 1000 day2 | 1500 *2. number of daily total customers:* date|

  • Calling Taskflow from javascript

    Hi, Can any one help me on calling taskflow from javascript. Thanks in advance, Regards, Lavanya.

  • Placing fonts in a JEditorPane after user enters text in a text field

    Hello all, I am writing a chat application that enables me to place fonts in a JEditorPane. The user will write the text in a text field and when the user press the enter key and whatever is written on the text field will be shown on the JEditorPane