Read variable Subvi

Hi all

I would continue to read values inside a Subvi. The Subvi is a loop with 100 iterations.

I mean, I want to read outside the Subvi each iteration, but in the same pole.

Any idea?

Concerning

Kito

Kitofelipe wrote:

I would continue to read values inside a Subvi. The Subvi is a loop with 100 iterations.

I mean, I want to read outside the Subvi each iteration, but in the same pole.

You can't do it in the same line as the Subvi, because the loop cannot proceed to the next iteration, unless the Subvi has completed. You must use a separate loop.

What is the purpose of this exercise, complicates useless things?

Tags: NI Software

Similar Questions

  • How can I read variable in JSON?

    As a test, I have this JSON file called info.js:

    var JSONObject = '{"page_text" : "This a normal string that can be used."}'
    

    Now in my file animate CC I want to read this variable "page_text" so I can put its content, the string in a text field. I start there:

    // load JSON file  
    var req = new XMLHttpRequest();  
    req.open("GET", "info.js", true);  
    req.addEventListener("load", transferComplete);  
    req.send();  
    
    
    //output JSON file
    function transferComplete(e) {  
        var JSONObject= JSON.parse(e.target.response);
      console.log(JSONObject);
    }  
    

    It should read the file info.js. That works. Then it should display the contents of the JSON file to the console. Without this JSON.parse, it displays the content as a string. So it works, charging the JSON file and the output of the entire contents.

    But I want to output the content of the variable page_text. So I thought that the first thing I would do is analyzed JSON. But then it returns: "Eception SyntaxError: unexpected token in JSON in position 0 v'.» Don't know what I'm doing wrong.

    How do I make it out "It's a normal string that can be used."?

    I already found it myself.

    By running the JSON through a validator online of JSON, I discovered that an object was expected and a chain was given to the JSON variable.

    Here is a correct JSON file:

    {

    "page_text": 'this normal chain that can be used.',

    "other_text": "This is another text."

    }

    Then the correct code from AnimateCC to read this is:

    /

    / Load JSON file

    var req = new XMLHttpRequest();

    Req.Open ("GET", "info.js", true);

    req.addEventListener ("load", transferComplete);

    Req.Send ();

    outputJSONfile

    function transferComplete (e) {}

    var JSONObject = JSON.parse (req.responseText);

    Console.log (JSONObject ['other_text']);

    }

    With this console.log line you can read/output variables in the JSON file. Apparently, from the JSON file with something like:

    "var myJSON = ' {'variabel': 'value'}"

    He reminds that all of the following "var myJSON =' must be an object, while a string is given." Leading to these errors.

  • Reading Variable from php

    I know there is a way to read PHP variables, I've seen many tutorials. What I want to do is slightly different. I need to load the flash with a variable file.

    I want the user to have a url that contains a variable, PHP then get the displayed variable and load it into the flash on the page file. Is it possible to load the variable in the flash file?

    URL

    test.php? var = "List.Xml"

    PHP Inside

    validated variable

    load the flash file and load the var in the actionscript code

    Embeded Flash on the page or a redirect page

    ActionScript uses the variable that was embedded in the URL

    Any help on this would be greatly appreciated.

    Thank you

    Tony

    You can pass the variable most directly to flash using javascript to retrieve the url (including the query string) and use the externalinterface class in flash to interrogate this js function.

  • OMBPlus - TCL - reading variables out of text file

    Hello

    I want to read a text file variables.

    For example to connect

    OMBCONNECT $login/$pass@$host:1522:$service

    and these 4 variables in a text file.

    I'm a newbie, so this might be a stupid question


    Thank you!

    use

    OMBCC ' / / $i / / $I

    It's the double slash

    Published by: Katia on March 10, 2010 09:17

    Published by: Katia on March 10, 2010 09:21

  • Reading variable speed and/or video frame-by-frame with waveform synchronization

    I use Diadem 2011 to view the data saved in a LabVIEW Module we wrote.  The function of our LabVIEW module is simultaneously video capture from two infrared cameras and 8 channels of waveform data acquisition data and record these data on the disk.  Data is stored in two files AVI (compressed) and a TDMS file (using logging TDMS).  With the help of tiara, use Sync video to view video files and data PDM.  I can scroll a cursor in the waveform data Panel and discovered the video corresponding to the chosen time.

    I'm looking for two features of the tiara that I'm not sure that are present: 1) a way to vary the playback of real time speed.  (2) a way to advance the video in a frame-by-frame.  If anyone has any suggestions on how I can implement this in 2011 tiara or can verify that these features are present, I wish I knew.

    Thanks in advance.

    Hello Resaebiunne,

    All the functions you are looking for are available in the toolbar.

    For functions/forward of frame market, make sure that the section with the video inside is highlighted and then use these two buttons. The "Cursor settings" icon let's you change the playback speed.

    Hope that helps,

    Otmar

  • Delay weird read shared variables

    Hello

    I'm working on a project were I am followed a few lines of production. I use an OPC server on the DSC module to connect to PLCs on the production line and I created variables related to my labview tags of the PLC project.

    On my project, I have a main VI were I show information on production lines and I can access several subVIs were I see more information on these lines. Then I a VI that runs in the background were I read about 50 shared the PLC variables and where I save data in a MySQL database, data entry of data on the database of the Citadel and the recording of alarms.

    The problem I have is that I noticed a delay read variables that read weight of containers from the production line the VI that runs in the background. It seems that all shared variables suffer no delay, only the variables weight start to make some delay when the values are on the rise. It also seems that when I run only one VI, without running the main VI, there is no any kind of delay. I read shared variables shared as variable nodes.

    Can someone help me understand what is happening and how can I fix this delay? The VI that runs in the background is time critical and a strange delay like that messes up my data.

    Hi Mateus23,

    The shared variable has various capabilites buffering, including integration with real-time FIFO functionality in LabVIEW Real-time.

    I guess that buffering settings are causing the unexpected behavior.

    Check out these resources:

    Buffer Network-Published static Variables (white paper)

    Properties shared Variables dialog box

    - Network Page

    - Page FIFO in real-time

  • Common bug Variable programming read/Open Timeout

    I hope someone else has a preview of the question that I see when you use a network I/O published variable or static variable in general.

    There seems to be a bug when accessing variables shared by programming.  In the image below, I'm trying to access a shared variable hosted on a crio remotely.  In both cases I access the same shared variable on a crio which has been disconnected from the network.

    In the top box, the variable will be constantly timeout to 100 ms, when you use a shared variable node.  However, under the bottom, the time-out period is still 5000 ms even if I put it at 100.   There seems to be a 5000ms internal timeout in the service of programming for shared access even when you use the functions 'Reading Variable with Timeout' and ' Open Variable and check.  The Vi "Open Variable shared in the background" does not solve the problem either.  Time-out settings seem to have no effect if the network is disconnected when first login.  It is a huge problem if I opened a GUI and the network connection is disconnected.  All my demons using these variable slow to a crawl, because I can't specify a timeout.

    Not only that, but the vi is not reentrant and block.  So if I'm variable opening in several places, for example when using networks of actors, they all block series and create a bottleneck of the HUGE network.

    I hope that someone has experienced this same problem and has a way to go around.  At the moment I plan everything to use the TCP/IP protocol instead of rewriting shared or I/O variables.  Or establishing another layer that my calls them to the individual cards shared variables nodes.

    It's always a pain shared variable nodes are MUCH less flexible than with programmatic access.  In addition, I am also using an Ethernet add-on and I have to use shared variables to read data from the modules that there is no real time running on top.  Thank you

    Jiles,

    Thanks for the tip.  I had used the SHOUT library in the past, but he had forgotten.  This ended up being the solution to my problem.  I still think programmatic options for shared variables need to be a little more flexible, but I worked around it.

    In the library the CRY, there is a CRY Get Remote cRIO controller of information within this VI is an another VI cri_RT controller of Ping.  It is the function key that I ended up using.  I just a super short deadline on the function and check for an error before opening a shared variable connection.

  • TPC-2012 cannot read the shared variable

    Hello

    I have a TPC-2012 and can not read variables shared with him. I welcomed the shared on a cRio-controller Variable. On another PC, the variable is read correctly, but not on the tpc-2012. What can I do? No error message is displayed on the TPC-2012 (Windows CE 5). The PTC can not write values in a shared Variable.

    Thank you

    Christian

    What LabVEIW Touch Panel version do you use? I don't know why static variables do not work correctly on your device. TPC-2012 comes with support preinstalled for shared variables, and it would be possible that it has been deleted or corrupted. Here are some steps you can follow:

    Install the Support of shared Variables
    How do we install the Support of Variables shared on the TPC-2012?

  • read into the buffer variable published network shared

    I use a shared variable that is published in the network buffer to write data to an RT target and read data buffered by the host application.

    I followed a different behavior regarding data buffering using Variable vs reading read the shared Variable node.

    There is no problem the shared variable node read but using the results of reading variable function of loss of data, such as access without alkaline reserve. I can read only some of my data values.

    I see no difference in access in the buffer in LV2009 help.

    against

    Any help is appreciated

    Christian

    Hi Christian,

    The behavior you describe is because the client side PSP buffering is not applied to the Variable API shared in LabVIEW 2009.  It was a design decision, but eventually, we hope to include this feature in a future version of LabVIEW.  This bug here as you pointed out is the lack of documentation for it.  Corrective Action Request # 202159 has been filed for this issue.

    Let me know if you need assistance working around this issue.

    See you soon,.

  • Impossible to programmatically access a shared variable

    Hello

    I am attaching a file in project where I created 2 shared variables

    When I try to access it programmatically im getting this error "error-1967362038 occurred to read Variable in Untitled 1." "vi IAK_SHARED: (Hex 0x8ABC700A) not found."

    can someone tell me where im going wrong?

    Woof...

    found the solution

    has not deployed the library file containing the shared variable

    After you deploy the library file so I was able to programmatically access a shared variable

  • Sharing of gray object Variable

    Windows 7; LabVIEW 2012

    Hello

    Background

    I am attached to a companct data logger which will eventually be built into an executable file.

    Once built, I consider the uneditable blockdiagram and trace variables 100 + out of the question.

    That's why I want to be able to navigate to the variable through the façade.

    Problem

    As input for the 'read Variable.vi' I placed a control refnum on the façade.

    On using Browse on the façade of the dropdown menu, control some of the shared Variable

    The items are grayed out. I tried to deploy all variables shared and have visually inspected the varable

    properties to find no correlation. So far, I've failed.

    Can someone please advise...

    A big thank you in advance.

    Kind regards

    JeanLeo

    I'm not sure that this is a first, but I apparently forgot the evidence of the problem.

    All variables in gray are variable BOOLEAN.

    My apologies for the time necessary.

    Concerning

  • subVIs does not function when it is called by main secondary to vi

    Hi all

    I have a main.vi that loads the façade into a secondary four subVIs when selected. Like most applications, everything works fine up to come to build the project (.exe). Program works as expected when run it from .exe but when all the vi.lib functions (for example reading png Subvi) is included in one of the subVIs called, the façade is loaded correctly, but the Subvi is not running and the invoke node (perform a VI generates error 1003).

    I've included the subVIs in 'Always include' in the specification to build under the heading Source files.

    Help, please

    Thank you

    I made a significant change to your "called" sub - VI (I created an icon for it - you'll see why it's important in a minute) and again your main VI.  This code snippet is saved in LabVIEW 2015, but it is simple enough that you should be able to recreate it in any LabVIEW version you are using.

    I like to use references static VI (the first thing on the block diagram) because, especially if they are associated with a Subvi with an icon, they provide a mnemonic, robust and easy to get a lot of useful sub - VI 'properties' (for example the path) without worrying about the execution environment.  In particular, they work very well with the Start function Asynchronous Call, I think it's much simpler to use than the VI server method.  I'll walk you through it...

    1. Start with a static reference of VI to the Subvi to run asynchronously.  If your Subvi has an icon, it will appear (as shown here) in the body of the static VI reference, which makes it slightly better documented.  Notice the Red Star on top of the static reference - which indicates a reference strictly - type (right click and choose strictly typed), you need to the asynchronous call start.
    2. This reference gets first wired to a property node - the unusual appearance of the node ('VI Interface Type 2') comes from the strictly typed reference.  We choose the Path property.
    3. The path gets plugged into an open VI reference function.  Because we use asynchronous Start Call (Forget), we specify Option 0 x 80 (glance using reference VI open for further explanation).  We also wire the Strict Type of step 1 at the entrance to this function Type.
    4. The VI reference resulting is wired to Start Asynchronous Call, which starts the called sub - VI.
    5. We also spend it to Insert Secondary VI method, which shows the sub - VI running in the Sub panel.
    6. Now, we interact with the sub - VI in the Sub panel as much as we want to.
    7. In the main routine, we now run the while loop, waiting simply Stop pressing.  I placed a 100 msec waiting here to give priority to the Subvi.
    8. When leaving us, we remove the sub - VI of the Sub panel, he abandoned and get out.  I see no need to put a function exit here - if you want to automatically close the main façade, just do it.

    Bob Schor

    P.S. - I've tested (LabVIEW 2015) and it works fine.

  • Write real Labview 8.2 Twincat embeded application variables

    Hello

    I am currently using Labview to write and read variables defined by an embedded application of Twincat.

    I set the following variables in Twincat:

    Lab_lecture_real % MW100: REAL;
    Lab_ecriture_real to % MW102: REAL;

    Mo1% Lab_lecture_bool: BOOL;
    Lab_ecriture_bool % MB2: BOOL;

    Based on the VI given by Beckhoff to Twincat ADS/OCX (http://infosys.beckhoff.com/english.php?content=../content/1033/tcsample_labview/html/tcsample_labvi... =), I managed to read the variables 'Lab_ecriture_real' and 'Lab_ecriture_bool' and write through 'Lab_lecture_bool '.

    However, I forgot to write in "Lab_lecture_real", which is a real.

    I enclose my VI, everything seems to be connected correctly. However, I do not understand why it works for a Boolean variable, rather than a true. The method used for writing a real is perhaps different from Boolean.

    Can you stress me about this, please?

    Kind regards

    Stéphane

    Why you set the length for the REAL number 8 in VI?

    It is in the documentation of the OCX elsewhere?

  • Adjust the data in the database with the variables

    Hello

    For my internship, I have an assignment to read and set a database with the variables. This SQL server 2005 database contains variables of a controller. These are read and write variables. The assignment is to display the read variables and the user can adjust the variables of Scripture. The first part was "easy" because the forum contained a lot of examples of this. The second part is more difficult because the forum contains absolutely no example of this. Can I use LabVIEW 2010 and 2011, and also I downloaded the 30 day trial of the database connection tool. If it's useful, I can recommend my company to buy this package. Playback vi makes use of a UDL (Microsoft data link) connection.

    So you guys my question is: is it possible to adjust the specific variables in a database using LabVIEW? And maybe you can give me a little advice on this topic...

    Thanks in advance!

    Roy

    In SQL, the specific data are always selected with the keyword WHERE. In VI to update there is a link for options, you can for example add a constant 'WHERE id = 1457 and measure > 0.54 ".

    You can ofc. also build this chain through controls, settings and other means.

    If you prefer, you can use the Execute Query (under Advanced tab I think) to which you can send the complete query example "TestTable Update set name ="Zeus"where id > 14 and id.<>

    /Y

  • String to the Variable of the PSP?

    Hello

    I was hoping I could buid programmatically a variable path shared and then use the Reading Variable VI to read a value.

    Unfortunately, while I can convert a PSP Variable in a string, I can't do the reverse. The output of the string to the shared Variable VI is not recognized by the Reading VI Variable. I tried to convert it to a PSP Variable to help more class specific, but she would not allow LabVIEW or the other.

    Is there a way to convert a string to a variable that is shared by program readable?

    Thank you!

    DUH... I can use the Container Seach VI, as the beginning of my posted code... X_x * slinks away in embarrassment *.

Maybe you are looking for