SubVI DAQ

Hi! I'm building a data acquisition system using LabVIEW and an old
ATMIO16E2 card. It is basically a collection of subvi's, each of which can
and may be run independently. The main vi just controls the priority and
timing of these subvi's and displays important inputs. Each subvi contains
daq vi's (some of the daq vi's, eg wave acqui, are common to more than one
subvi). They are all intermediate vi's and the iteration and clear terminals
are controlled from the main vi. The problem is that the main program
executes once with expected values from each subvi but then all acquisition
go to zero. This is obviously a problem with daq vi initialisation. I tried
re-initialising each daq vi on every subvi call and that works fine, but too
slowly for my l
iking. I was wondering whether it was a problem with
re-entrancy (because of common vi's in separate sub vi's). Is there any way
of solving it without saving each daq vi under another name? Is it possible
to keep subvis open after the first call, hence making re-initialisation
unnecessary? Any help would be appreciated.
Leon

If everything is being read at the same rate, make a single DAQmx task to read all of the channels in one shot.  In your case, that would be a single DAQ Assistant that has all of the channels.  Since your rates are fairly slow, you should be able to do everything in a single loop.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • Subvi daq loop ni a calling vi

    Hi!
    I have a vi that contains an event case structure which aquires data in an event driven way from a hardware. It is implemented via a DLL, and thus the DLL have to be initialized first. These init and DAQ parts are done in a flat seq. structure, so they follow each-other.
    I need to place this whole thing in an other vi like a subVI. This other vi would display the incoming data, therefore it will contain a while loop. I would place my subVI in this while loop, so that it would give data continuously to my display event-drivenly. But in this way it would initialize every cycle.
    So my question is, thet how should i solve this? I have seen such vi-s, that have more instances and there is a input param that i can choose, like "init", "write", "read". I would like something alike, or it is not the best way to do it?
    Thanks:
    Waszil

    By now I have answered my question, i separated the tasks to 3 vi-s, so now it works fine. Sorry for tha flame.

  • Adlink daqpilot not working in subvi (DAQ/PXI-2204)

    Using DAQpilot from Adlink
    in Labview 2010 / windows 7
    I want to do n-channels, n-scans, single shot in a while loop
    The configuration is as follows: (see also attached task)
    -installed device: DAQ/PXI-2204:0
    -n-chs: 0-31 differential
    -10.000 Hz
    -30.000 scans
    -scaled data in 2D array
    The DAQ pilot runs once and continously in a sub vi:
    It also works when I place the task in a loop.
    But when I use it in a sub vi which is called from another vi in a loop it work the first cycle and the second not, third ok, fourth not. see diagram below:
    following error message:
    Attachments:
    test_3.vi ‏67 KB
    while_loop.vi ‏13 KB
    tset3.zip ‏4 KB

    Hello!!!
    You do not need to put the "Configuration Parameters Setting" inside a loop.
    These configuration are needed just one time.
    If you want to change these parameters for other acquistion, you can put these steps inside a case structure and when you need to change those configurations values you've just to call the "Configuration Case" and do it before the new acquisition starts.
    The acquisition need to be continuous, not the configuration.
    You can found code examples on this link below:
    www.ni.com/code
    Hope this helps,
    Regards.
    Barbara Pracek
    Engenharia de Aplicações
    National Instruments Brasil

  • Sychronisation of DAQ on multiple cards

    I am operating with Labview 5.1.1 and Flexmotion on Windows 98 and I am an intermediate user. Using PCI-6023E and PCI-7344 motion controller card, connected by an RTSI cable. Want a process whereby after running a subvi, DAQ begins at the same time on both cards (if the output of the subvi is true). After a set time interval after DAQ begins, I want to send a signal to start motion. The start of motion routine has already been written so I just want to know how to send a signal to initialize it so that it is all synchronised. What is the best way to achieve this and which example/code in the support section is most relevant to my situation?

    Could someoneone please upload these examples as Labview 5.1.1 files for me?
    Thanks.
    Attachments:
    Integration.llb ‏1100 KB
    RTSI_with_DAQ_Modulus_Breakpoint_(on-board_re-enable).vi ‏154 KB

  • UPConvert 6.1 to 2012

    Source - LabView 6.1
    Target - Labview 2012
    Dear Sir/Madam,
    Please find attached two archives, one containing the main VIs, and the other, containing the sub-VIs.  They are all from LabView 6.1.  Kindly convert them to work in LabView 2012.  
    A couple questions:
    1.  After the conversion, do I need to install any run-time engines?
    2.  These codes were written in LabView 6.1 on Windows 2000. I will be using them in LabView 2012 on Windows 7.  Some of the subVIs have associated .dll files such as lvdaq.dll, which I have heard are 32-bit.  In order for these to work, will I need to install a 32-bit version of Windows?  Or will be they be compatible with the 64-bit version after conversion?
    3.  For my transfer to Labview 2012 on Windows 7, I will need - LabView 2012, my DAQ device drivers, and the converted codes.  Am I missing anything?
    Please let me know if you have any questions regarding my setup.  
    Thanks.  Your help is highly appreciated.  I am very new to LabView and I am extremely grateful for your time and effort.
    Sincerely,
    nithyan2
    Attachments:
    SubVIs-DAQ.zip ‏3222 KB
    Convert VIs to 2012.zip ‏3841 KB

    Mass compiled in 8.2.1, which you can open with 2012.
    These VI depend on Traditional DAQ.  I don't think Traditional DAQ is compatible with 2012 (see here), so you will likely have problems with that.  You might want to consider updating to DAQmx.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Converted to 8_2.zip ‏5099 KB

  • DAQ Assistant in subvi not updating output to DAQ board with each call...

    Hi All,
    I am calling a simple subvi that creates a user-defined number of pulses with "Square Waveform.vi."  This square wave (with the given total number of pulses) is then used as an input to a DAQ Assistant controlling an analog output signal on a NI USB-6259 DAQ board.  I am using Labview 8.5 right now.
    However, each time I call this subvi from my main program, the output I measure from the DAQ board is identical to whatever I set in the first call (i.e., if i created two pulses in the first call, I get two pulses on every call, regardless of the input I feed to the subvi).  The multiple calls to this subvi are made in sequential frames in a stacked sequence.  I believe stacked sequences are frowned upon by good labview people, right?  But putting that aside for the moment...
    The "#-of-pulses" input I give to the subvi is updated in a subvi front panel number indicator and a graph of this waveform.  Just not in the real output I measure from the board.  Why is the hardware output being asserted (with the original input value) before this new number can reach the DAQ Assistant?
    The sloppy fix to this is just to put that square wave creation code in my main program each time I need it.  This does work and fixes my problem.  However, I would like to use subvis to keep things clean.
    I am not a good Labview programmer, but have used this software for a number of projects and am stumped by this.  Any ideas?
    Thanks,
    John

    Hi John,
    I am running your code over here and seeing
    the same results.  I believe the problem is that the DAQ Assistant is
    being called inside a loop (really a sequence structure, but
    nonetheless more than once).  Sometimes it is difficult to troubleshoot
    the DAQ Assistant in cases like this--it is trying to be "smart" and
    seems to be avoiding re-configuring its parameters inside the loop. 
    This is intended to improve loop speed for when customers are
    performing continuous operations.  In this case, it is performing a
    finite generation, and the number of samples generated appears to carry
    over from one loop iteration to the other.
    It sounds
    like you have discovered one workaround for this already: putting a DAQ
    Assistant in each frame of the main VI.  Two other options that come to mind are:
    Use the lower-level DAQmx functions inside
    the sub VI.  Here you will have explicit control over when the task is
    created and cleared, and when parameters are set.  You can find
    examples of how to use the DAQmx API in the Example Finder at:
    Help >> Find Examples... >> Hardware Input and Output >> DAQmx
    Write
    a consistent amount of samples to the DAQ assistant by "zero-padding"
    your signal.  For example, instead of writing [10, 1010], try writing
    [1000, 1010].  In this case, it wouldn't need to reconfigure the number
    of samples to generate.
    One lesson to take away here is
    that the DAQ Assistant is good for basic functionality, but for more
    advanced control over the execution and configuration of your task you
    should learn to use the lower-level DAQmx functions.  In this case it
    sounds like the problem is actually a bug.  I'll file a bug report, since the DAQ
    Assistant is not checking for waveform timing changes even though your
    timing is set to Use
    Waveform Timing.
    Thank you for pointing out this odd
    behavior--out of curiosity which version of DAQmx are you using? 
    -John
    John Passiak

  • Running a Front Pannel and SubVI on different monitors when using a DAQ

    I have developed a test rig monitoring system. Since there are a large number of transducers and thermocouples I have had to divide the monitoring system into two parts. An air system Front pannel, which is interactive,alloying me to start stop pause the program, and a fuel system SubVI which is purly for displaying information. When the front pannel is opened I would like the SubVI to be displayed as well. I dont mind waiting for it to be called by data being sent to it, but since data will be constantly sent to it I dont want it continnuously called. Basically I want it there running in the back ground so that I can acess it whenever I need it but I dont want it getting in the way. Does this make sense?
    Thanks

    They will be running on different monitors from the same PC. To allow us to view both at the same time. The problem that I am having right now is that the window is being continuously called through the data, so it will appear and disapear. If i select the close if originally closed option, and I open the subVI originally, then it will stay open for awhile then start to open and close again. I think this a labVIEW softwear issue as it happends at a different time each time I run the program. The other issue is that I need the Front Pannel to be the active Window, but not necesiarily on top.
    Hopefully this makes more sense, I can attach the program if you like, but it is pretty large and requires a number of subVI's and the keithley 2700 driver package

  • Need help in converting Traditional DAQ subvis to DAQmx configuration

    i need to convert these vis (of traditional NI DAQ) to be used with a new DAQ card that supports only NI DAQmx.
    please help me in this..
    Can i use the same traditional NI DAQ VIs with NI PCI 6221??  if so how can I? does this device can be configured for traditional NI DAQ??? 
    Kudos always welcome for helpful posts
    Solved!
    Go to Solution.
    Attachments:
    traditional ni daq vis to daqmx.jpg ‏1857 KB

    NI has several resources to help move from tradtional DAQ to DAQmx. A good place to begin is the Getting Started page. There is a tutorial on how to transition. There is also the compatability VIs that replace certain traditional DAQ functions with wrappers around DAQmx functions. The DAQ example you posted is pretty trivial and really should not take much time to convert once you get a basic understanding of DAQmx.

  • How can I display data gathered in a subVI in a graph of the main VI?

    I have written a largish application (~50 VI's) which acquires, analyzes, display and saves data from an instrument with a built-in DAQPad. My problem is that my block diagram is rather messy by now. I'm using an event structure in my main VI which reacts to buttons being pressed on the front panel. During data acquisition (one frame of the event structure), I need to do a lot of data processing, and I'm displaying both raw data and analyzed data on the front panel. I'm using a lot of subVI's for this, but I always need to get data out of the subVI's again to display it on the front panel, cluttering my block diagram. It would be much nicer if the subVI could update the main VI's graphs and indicators. I just found two examples with control references which show how a subVI can modify e.g. a 3Dgraph of the main VI, but I'm unable to use this with normal graphs and charts - I can't find a way to update the actual data in the plots (I can scale the plot or color it blue etc - but I really want to change the data it's displaying, not color it blue). Is there anything I'm missing? Is there example code for this kind of problem?
    best regards
    Martin

    im assuming that you want to update your graphs and indicators as you are performing your DAQ, otherwise, you can pass out your value/s when the DAQ completes.
    I have attached a very simple example of using a reference to update your front panel graph.
    Hope this helps.
    Attachments:
    Reference Example(LV7.1).zip ‏17 KB

  • Record all the data acquired by DAQ

    Hi all,
    I have a problem when I tried to record all the data acquired by the DAQ card. My DAQ is NI 6259, and the Labview version is 2009.
    Basically, what I need do is using multiple channels to get the voltages of different point, then I subtract values of two channel (V+ and V-) to get voltage value between two points. In my vi, the sampling mode is continuous and the rate is 100 KHz, DAQmx reading is inside a while loop, and the numbers of samples per channel is set to be 100. After each loop execution I would get 100 data.  I just used the format into file to write the data into a .txt file. It seems after 1 loop only the last one data is recorded instead of 100.  Previously I averaged the 100 data inside the acquisition loop to get one data, so the writing function is OK but it really slows down the program. So I want to write all the raw data to txt file so later I can process them in Matlab.  Is there any way to achieve this? Thank you very much.
    The attached is the my vi for 2 channels voltage measurement and the current source control sub vi. I am new to Labview so the question really bothers me even after I read some similar topics in the forum.
    Regards,
    Hongxiang
    Solved!
    Go to Solution.
    Attachments:
    Dual Channel Voltage Measurement.vi ‏33 KB
    Current Source 1.vi ‏49 KB

    Thank you for you reply. I tried that, it actually record more data per pulse than before, but less pulses were  recorded (there should be 8 pulses in 20 seconds time but only 2 were recorded), I think it was because the for loop inside slows down the program execution, and sometimes the error 200279 occurred.  I think it would be better to separate the reading and recording process. Someone suggests me rather than writing to the file inside the loop, accumulate the data from all of the loop iterations to generate one large array containing all of the samples then pass that to Format Into File outside the loop. Do you know how to achieve that? I tried the as below, it seems totally wrong , only two data was written. 
    (The subvi nameed 1 (see attachment) converts the 2D array to 1D ) Thanks.
    Attachments:
    2D_Data_Reader.vi ‏9 KB

  • Help with timing, input from Daq, output sound

    Hi
    I am a student member of OSA, working on a laser listener project to be used in examples for high schools students. It is a pretty old and simple experiment but something I think students would be into. {any suggestions for other experiments anyone might have I would love to hear} 
    I read a voltage from a Daq off a reciever circuit, that signal is noisey so I filter it for the human voice range, 60Hz - 2000Hz. Then that filtered signal goes to the play waveform express VI. It works but the snag is I keep getting a "beeping" in the output sound, I believe this is from the loop cycling.  I have thought of something like a master/slave loops, storing the data in an array then waiting a sec or two and playing the sound from this data so I dont have to wait on the Daq to acquire new data. Any help or suggestions are greatly apprciated.
    This is a rough version sorry about the mess. I think it should also be noted that if the "Time Duration" is larger that 0.02 then that makes the number of samples larger than what the Daq can handle.
    Thank you very much in advance for all of the help and your time.
    Jason
    Attachments:
    OSA example.vi ‏42 KB

    Hi Jason,
    I took a look at what is happening in the play waveform express VI and the issue may be related to starting/stopping the sound card every time the loop iterates, similar to what I suggested with the DAQmx VIs in my previous post. To look into the code behind an express VI, you should copy the express VI to another section of your code or to another VI completely, because once you show the block diagram for it, you will not be able to use the express VI configuration dialog anymore for that instance of the VI. Once you copy the play waveform express VI, right click on the copy and select "Open Front Panel." Then, navigate to the block diagram and keep opening the subVIs until you find the "Simple Write" VI (see below for a screenshot of this VI). Here, you will see that there is a "Sound Output configure" VI as well as a "Sound Output Clear" VI. Since these are within the while loop of your top level VI, the "beeping" in your output may be caused by the constant configuring and stopping of the sound card with these VIs. What I suggest is that you use the code in the express VI as an example to code your own sound output vi that is configured once outside the while loop and stopped once after the while loop. Hope this helps!

  • Main vi stops when subvi appears

    Hello,
    In my main vi I have a lot of thing happening in it, one of them is giving signals to a USB relay device which I connected with DAQ Assistent.
    This relay is currently working on time pulses of 3 and 6 seconds. 3 off, and 6 on.
    It works fine when I use buttons or other things in my vi, but when I press a button to show graphs in a subvi the relay device stops working.
    The subvi with the graphs are now on my screen and only until I close that subvi, the relay starts working again.
    I changed the properties of the subvi:
    Window appearance - Dialog (instead of custom)
    Is there a way to make sure the relay keeps working, it's quite important...

    After looking into your code, i do not understand why you didnt split up the code initially into two loops. I marked the piece of code you can easily export. You just have to take care about passing the time-intervall between the loops. But this is easy.
    Easiest: If the delay does not change, just get it infront of both loops and pass it to them
    Simple: Use a locale variable. Just take care that ONLY ONE loops writes on this variable.
    Ellegant: Use a functional global variable (also known as LV-2-style variable).
    hope this helps,
    NorbertMessage Edited by Norbert B on 09-17-2007 04:53 AM
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.
    Attachments:
    SplitUp.PNG ‏16 KB

  • Loop rate in main vi slowsdown when subvis window is clicked.

    Hi All,
    I have developed one USB DAQ application with 3 while loops in main vi and 1 subvi with an activex container for video display.
    This video displayer subvi has no function and it has that Activex container to display the video.
    The purpose is to playback acquired signal with the recorded video.
    So I keep both VIs frontpanel opened at all time.
    The speed of the loops in main vi are as follows,
    Loop1: Contains event structure with 250ms timeout terminal.
    Loop2: Contains an while to play the recorded data with the recorded time duration between successive data points.
     may be min of 70 ms delay for each iteration.
    Loop3: Contains another while which run min of 15 ms delay for each iteration.
    The speed problem is as follows,
    When i click on the subvi which contains an activex container, the while loop in Loop2 does not run properly and each iterations delay in millisecond is increasing constantly in terms of  250 milliseconds atleast.
    After releasing mouse button from subvi, the loop agains starts running normally.
    it would be great help for me if somebody can provide a solution for this problem.
    Thanks in advance.
    Thanks,
    Sathish

    I think I know why this happens, I am not sure how te get a workaround.
    The ActiveX interface runs in the  UI thread just like the event structure.
    The event structure forces the whole VI into the UI thread and is only triggered every 250 ms when the ActiveX is claiming all the UI power.
    I think moving the 70 ms. loop into a seperate VI should do.
    (I might be wrong about the above theory)
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • How to generate digital pulses to run stepper motor in a sinusoidal motion profile using NI DAQ 6229 card

    Hi,
             I need to make a stepper motor undergo rotary oscillation with a sinusoidal motion profile. As it nears the extreme points it should decelerate and finally slow down to zero velocity and then it should reverse direction and accelerate until it reaches the other extremity where it should slow down and stop and reverse direction and repeat this motion.
            The hardware is NI DAQ 6229 and the stepper motor can be controlled using digital Hi-Low (1,0) pulses. For each high pulse(1's) the motor turns 1 step. I am able to generate a analog sine wave and convert it to digital data using Analog-to-Digital.vi  But i am not able to convert the digital data to a stream of 1's and 0's in the correct sequence to get the sinusoidal profile with the amplitude and frequency i require.
            The direction of rotation can be changed by giving a pulse to another input of the stepper motor. So only half cycle of sine wave needs to be generated and it can be replayed after changing the direction to get the full sinusoidal profile.
    Any ways of making this approach work or any new approaches to this problem would be helpful. Thank You.
    Regards,
    Prabu.
    Solved!
    Go to Solution.

    Hi,
             I finally figured out a way to do it. The analog sine wave is converted to digital and sampled. Consecutive values are compared and if the least significant bit(LSB) changes then a pulse is sent to the stepper motor to turn one step.
    I have included the sub-VI's that accomplish it for the particular stepper motor and connector block i have. The front panel of both sub-VI's are quite messy but the block diagrams should be much clearer. The sub-VI's get their inputs from a third VI which i have not included. So take a look at the VI connector panel to figure it out. Hope this helps. Kinda messy but worked out fine in the end for my application. 
    Thanks again for all the help. I appreciate it very much.
    Regards,
    Prabu Sellappan
    Graduate Student
    Aerospace and Mechanical Enggineering
    University of Southern California
    Attachments:
    start motor test waveform dtest.vi ‏73 KB
    sine profile generation subVI.vi ‏41 KB

  • Why do I receive the message: VI stopped @ node 0X239C of subVI AI SingleScan?

    Whenever I run AI SingleScan, I get the following error message: "An exception occurred within the external code called by a Call Library Node. This may have corrupted LabView's memory. You should save any work to a new location and restart LabView. VI "Untitled" was stopped at node 0X239C of subVI "AI SingleScan (single-point waveform.vi)". I've done what it says, save and restart the program, but still get the message. I'm running LabView 6.1 on Win XP. Thanks.

    Hello,
    The most direct cause of this problem is due to a possible corruption that has occurred in the copy of the DAQ driver installed on your machine.
    It could also be related to the way that you are calling the VI. I recommend opening a LabVIEW example called Cont Acq&Chart (hw timed).vi, changing the AI Single Scan VI type to Single-Point Waveform, setting the correct parameters and running. You can select the type of the VI by right-clicking on it and going to Select Type.
    If it turns out that you will have to reinstall the driver, make sure that you first uninstall from Add/Remove Programs, and then reinstall the driver. You can get the latest version from ni.com at http:/
    /www.ni.com/support/daq/versions.
    I hope this helps.
    Jared A

Maybe you are looking for

  • Oracle  Standard Manager Max No.Of Requests in Running Status

    Hi, We have a Batch Process program to Kick the Concurrent Programs from the Back-End. Based on the data, there are some programs which kicks more than once. Our issue is while kicking the programs, it kicks the same program multiple times at a time

  • Custom Report layout

    I have a simple question to ask (simple I hope a tleast). In the past, I have been able to use the out of the box layout for most reports. However at my current job, we will be needing some custom layouts done to the report region to show parent chil

  • Transfer photos from Ipad2 to PC

    Hi, Is it possible to transfer my photos and videos shot with the HD camera to my PC? Thanks, garethjw

  • E71 web browser will search for WLAN connection in...

    The E71 web browser will search for and present a list of WLANs whilst the phone is in offline mode without asking first. When you then select a WLAN from the list, it does ask if you wish to create a WLAN connection in offline mode. Surely it should

  • User Defined Field that gives the date output of the last price update.

    We would like to create a User Defined Field (UDF) with a Formatted Search (FMS) on the Item Master form that gives the date output of the last price update specifically the wholesale price. Last Price Update Pricelist 2 = Wholesale Is this feasible?