Using a DAQ value in a location outside of the While Loop it is placed in

I am writing a program that records the speed of a car and then is supposed repeat the action through the use of an actuator.  I was able to write the program to the point where I am saving the data into a .txt file and will be able to read it back out.  My problem is that I need to use a dbl value that I am calculating from the output of a DAQ Assistant block that is contained inside a while loop in another part of the program to compare current speed vs. recorded speed then output an action.  Everytime I try to draw a connection outside of the while loop, the actual value is not read outside of the loop.  I cannot put the other part of the program into the while loop because the while loop only performs every .1 to 1 second and I need the output to the actuator to be a continous string delievered to the serial port.  I also cannot create another DAQ Assistant block that reads the same port outside of the while loop.  I have thought about using a jumper to another input on the input card, but I would prefer not to use the extra space.
So generally speaking, I'm wondering if there is a way to read a value obtained from a DAQ Assistant block outside of the while loop it is contained in.
Thanks to anyone that can help!!!
Travis

Cheers,
I am not 100% sure what your problem is but how about writing the red value into the local variable and reading it outside of the loop? Or enqueue the value into the queue and dequeue it in the other loop (Producer/Consumer Structure (Data))?
Br,
Jick

Similar Messages

  • What is use of Acquisiton value in functional location in PM module?

    Hello,
    what is use of Acquisiton value in functional location in PM module?
    Regards,
    Ram Rathode.

    HI Ram,
    You can  do an F4 to get the description of a field.
    Please go through following for your reference:
    Acquisition Value of an Asset
    Assets table for Acquisition value and Equipment number
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/01/d544ef4ab311d189740000e8322d00/frameset.htm
    http://help.sap.com/erp2005_ehp_05/helpdata/EN/c1/376976449a11d188fe0000e8322f96/frameset.htm
    Please award if useful.
    Thanks,
    Ravi

  • My daq 6008 wil not drop the 5V after the VI is stopped, i have a digital signal going from the error out on the daq in the while loop to the error in on the daq outside the while loop and a boolean going to the data of the daq outside

    my daq 6008 wil not drop the 5V on a digital output after the VI is stopped, i have a digital signal going from the error out on the daq in the while loop to the error in on the daq outside the while loop and a boolean going to the data of the daq outside, but i can t seemto get it to work

    i attached the block diagram so you can have a look
    Attachments:
    PID Temp control.docx ‏120 KB

  • Why wont my probes read outside of the For Loop?

    The problem seems that, for some reason the when I try to line a wait time function outside of a while loop after I have used a boolean function, (subtract). What I am trying to do is to reset the time axis on the graph because it wants to spiral into millions of numbers and to keep counting. I want to just take samples of like 100-1000 milliseconds and graph my data pixels against it. I have tried a while loop, that seems to work sometimes. The thing is really weird, it seems as if it wants to work sometimes and in some places but not in others. I have attached some expamples and the VI I am trying to get to work. Notice the problem places are in Red.
    Thanks alot guys, (and girls), for any help that y
    ou can give me.
    Brian
    Attachments:
    example_for_analysis_by_engineers.vi ‏40 KB
    Brians_Display_Image_not_U8_but_U16.vi ‏102 KB

    Could you include the other VIs as well (save with options -> development distribution)? It's not possible to run your VI without the sub-VIs.
    I haven't fully understood what you are trying to accomplish, but looking at what I've got there are two things that come to mind:
    If you are generating data inside the loop, and only want to sample some of it and send that data to a graph then you must make sure that the data flow works. A loop will not output the data you wire out of it until the loop has terminated.
    Thre little grey dot you mention in the code is a "coercion dot", it means that the data you wire into the function/VI does not have the same type as the function expects. LV will use the polymorphism functionality to coerce the data to the correct t
    ype, an operation that is best avoided, at least if it's a lot of data involved (requires extra memory to do the coercion) or if it may cause an incorrect value to be passed. In your case the image cluster you have wired to the IMAQ function is not based on the type definition the function is using, just replace the cluster with the type defined one you'll get rid of the dot.
    MTO

  • How come my local variable is not updating it's value with respect to what's happening in the while loop?

    Hello,
    I am trying to extract data out of a while loop as my declarations update with respect to the iteration number. I have attempted to use both local variables and shift registers, but with no luck.
    I have also done the following example: http://www.ni.com/white-paper/7585/en and it works like a charm.
    I attached the PNG file with local variable declaration circled in red. Will attach a VI in the next respnose.
    Thanks
    Solved!
    Go to Solution.
    Attachments:
    Local Variable.png ‏366 KB

    OK, looking at the code...
    Can you explain what it is supposed to do? What's the purpose of the value property node read which only seems to update an indicator.
    The inner while loop should proably be a FOR loop, because the number of iterations is known before the loop starts.
    Your use of formula nodes seems overly complicated.
    LabVIEW Champion . Do more with less code and in less time .

  • Problem using PID toolkit and control design toolkit to design the closed loop system. (for DC motor closed loop)

    Hi, i have facing some problem during i upgrade a project. This project is an opened loop system, it only achieved up to controlling the speed of motor, detecting the speed of motor, and switching the direction of motor while controlling the motor (This motor is a 12 VDC motor).
    In order to improve the project, closed-loop dc motor control system will be implemented to correct the error of the motor's speed and maintaining the speed for the initial setting. I would like to use PID control method to do the closed loop system.
    I already installed the PID toolkit V8.2 and control design toolkit V2.1.2, and i'm using DAQ usb 6221, LabVIEW 8.5
    Below is my problem.
    http://img177.imageshack.us/my.php?image=howtocreatethesetpointnx2.jpg
    question: 1. How to generate a icon for set point? my setpoint is duty cycle...
                    2. How to feedback the output duty cycle to summing junction?
    below this is my basic concept
    http://img237.imageshack.us/my.php?image=closedloopbz5.jpg
    Problem 2:
    http://img357.imageshack.us/my.php?image=problem1yk2.jpg
    question: Why PID toolkit icon cannot wire to cd series.vi?
    Below is my original program...
    http://rapidshare.com/files/140538836/pwm_generate-final_PSMII.vi.html

    Hi Cyrus
    Have you had the opportunity to see our
    developer zone site on the PID toolkit? This article also has sample
    code at the bottom that may help you in developing your application. I
    have also linked below knowledge bases regarding setting a point
    profile and generating a PWM from a digital output line. 
    PID toolkit
    http://zone.ni.com/devzone/cda/tut/p/id/6440 
    How to generate a set point profile:
    http://digital.ni.com/public.nsf/allkb/125F27AC143B6AFD86256C2B0004A4DC?OpenDocument
     How to generate a PWM on a digital output line:
    http://digital.ni.com/public.nsf/allkb/1561D31534F07D608625727900391114?OpenDocument 
    Thank You
    Eric Reid
    Thank You
    Eric Reid
    National Instruments
    Motion R&D

  • JSP Accessing variables in a class that are located outside of the class

    I am having a problem accessing a nested HashMap in a function. The HashMap is defined before the HTML starts and the function is located near the end (Shouldn't make a difference).
    List tires = databean.getTires();
    Map frontTireInfo = (Map)tires.get(0); //Works
    Map rearTireInfo = (Map)tires.get(tires.size()-1); //Works
    Map neumaticos = new HashMap();
    for(Iterator itr=tires.iterator();itr.hasNext();) {
         HashMap tempTire = (HashMap)itr.next();
         String tirePosition = (String)tempTire.get("position");
         neumaticos.put(tirePosition, tempTire);
    <HEAD>. . . </HEAD>
    <BODY>. .
    <%=getTireInspectionTable("FRONT_RIGHT")%> //Works
    </BODY>
    I believe the above stores the tempHash in the tirePosition.
    <%!
         private String getTireInspectionTable(String tirePos) {
              StringBuffer sb = new StringBuffer();
         sb.append("<input type='text' value=" +
    *****<% neumaticos.get(tirePos) %> + " />" ) illegal start of expression
    return sb.toString();
    %>
    Why can I not access neumaticos in the method?
    I am able to call other methods from this one, but not variables.
    If it is possible, please help point me in the correct direction.
    Thanks in advance,
    Mike

    MPDreiding wrote:
         sb.append("<input type='text' value=" +
    *****<% neumaticos.get(tirePos) %> + " />" ) illegal start of expression
              Illegal start of expression sounds like a compile time error so your syntax is wrong. Why are you using scriptlet
    <% neumaticos.get(tirePos) %>
    inside of declaration? I think that's the problem. Just remove <% and %> and see what happens.

  • What value(s) (using [putvalue('nidaq',value)]) need to be sent to the ER-8 to open and close individual relays?

    I'm attempting to control the ER-8 via a PCI-6052E and SC-2050 adapter board (and associated cables).

    The best way to control your ER-8 device using an e-series DAQ board is by following the attached flowchart.
    Hope this helps.
    Filipe Altoe
    Application Engineer
    National Instruments
    Attachments:
    digital.doc ‏25 KB

  • ** Use of 3 values in 'Receiver From' property of the BPM send step

    Hi Friends,
    Still I am not clear the exact use of 'Receiver From' property of the Send step in BPM. This property is having 3 possible values: 'Send Context', 'Receivers List', & 'Response to Message'.
    What's the purpose of each value ? In what situations, which value we have to use.
    Kindly clarify friends.
    Kind Regards,
    Jeg P.

    Hi,
    In Send step, The message receiver can be a business system or another integration process.
    To handle Receiver Determination in BPM you need these options.
    Send Context -
    Send Context will be used by Receiver determination, if you will give it in Send step then accordingly receveir deteermination will process. Here the Message will go to fixed receiver
    Response to message -- While dealing with Sync/async bridge you can use this option to give the Switch or Transformation step to for further response.
    Receivers List -- For Runtime Receiver Determination you have to go for Receiver Lists. It will relied on the
    design of the Integration process.
    For e.g you can refer to the Conditional Receiever Determination.
    http://help.sap.com/saphelp_nw04/helpdata/en/3c/831620a4f1044dba38b370f77835cc/frameset.htm
    Thanks
    Swarup

  • 1 Analog Input using a DAQ card and would like to save the data into an excel file

    As you may have realized, I am very new at using Labview 6.1. I have an analog voltage input that I would like to save in an Excel file as a 2D array (time, voltage). I was wondering if anyone knew a very simple way of doing this and could help me out. Thanks

    There are a couple example program online and in LabVIEW that I think you’ll find useful. You might want to consider just writing out a tab-delimited spreadsheet file that Excel can read rather than writing it out to Excel directly as this requires learning ActiveX and Microsoft’s Common Object Model.
    In LabVIEW, see the Write to Text File.vi in C:\Program Files\National Instruments\LabVIEW 7.1\examples\file\smplfile.llb. Writes simulated, timestamped data to a text file in ASCII format that can be read by spreadsheet applications.
    Online, you can look at:
    Stream Scaled Data (Voltages) to a Spreadsheet File
    Chart Analog Data from File, Using the Cont Acq to Spreadsheet.vi Example
    Hope this helps. Best of luck!
    Kileen

  • How do I find locations outside of the country that I'm in?

    I'm in China and all of the search results within the Maps app are inside of china. For example, a search for "New York City, New York, USA" returns results for a pizza shops named "New York, New York" in China, but nothing in the United States. Similarly, a search for "Bangkok, Thailand" returns results for Thai restaurants in China and Hong Kong. Full address searches for locations in other countries produces the result: "no results found".

    If all you want from Google is maps, you can try ditu.google.cn
    "DITU" is the latin form of the Chinese pronunciation of "map".
    You can try google.cn for regular web searches (it redirects to google.com.hk). If that doesn't work, good search engines include duckduckgo.com, dogpile.com, and baigoogledu.com (include Baidu and Google results).

  • Trouble Using TimerEvent in While Loop

    Hello,
    I am attempting to use a TimerEvent in a while loop. In the example I have created below, the init function should loop through the values myArray, tracing each value at three second intervals. It seems, however, that because I am incrementing the currentNum value outside of the while loop (in the timerHandler function), that the loop just keeps running until Flash stops responding.
    var myArray:Array = new Array("one", "two", "three", "four", "five");
    var currentNum:int;
    var myTimer = new Timer(3000, 1);
    function init():void {
    while ( currentNum < myArray.length ) {
    trace(myArray[currentNum]);
    myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timerHandler);
        myTimer.start();
    function timerHandler(e:TimerEvent):void {
    currentNum += 1;
    init();
    I am wondering if what I am trying to do is simply not possible or if I am missing something.
    Thanks in advance for any thoughts on the matter.

    Thanks, Ned. That makes sense. I was able to work around my problem by getting rid of the while loop and using a conditional statement to test if I had reached the end of the array.
    var myArray:Array = new Array("one", "two", "three", "four", "five");
    var currentNum:int;
    var myTimer = new Timer(3000, 1);
    function init():void {
    traceArrayValue();
    function traceArrayValue():void {
    trace(myArray[currentNum]);
    if (currentNum + 1 < myArray.length) {
    myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timerHandler);
        myTimer.start();
    function timerHandler(e:TimerEvent):void {
    currentNum += 1;
    traceArrayValue();
    init();

  • How to pass a value from inside a while loop outside the loop

    Hello to everybody, I have been searching through the forum but I have not found a certain answer for my problem. I would try to explain my problem as breefly as posible:
    I have to send by a BNC2120 two signals and acquire an other one thats comes from a preassure sensor. That part is done by introducing simulating and acquiring DAQmx inside while loops.It is sycronized by my self, proving such diferent values (is not the optimum, but is only the first prototype) and works as I expected. Well, then I want to sample some of the values of these signals, that is done with relays and local variables to get the value in the instant I want to sample. Here begin my problems: I want to extract the sample values out of the while loops without restarting them, I mean: I do not want to stop the while loops because the acquisition and the generation of the signal must be continuous, but I do not know if it is posible to put the while loops in "standby" until I operate with the values I have sampled and then the signal generator and the acquiere continues from when it has stoped before. Particulary I want to obtain the value of the top while loop (inside a case) when the counter arrives at 15.
    I have proved to do with local variables, global variables, making a state machine, with event cases, with flat secuences...I have been reading about and proving diferent posible solutions for this week and the whole past week and I have not found the solution.
    If any of you know how I can do this thing, I would be loved to listen your opinions. My proyect is above: 
    Thank you a lot in advance.
    Sinceresly,
    Miguel.
    Attachments:
    maq_estados_event_case.vi ‏239 KB

    It definately sounds like what you really want is a Producer/Consumer.  It is an architecture that uses Queues to pass data from a data generation loop (producter, your DAQ loop) and a data processor (consumer).
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How should I set up my VI so that I can use the linear fit coefficient data analysis program, when my values are coming from while loops within a sequence structure?

    I'm attempting to create a calibration program, using the printer port, and a Vernier Serial Box by modifying a calibration program designed for the serial box.
    There are six calibration points, and to collect them, I have it controlled by while loops so that the numbers are taken when a button is pushed, and this is inside a sequence structure so that I can get the six different points. I feed these numbers into two different arrays (for x and y values) and then try to use the linear coefficient analysis on these points, but the values for the slope and intercepts it returns are not correc
    t.
    If I cut out the array and coefficient analysis, and feed the same numbers in directly without the while loop and sequence structures, it produces the proper values... I don't know why the numbers it is producing are different, and I'd really like to know.
    Thanks,
    Karinne.

    I would use a data manager sub-vi that would be called by each from of the sequence structure that produced a data point. The data manager sub-vi could auto append new items or could place items in a specific entry of an array. Later on when you want to calculate the linear fit, call the sub-vi to return the array of values.
    Stu

  • How to use Boolean values from 2 different sources to stop a while loop?

    I am working on a program for homework that states E5.4) Using a single Whil eLoop, construct a VI that executes a loop N times or until the user presses a stop button. Be sure to include the Time Delay Exress Vi so the user has time to press the stop botton. 
    I am doing this right now but it seems as though I can only connect one thing to the stop sign on th while loop. It won't let me connect a comparision of N and the iterations as well as the stop button to the stop sign on the while loop. So how would I be able to structure it so that it stops if it receives a true Boolean value from either of the 2 sources (whichever comes first)? 
    Basically, I cannot wire the output of the comparison of N and iterations as well as the stop button to the stop button on the whlie loop to end it. Is there a solution?
    Thanks!
    Solved!
    Go to Solution.

    Rajster16 wrote:
    Using a single Whil eLoop, construct a VI that executes a loop N times or until the user presses a stop button. 
    Look in the boolean palette for something similar to the word hightlighted in red above.
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for

  • When using Zoom on the iPad, is there a way to keep the keyboard the regular size?

    I'm trying the iPad 2, and being visually impaired, I need to use Zoom with it, but having it zoom in on the keyboard makes it very frustrating because typing takes a very long time. This is really what's going to make or break me buying an iPad. The

  • Can't look at laptop screen without getting migraines - any ideas?

    Hi all, I used my last 15 inch macbook pro bought around 2007 for many hours every day without any problems before it recently gave up the ghost. I then purchased the latest 13 inch macbook pro model a couple of weeks ago. However, it seems I can't l

  • Dump in Background Scheduling

    Hi all,           I am using FM 'FILE_GET_NAME' to retrieve path from application server and then i read and write on that file. Further my problem is this when i execute program in forground it is running fine but when i am scheduling it to backgrou

  • Line Chart & "don't summarize"

    Post Author: HelenW CA Forum: Charts and Graphs I am trying to create a simple line chart showing the value of an integer variable plotted against the time of day (24 hours). My problem is that when I choose the field that I want to plot, the checkbo

  • I am not able to open purchased In design CS5.

    Hi, Some time ago I purchased CS5 Creative suite. So far I used Photoshop. I desided to learn In design now. I am not able to open my In design. I downloaded In design again. Every thing seems Ok under downloading and installation, but I am still not