Is there any concept in LabVIEW that is similar to static local scope variables in C?

I'd like to retain the value between calls to a subVI, as can be done using a static function scoped variable in C. The textbook example of how this is used would be a variable in the function that is a state machine, and knows what state it was in last time it was executed. A simpler example would be just keeping count of how many times the function has been called.
I suppose I could use a global or I could pass values in and out of the subVI, but I'd like to keep the variable known only in the scope of the subVI if at all possible. For example, the outside world has no business knowing (or god forbid) changing what the state information of this function is.

Bmarsh wrote:
> I'd like to retain the value between calls to a subVI, as can be done
> using a static function scoped variable in C. The textbook example of
> how this is used would be a variable in the function that is a state
> machine, and knows what state it was in last time it was executed. A
> simpler example would be just keeping count of how many times the
> function has been called.
>
> I suppose I could use a global or I could pass values in and out of
> the subVI, but I'd like to keep the variable known only in the scope
> of the subVI if at all possible. For example, the outside world has
> no business knowing (or god forbid) changing what the state
> information of this function is.
There is no need to do something "conceptual" or spec
ific to have this
static variable. You already have this in any control or indicator in
your sub-vi while it is in memory. Control/indicator value will remain
in sub-vi data space between calls. Don't forget about make your sub-vi
non-reentrant or keep track of sub-vi data space copies.
If you want to read/write this value from another vi, consider it global
or I'd prefer to suggest using functional global(uninitialized shift
register in 1 iteration while loop). Think of it as about 1 value data
repository.
LabVIEW CIN reference manual is a good place to look at, as well as
LabVIEW course kits, describing LabVIEW memory issues in details.
To simplify: create empty sub-vi with control and indicator connected to
each other and call it wiring indicator in caller vi. Keep sub-vi front
panel open and change control in sub-vi manually. You see what happens.
Sergey Krasnishov
Automated Control Systems
National Instruments Alliance Member
Mos
cow, Russia
[email protected]
http://acs.levsha.ru

Similar Messages

  • Is there any object in labview that contains a list of data for the user to select (selection one at a time) or add a new data?

    Is there any object in labview that contains a list of data for the user to select (selection one at a time) or add a new data?

    List and table controls -> listbox..is that what you are thinking of?
    The listbox presents the user with a list of options, and you can set it to only accept one selection at a time...Adding new data to the list can not be done directly by the user but if you make e.g. a text control and a button you can programatically insert new objects described in the text box when the button is pressed...(see example).
    If you need more than one column you have the multicolumn listbox. If you want the users to write new entries directly yu can use a table and read selected cells using it's selection start property to read what cell has been selected.
    MTO
    Attachments:
    Listbox_example.vi ‏34 KB

  • Is there any incompatibility between Labview 8.5 and Traditional DAQ?

    Hi,  I`m using a DAQPad 6020E and the Labview 8.5 Daq assistant don`t detecte my DAQ when a try to create a new task (to create a new virtual chanel). But MAX detect the DaqPad. So, is ther any incompatibility between Labview 8.5 and traditional Daq? Do you know how can I resolve this?
    Thanks.

    First, you posted to the wrong board. Measure is an old add-on for Excel.
    Second, there is no incompatibility between LabVIEW 8.5 and tradtional DAQ. There is an incompatibility between traditional DAQ and DAQmx which is what the DAQ Assistant uses. Make sure that you install DAQmx if your device is supported by it. Otherwise, you will not be able to use the DAQ Assistant.

  • Is there any possibility in LABVIEW to Create a release mode EXE like VC++

    iam krishnaprasad. iam new to LABVIEW.
    i have 1+year experiance on VC++6.0.
    Is there any possibility in LABVIEW to Create a release mode EXE like VC++ .
    if there please suggest me how to create  it..
    Solved!
    Go to Solution.

    First, you must include you VI inside a LV project. This can be done automatically by selecting New Project from the Files menu in that (any) VI.
    LV will ask you whether to include any open VI to be added to this newly opened project. Click Add & thats it. Now save this project in a location of your preference.
    Then, in the Project Explorer window, right click Build Specifications >> New >> Application (EXE) or Installer, as per your requirement.
    The former will create you an EXE only while the latter will bundle all that needed for an installer (mainly LV run-time engine of the version under use).
    If you create the EXE alone, then you need to install the LV run-time engine of the corresponding version manually in the target PC first, before trying to run you application (EXE). Else, it will throw error & wont run properly.
    - Partha
    LabVIEW - Wires that catch bugs!

  • I have huge lag with Safari's Reading List using a rMBP. I have probably 80 articles saved, which is likely the cause of the lag. Is there any way to export that list of articles so as to be able to delete them from Reading List but still have a record?

    I have huge lag with Safari's Reading List using a rMBP. I have probably 80 articles saved, which is likely the cause of the lag. Is there any way to export that list of articles so as to be able to delete them from Reading List but still have a record of the articles I intend to read?

    I'm currently dealing with this issue myself, except that my rMBP has NO articles in the reading list.  It's a brand new rMBP too, purchased just this week, with the 2.6 Ghz Processor & 16GB of RAM.
    Let's see what we can find.  I may just take it back to the Apple Store.

  • In contacts there is the possibility to add a new event, as the birthdays, but they do not appear in iCal. Is there any way to make that possible? It is normal to have a person with his birthday, anniversary and others key dates you want to link to him.

    In contacts there is the possibility to add a new event, as the birthdays, but they do not appear in iCal. Is there any way to make that possible? It is normal to have a person with his birthday, anniversary and others key dates you want to link to such person, but the only one shows up is the birthday. How to be able to show all those dates linked to people in the agenda in the iCal?
    Thanks

    Hi,
    I sugggest you try my application, Dates to iCal. It is shareware with a 2 week trial period.
    Dates to iCal 2 is a replacement for Apple's birthday calendar for iCal. It has a range of features to allow the user to choose what, and what not, to sync to iCal from Address Book.
    As well as automatically syncing birthday dates from Address Book, Dates to iCal 2 can sync anniversary and custom dates. It can set up to five alarms for each date in iCal and can also set different alarms for birthdays and anniversaries. It allows the option of only syncing from one Address Book group. This application also allows for the titles of the events sent to iCal to be modified to the user's preference.
    Best wishes
    John M
    As I sell software on my site and ask for donations, the Apple Support Communities Use Agreement requires that I state that I may receive some form of compensation, financial or otherwise, from my recommendation or link.

  • I need to visualize a document attached on a pdf file on an iPad.  Is there any application  to do that ?

    I need to visualize a document attached on a pdf file on an iPad.  Is there any application  to do that ?

    Yes. Quite a few actually.
    Starting with Apple's own iBooks App, I also see many recomendations for Goodreader, and Adobe's own PDF Reader.  Just to name a few. Look for them in the App Store. iBooks and Adobe reade are free.  You can also search the App Store for other alternatives.
    Also for most PDF's the Mail App can open them directly.

  • Is there any fuction or bapi that can print the report automatic?

    Dear All
    I want to print the report( generated by command write ) automatic.
    Is there any function or bapi that can do it?
    Thank you in advance.

    Hi,
    Please try this.
    report ztest_auto_print.
      DATA:L_PARAMS TYPE PRI_PARAMS,
           L_VALID TYPE C.
        CALL FUNCTION 'GET_PRINT_PARAMETERS'
           EXPORTING
             IMMEDIATELY                  = 'X'
             LINE_SIZE                    = 220
             RELEASE                      = 'X'
             MODE                         = 'CURRENT'
             NO_DIALOG                    = 'X'
           IMPORTING
    *     OUT_ARCHIVE_PARAMETERS       =
             OUT_PARAMETERS               = L_PARAMS
             VALID                        = L_VALID
           EXCEPTIONS
             ARCHIVE_INFO_NOT_FOUND       = 1
             INVALID_PRINT_PARAMS         = 2
             INVALID_ARCHIVE_PARAMS       = 3
             OTHERS                       = 4.
          IF SY-SUBRC <> 0.
          ENDIF.
    "But it will take default printer from user settings
          NEW-PAGE PRINT ON   PARAMETERS L_PARAMS NO DIALOG.
           write : 'print is on'.
          NEW-PAGE PRINT OFF.
    Regards,
    Ferry Lianto

  • Is there any other method so that I can contact Apple to get IMEI number ? since the phone was shyncronized several times in apple store / iCloud.

    Hello community members, my iPhone has been stolen and I tried to contact police, they are asking for IMEI number of the phone. Unfortunately I could not read the IMEI number on the box due to moisture wiped out most of the number on it. I sacanned it in and enhanced, I'm still unable to read out the number. Is there any other method so that I can contact Apple to get IMEI number ? since the phone was shyncronized several times in apple store / iCloud.

    If you backed up your iPhone in iTunes on your computer -
    Open iTunes - Edit - Preferences - Devices - See Device Backups in the Window.
    Hover mouse/curser on any backup. Read IMEI and Serial no. your of iPhone.

  • Is there any why to check that the reports are functioning well in Webanaly

    Hi Experts,
    is there any why to check that the reports are functioning well in Webanalysis?
    any Help in this issue ASAP is highly appreciated
    Kind Regards,
    Vam-c

    What do you mean by checking whether they are working?
    You can always open the report and see whether everything is working ;)
    Regards
    Celvin
    http://www.orahyplabs.com

  • I have an ipod touch 3rd generation 8 gb, is there any way besides jailbreaking that i can get ios 4.3.?

    I have an IPod Touch 3rd generation 8 gb, is there any way besides jailbreaking that I can get IOS 4.3.?

    You do not have a 3rd gen 8Gb iPod Touch. There is no such thing - really, truely, double true, extra double protected true. {lllaass, back me up here}
    Jailbreaking cannot be discussed on Apple forums., except to point you to the following article: http://support.apple.com/kb/HT3743 which will let you know why Apple strongly cautions against "jailbreaking".
    You could sell your current iPod and buy a new one, which will be able to use iOS 5.
    GM:  gross mismanagement
    I suppoose jailbreaking would be a GM!

  • Is there any table or report that available in SAP for any PR/STR

    HI All,
    Is there any table or report that available in SAP for any PR/STR that are remain opened after S/O canceled.
    Please advice at the earliest.
    Thanks
    Chandru

    Chandru,
    Of course.  The standard MD06 transaction will display ALL MRP generated exception messages, and will take you to the individual material to allow you to determine how you wish to respond to it.
    So, MD06>enter the plant.  Optionally, enter the controller if you wish to limit the results by planner.
    If you are interested in Sales order cancellations, then these exceptions would be categorized by SAP as belonging to the  "exceptions during Scheduling" or "exceptions during availability" groups.  On the Exceptions group tab, select these two items (6&7), deselect the rest. Enter.
    You are now presented with a list of all materials that contain one or more of these exceptions.  From the menu bar at the top, select Edit>Find.  If you get a 'statistics' popup, click through.  Select the 'Find Exceptions' tab.
    Message 26 "excess stock in individual segment" means that in a MTO environment, you have more supply than demand against given order/items (as you would have if a cust. cancelled his MTO order).  Select this message.
    Message 20 "Cancel Process" means that you have a supply element that has NO requirements (as you would have if a cust. cancelled his MTS order).  Select this messaege.
    Message 15 " Postpone process" means that you have supply elements that are scheduled to be received earlier that necessary (as you might have if a Cust cancelled his MTS order). Optionally select this message.
    Clik the green check.  You will now notice that certain rows on the listing are highlighted.  These are the ones that contain your problem children.  Hit the "glasses selected MRP list" button.
    This takes you to the first MD05 of the highlighted items.  Review the problem.  Decide what to do:  Cancel a supply element?  Push out a supply element? Leave it alone?  Call customer service to discuss which order was cancelled and why?  etc etc etc...
    Once you are done with the first material, clik on the 'next material' icon or hit Ctrl-F2.  Repeat.  Continue till all materials have been evaluated and resolved.
    This works for any other MRP message as well.
    Regards,
    DB49

  • Are there any other flash players that you can use on Safari other than Adobe

    Are there any other flash players that you can use on Safari other than Adobe?

    Not as far as I am aware.
    The latest version of Adobe FlashPlayer can be obtained from here:
    http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFl ash
    You can check here:  http://www.adobe.com/products/flash/about/  to see which version you should install for your Mac and OS The latest version, 10.2.152.25 or later, is for Intel Macs only, as Adobe no longer support the PPC platform. Note that the latest Flash Player update only works on YouTube with Safari in 32 bit mode - until YouTube correct this.

  • Is there any college or university that offers a course on Web Site Building using I Web?

    Is there any college or university that offers a course on Web Site Building using I Web? 

    Check with your local Apple store for the next workshop for iWeb.  It'll be a hands on session learning to use iWeb. It'll be more technical than design oriented.
    OT

  • Is there any place in Pages that will let me make a family tree chart?

    Is there any place in Pages that will let me make a family tree chart?

    Use text boxes for the family members and link the boxes by selecting both (or any lines) using:
    Menu > Insert > Connection line
    You can only link 2 objects at a time, but can build up the structure which remains linked.
    Peter

Maybe you are looking for

  • Power Mac G5 Dual 2.5 freezes up, Power Mac G5 Dual 2.5 freezes up

    Hello I inherited a Dual 2.5 PPC Power Mac G5 from my sister. She was having problems with it suddenly freezing up. She replaced the hard drive but that didn't fix it, and sicne she had a newer Macbook Pro she gave up on it. When I got it I replaced

  • ITunes wont delete, needs re-install but keep getting error message.

    I have a Dell XPS M1710 and running the latest version of iTunes. Well, I had a problem with the DVD drive in the laptop and one of the tech guys edited the registry remotely and re-installed the DVD drive. Now iTunes is showing this error message wh

  • Keep getting error message when attempting to buy a song (Error 5002)

    This error message seems to pop up with just this one song (says there is an issue with the iTunes store and that it is an unknown error) and it has not changed this status for a month now. I have the latest iTunes and there were no problems in updat

  • Portal with CUA userbase

    Hi, Our Scenario: We are using portal with CUA userbase. But, now we want to use the portal for a Non-CUA system users ( this system is not part of CUA) How can I set up the portal authentication ? Can I setup two user bases ? Please advice

  • JMS active connections to MQ Series

    Hi There, Is there any algorithm to calculate MDB's active connections opened to MQ? Thanks in advance, Naveen