void / vi... read vi inside while loop

Hello

I'm new to Labview... My main Vi keep reading data from serial port and parks (in words) in a table (put all in a while loop)...

The table is also inner while loop... Now I still want to analyze this (element by elemnt) table and create an another VI who takes this array running as input... so the new VI should simply have this table entry... but the problem is that I can't see the data running in new vi... .any suggestions... ??

ebuckbuck wrote:

Thanks Apok...

I'm not sure hoiw reference books here as when I create refernce of table VI main (24 sep... (VI)... it does not produce yet of any substance in following VI (who called)... Attached are my two files... .and I just want my main VI as for the output as array2 Terminal...

Thank you very much

ebuckbuck

in this example, we want to move an indicator (main.vi) digital of the second loop (sub.vi)...

Tags: NI Software

Similar Questions

  • Possible timeout in VISA read/write in While loop

    As the title says, I have a while loop that is constantly written followed by reading using VISA read/write.  I'm waiting for buffer correspond to a certain one, which the true value would end the loop.  In this loop, I have an indicator showing how many times he runs. All of this is repeated in another while loop.

    My problem comes the counter arrives at 10, then stops at the "write" command.  Do not know why.  I tried to increase the time-out of the instruments, but nothing has changed.  I added a delay of 10ms in loop, which also has not changed anything.

    For reference, I use a tektronix scope series 3000 of the MDGS and checking its state of relaxation.

    You said chill to read earlier!

    But it is not supposed to have to write it either.  Experimentally, access all VISA nodes, right-click and choose the Mode of synchronous i/o.  Make it synchronous instead of asynchronous.  The watch symbol will disappear from the top right corner.  See if that changes anything.

    What kind of serial port are you using?  What is an integrated in the PC?  A USB to serial port adapter?  Makes the chips on that, Prolific and FTDI?  You can try with a different serial port or a brand of adapter?  A lot of people have had problems with prolific chips.  And I have also heard of people having problems using adapters who had fake chips in them.

  • stop the loop inside while loop

    Hi all

    Is there a way to stop a loop within a while loop? Error-free program will stop running when you press the stop button, but I want to while loop continues to run in and only for the loop stops when the condition is met.

    Thank you!

    Hi TayAus 1.

    If you want to run the execution once? Maybe something like below? The code inside the structure of events can only run when the event source is triggered. For example, the code in the digital works only when it detects a change in the numerical value (just an example).

    When the button is selected, it should raise the event to stop as shown below:

    If you want to create the event source, create the structure of the event > right-click on the frame and select edit events dealing with this... > This should open Edit events.

    The example below is that I put the event source for the change in the value of x and x 2.

    So when x or x 2 value is changed, executes the code in the sous-schema event shown below.

    Warm greetings,

    Lennard.C

  • While loops inside while loops, how to stop?

    Hey, I'm confused with a simpler question to multiple while loops. My goal: stop or pylone2, just jump out of the small loop and stay in the big one. and if I click on stop 3. the entire program would cease... How can I do this? The following script does not at all... Thanks in advance!

     

    Yes you are completely right Mike... now, I solved the problem with another structure of the event and the Boolean variable local... Thank you very much!

  • Structure of the event inside while loop

    I'm still fairly new to Labview and this may seem a simple question.  I'm doing a Subvi to display, edit, and create configuration files.  I use a ListBox to list all sections of a config file and structure of the event to update the values in each section, when they are clicked.  The problem is that the structure of the event seems to be a break the while loop so that the buttons do not work until the event has executed.  What I would like is the while loop to run continuously and the event to run only when I click in the listbox control.  I hope this makes sense.  There is a peak in the diagram below. Thank you

    There are a number of issues with your code that could cause problems:

    1. You must use the FP. Open method to open the front panel of a VI and of the public Service. Close method to close. I don't remember exactly the problem, but starting with the 7 worm nor indicated that these methods were the preferred way to perform these tasks.
    2. Based on what seems to be the code, the event for the control of Presets of wood should be a change the value - not a mouse down event. After changing the type of event, use the event data NewVal to drive the indexer table index entry.
    3. The buttons Ok and cancel them should be handled in their own events to change the value. The value change event Cancel would exit the loop, while passing the output error (which indicates that cancel was pressed) and default values for the other 4 outputs. The change of the value Ok event would leave the loop by passing the values that the operator had concluded the 4 controls on the front panel.
    4. An event of timeout with a very short time (1 msec) would stop loop if an error has occurred, or the output of the gate AND is set to true.
    5. The wait function is not necessary, as is the case outside the loop structure.

    Mike...

  • How to send the value of inside while loop outside

    Hello

    The goal of my project is to control the height of a ball in a tube (there is a fan down low to lift the ball to the top and bottom) and a Top ultrasound sensor read the distance of the ball.

    I am currently using a PWM signal to control the speed of the fans (which works fine) and I use the VISA blocks read/write to communicate to my sensors (which works also very well - I can get the distance to the ball - when I move the ball up and down changing the duty cycle).

    My problem:

    Now, to create a control problem, I need read the distance of the ball, have some sort of controller and feed in this output as my new duty cycle for the fans... However, I need loops I have (running fans and continuous sensors to run (I guess? unless there is a way around it.) so the fans continue to work and sensors keep reading.) I need to get the measure of the distance of the loop of the sensor (after its been read) passed out of the loop and to be updated of course - then calculations can be made on that and then can be used as my duty.

    Someone in a way that I can do this? Its all tied to your reference, version of labview 8.6.

    Thanks heaps!

    Nick.


  • What is READ the array returned by the DAQmx meter? How can I know the two functions DAQmx READ data stream in the same WHILE loop?

    I have a question about the order of execution.  In the WHILE loop, I have two things to measure, period and tension using the DAQmx READ functions for voltage and the meter.  In the end, I want to collect these data as points almost simultaneously as possible, as a pair and then send them together to another piece of code (not shown here) which them will result in some sort of command for an engine.  It would be run, and then I want to perceive the tension and the period at a time later and do the same thing.

    (1.) I'm a little confused on what the meter of the READ function is back because it's a table.  What is a picture of?  I thought that it was up to the value of the individual periods between rising edges.  The output of the counter 1 DBL d's a table. How many elements in this table, and what determines the size of this table?  Are the elements of the array the individual delays between the edges?  How many values are stored in the array by executing?   We take the AVERAGE of the last 15 items, but do not know if we are throwing some of the data or what.  How to understand the composition of this painting?  How can I change the composition of this painting?  Is it possible to measure only one period at a time, for example the time between TWO edges?

    2.) Will this WHILE loop execute as it gathers tension and a "period table ' (remains to be understood by me) by TIME running in a loop?  In particular, we want that the value of the tension associated with the value of the AVERAGE of the period "array", so we can use two data items to create orders of next control every time that the two values are reported.  The structure for the delivery of vi will be attached data in pairs like this?  I understand that one of the READING functions run not before the other function of READING in the WHILE loop.  I want that the period "means" and "strain (Volt) collected at the same pace. This vi will he?

    Thank you

    Dave

    Hi David,

    I suggest including the DAQmx Start Task function. If it does not start before the loop, it starts the loop and work very well, but it is not as fast and efficient. In the model of task status, task wiill go to run the checked each iteration of the loop and then back the time checked running when it restarts.

    The status of the task model: http://zone.ni.com/reference/en-XX/help/370466V-01/mxcncpts/taskstatemodel/

    Kind regards

    Jason D

    Technical sales engineer

    National Instruments

  • While loop inside a timed loop

    Hello world!
    I use:
    -LV 7.1 + real-time;
    -compactFieldpoint;

    When I put some time, I noticed a strange behavior, loop inside a timed loop.  Let's fix loop timed with these settings:

    -Clock 1 kHz
    -1 ms period (Yes, I know it's short...)
    -offset 0 ms
    -Stage 0
    -Take the period of absence (ON) and maintain initial Phase (ON);
    -Timeout:-1.

    So, inside the loo, I put a traditional while loop, waiting (for example) an event will occur, and if this event doesn't happen, my cFP-2020 crashes! I mean, it becomes inaccessible for the debugger, and also, if I run a ping at his address, after a few cycles it becomes inaccessible as ping!

    Obviously, that statement of code lock the fieldPoint, because if I remove the inside while loop all work.

    I know that with 1ms duration, timed loop always the finishing of the delay, but I put the scrapping period missed and timeout-1.
      
    It seems to me that sometimes timed loop add overload heavi programs, I all so that the loop according to the tasks, even if my application has be in real-time!

    Tips welcome! Good day!

    Graziano

    Thank you very much for your answer!
    I'll test the entire application and then look for the best practice... but I still think I'll replace it timed with while loops loops...

    Good day!

    Graziano

  • Change the width of digital pulse inside the loop

    Hello

    I am looking for a solution that allow you to change the width of digital pulse inside while loop.

    Thanks in advance

    Check the operation of dataflow and single pulse meter output

    First counter generates little time, then big time.

    Your AO task then is to adjust tension on IT after Dig pulse. After the AO pulse width, he needs to put down

    If the Trac software is small enough for you, you might have used USB-6008 ($250), not Xseries $ 1600 - apparently of an overdose. X series can do this work with a void microsecond resolution.

  • A result of sending the data to a while loop through another loop of TCP communication

    Hi all

    I have 2 screws

    1 matching model (using the method of Grab) which is put inside a while loop. This VI works correctly and returns a string in a specific format (position and the angle of the object).

    2 TCP server who always listens to a specific port, if it receives a correct command string, it sends the string above VI - 1 (position and angle).

    The two 2 screws works if they are in separate VI. But I want to combine them into 1 single VI and I get the problem: Pattern matching doesn't work anymore (the video has only first frame then stops).

    I tried to put the two while loop in parallel or put the TCP while loop inside while loop Pattern Matching. Nothing has worked.

    Pls see my attached VI and the TCP module.

    What is the solution for requirement?

    Thank you all!

    What I would do, is be your two screws at the same time.  Given that you do not send the last result, store the result in a global variable.  Your comparison models written VI the global variable of the results of each iteration of the loop and the TCP bed module global variable results when it receives the right to order and then send it.

  • Update an indicator of in while loop with event driven programs

    I'm trying to update a chart shared by several events within a Structure of the event. I would like a change in value of a button (NOPE or OK buttons in the attached example images) causes the structure of the event causes a switch between the various outputs for the chart. In the example attached, clicking the OK button will send the graph random matrices, while clicking on the button NOPE will send constant tables to the curve.

    As the process within the structure of the event is underway, I use a while loop within each of the different events in the event Structure. So there is a structure of the event, and each event have while loops in them which should update the chart outside the structure of the event (see attached images).

    This does not update the graph, the graph remains static instead, why is this? How can I configure it to work as I described above?

    In my view, a question is: How can I use the same stop button in both inside while loops. In the example images, I have two that are different, one for each of the different events.

    Thank you!


  • While loops and event structures

    Is there a problem using more then one While loop with an internal structure of the event, in a single VI?

    In my (only a partially attached printscreen) VI there is more then 2 all in curls with a structure internal even who controls a different devices.

    Event structures are being controlled by a box structure.

    From time to time the VI gets stuck and resetting local variables.

    Hello

    Using two while the loop is not a problem, it depends on how you structure the code.

    Generally, we use two while loop for Producure-consumer, master - slave structure type of applications. Try to use the structure of State machine inside while loops, see standard state machine examples in the palette of NOR find example.

  • [begineer] reboot a 'while' loop reading the serial port

    Hello! I read some data from a COM port. I want to read my like this "%d S. the unit will send data continuously and depending on when I push the button run in labview, it can start to read data from the middle (%d is a four-digit number). as: 23 S 15'

    "whenever the first character of my data is not of", I need to restart playback. I read the data in a while loop. so I need to stop the while loop. From what I found on the internet, I used a case, another while loop and shift registers.

    but in some way I'm stuck inside the while loop. My VI is attached. Thanks in advance and sorry if my code is a mess!

    PS: what should I do if the bytes I get to the port is variable? use bytes to the port?

    The device sends a character at the end of the line at the end of each message?  You are currently Setup to do this by activating the stop character (currently set to end of line/10/0xA).  If this is true, then simply set the bytes to be read on the VISA to read something rediculously high.  It will stop playback when it finds this termination character.  From there, you just have to check for the correct format.  If this isn't the right format, ignore him.  Otherwise make your recording.

    I managed to clean up your code a bit on this basis.

  • dispplaying data on the graph of waveform inside/outside while loop

    I create a vi using the random number generator, entering the number in the function(express>>arithmateic>>maths>>trig>>sine) fishing and connect the output of the function sine waveforms. Table of waveform show no problem. If I replace the with graphic waveform table, I get an error that the source type is differenct type of sink. I then put waveform chart outside loop everything hoping that tunnel would act as a table, but still I get the same error. I then put build table palette between all border and loop waveform graph which is placed outside the while loop. I get no error, but no data is displayed on the graph of a waveform. Theoretically, if I press stop I would see a distorted sine wave on the waveform graph, but this doesn't seem to be the case. I am wondering how to view data on the graph of a waveform in such cases!

    Thank you in advance for reading and help!

    See you soon

    First of all, you can take a part of the basis of LabVIEW tutorials.

    Since you need to work with a chart and it is the preferred method to display data point by point, I don't know why you try to use a chart. In any case, you cannot use all simply a table of generation because that would be just the result of the last iteration and your graph indicates it is a single point. If you activate autoindexing, then you get all the values, but not before the end of the loop. If you were to use a shift register and the build dashboard, you might place the graphic inside the loop, but then you would face performance issues that the table would grow uncontrollably.

  • How to have a while loop inside a structure of matter?

    Hi all

    I would like to know how to control a while loop by using the structure of the case? I would like the person to check if the object has is in its original position or not.

    If this is the case, go...

    The object must then do its job, as mentioned in the while loop... as up and down 10blocks...

    Later, when she returns to its original position, the entire process must stop...

    I checked the forums on this http://forums.ni.com/t5/LabVIEW/How-to-stop-while-loops-inside-a-case-structure/m-p/591259

    It is the closest, I can have... but can someone tell me how to program for this? How logic should be?


Maybe you are looking for

  • The iTunes 12.3.3 dmg is available somewhere?

    Need to downgrade as Snapper does not work with 12.4. Anyone have the link to apple server to download 12.3.3? Thank you!!-j

  • No storage

    My phone telling me that I've not left storage. But I don't have that 100 photos, music and only a few applications. I delete my messages, deleted all the pictures on my whatsapp group discussions and delete the unwanted things! Before I had over 800

  • Satellite Pro L550-1WG guard type the letter R on its own

    Hello My computer laptop curerntly guard type the letter R on its own, so much so, that I can't use it for work as it takes hours to write a few sentances.Holding backspace I get rrrrrrrr... Now shift I get GRANDPA When I type r it takes forever to c

  • Touchpad behaves erratically when the AC is connected to the Satellite L300

    Hello I have a laptop Satellite L300D and after an accident falling on the floor, the cursor of the mouse erratically when the laptop has is plugged into the power outlet. If the laptop end.I would be extremely grateful if you could help to solve thi

  • Graphics wrong twice in a row

    I ordered a laptop T420S about a month ago and received it in about two weeks. When I turned it on, I found that they sent me the wrong graphics card. My specs were: Technology Optimus NVIDIA Quadro NVS4200M (1 GB) What is the option of the improved