Controlling front panel properties from within a statechart

I have a user interface that I am trying to put into a statechart.  On the user interface I have a bunch of buttons (controls) and indicators.  To populate the indicators I am getting data back from 2 sources (USB and RS 232).  For this, I have made shared variables for the data returning from the sources but this only works for indicators as far as I can see.  Anyway, I have the software working and now that I am trying to go back and place the code into the statechart format to clean it up I am running into issues.  Since the statechart does not run inside the labview panel I can not access the front panel properties of controls.  Basically, I am using the statechart to control which buttons are active on the front panel (this is dependent on the state the user is in).  Also I am using the states to control a LabVIEW “tab control” to determine which tab to display.  For instance, I have an operate screen and a calibrate screen.  Depending on which state the operator is in, different controls are active (I don’t want the user to accidently change an item on the operate screen while in calibrate).  Is there a way to do this inside the statechart structure?  

You don't actually copy the reference itself. Rather, you want to add a control of the same type as the reference to your statechart Inputs.ctl. You can get such a control by right clicking on the reference you created and choosing "create control".
Then you pass in the reference to your specific control into the statechart via the inputs terminal. You can then talk to this reference via VI server and manipulate the original control. 
If this isn't clear probably the best thing to do is to look in the LV help index for the keyword "control references" and read about "passing to subVIs". Passing a reference to a subVI is very much like passing one to a statechart so most of this is relevant.
Hope that helps.

Similar Messages

  • Can I control front panel items from a sub VI?

    Hi all,
    After taking the Intermediate I class, I have been trying to follow the methods of using modular programming, but there's one thing I haven't quite figured out how to do. How can I change a front panel display from within a sub VI? I have a menu selection that I wish to change - can I simply input a reference to it or something like that?
    Thanks much,
    Jason

    All you need to do is to pass a control reference to the subvi, and then, in the subvi, to use a property node to modify whatever you want (well, almost...) on your control. Ask if you have more trouble and need an axample...
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Update a front panel indicator from a loop inside a called vi. Without exiting

    I am looking for the best way to update some indicators from within loop within a called .vi.
    I need to update the front panle without exiting the loop.
    I am able to use functional global vi to update the values of front panel indicators from within my nested loops, but I am looking for the best way that these values can be read to update my indicators.
    Thanks

    Or a cluster of references, that way each reference can be named, and can be different types to match the respective indicator.
    There are also methods where you can just send in a VI reference, and in the subVI traverse all the controls and search for the appropriate references by name.
    Take a look at this long nugget.

  • Dialog box problem when controlling front panel remotely

    I have encountered an issue with the Web Publishing Tool- I have a VI that calls a subvi that uses the Promt User for Input function.  When controlling the front panel from another computer I get a message saying that you "Cannot control subVI front panels remotely" and points you to the machine actually running LabView to enter the information in the Prompt User dialog box.  I set the subVI front panel to show when called, which does show the front panel of the subVI, but still get the error related to the dialog box.
    Is there any way to make this work?  Am I missing something obvious?
    Thanks,
    Nathan

    Hi Nathan.
    There are some limitations with dialog boxes in remote applications.  This tutorial has some good examples and explanations on functionality to avoid with web applications.  Additionally, the LabVIEW online Help offers some general guidance for Viewing and Controlling Front Panels Remotely, which may help you in further developing your application.
    Hope that helps!
    Lorielle P.
    Applications Engineer
    National Instruments

  • Selecting front panel properties after runing causes crash

    After I run my program (which uses several call library function nodes to access numerous dll files) and then try to alter the properties of a front panel control labview crashes. Sometimes it simply locks up, other times it displays a recoverable error message, and finally sometimes it displays a hard error message from which I cannot recover and only send an "error report." While the errors are annoying I really want to know why changing the properties causes them which may lead me to other problems in my code. Thanks for any thoughts you can provide.
    -Dave

    NIDave wrote:
    > Thanks for the reply Jeremy, I try to change them manually after the
    > program stops. I use a property node to alter other controls but not
    > the one I discovered the problem on. I am suspecting a memory leak
    > within the dll or some problem with the way I am passing strings and
    > arrays in and out of my call library function nodes. (I initialize
    > the strings and arrays before the function is called, so I am leaning
    > toward an issue in the C code.
    Well here you go. Calling a DLL and then getting (delayed) crashes in
    LabVIEW absolutely always means that the DLL is trashing some memory it
    shouldn't. This either happens by passing wrong data (DLL expects by
    reference and you pass by value) or arrays and string not initialized or
    not intialized to be large enough. Last but not least the DLL of course
    can just simply be buggy and do stupid things.
    So you will have to verify somehow that the DLL works correct outside of
    LabVIEW. If you have verified that, then you need to check all
    parameters of all function calls into the DLL to be correct and also
    large enough for the DLL.
    Especially make sure that for strings you allocate 1 more byte than the
    longest string the DLL may want to write into, and for arrays that you
    allocate the right number of elements of the right type. Sometimes the
    documents state that the array must be at least 100 elements long but if
    this is an integer then that amounts actually to 400 bytes.
    > Also another oddity, when I first open labview and run the code it
    > works great, however if I try to close the VI but not labview then
    > run it again it fails. I think that labview is not dropping the dll.
    > Is there a way to force it to release the dll?
    Not really. A DLL should not depend on being unloaded to be callable
    again. But the error you describe could be because of several reasons.
    Basically make sure you call any existing Close or similar function at
    the end as well as initialization function in the beginning. Also the
    error could be related to the DLL trashing memory somewhere. So try to
    get the DLL to work properly without any bad effects after having it run
    once including no crash when unloading the VI, closing any front panel,
    doing some LabVIEW edit functions or last but not least closing LabVIEW.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Controlling Front Panel LEDs

    This is hopefully a simple problem, but I can't figure out what to search under.  I have a program with two loops (Z Only Test and Full Test in Tester Program v2).  They do not run at the same time.  I would like both loops to interact with an LED on the front panel (Testing).  How is this done?
    Under Z Only Test, it works fine.  I tried to connect it to the sequence (Full Test), but it tells me I can't do that.  On odd sequences, for the most part, I would like to have the LED light (TRUE).  On evens, off.
    Attachments:
    code.zip ‏143 KB

    rbergs wrote:
    Do you mean make the LED a shared variable?  How do you do that?  I clicked on it and changed it to a variable, but I thought that was like one of the others that I have.  I'll give it a try and see what happens.
    I would assume whatever works for this would also work for numerical displays as well.
    No.  I'm not even sure exactly what you mean by clicked on the LED "and changed it to a variable."
    Right now you have only a single place where you use that LED.  It has a terminal node on your block diagram within a while loop.  I don't know how that fits into your overall program architecture as your VI is quite expansive.  (Two tips, 1.  Don't use stacked sequences.  2.  Look into a state machine architecture)
    All that happens at that point is your read from a shared variable called "Testing".  I'm not sure from where else in your VI that you want to interact with that front panel indicator.  Or whether it will conflict with the already written piece of code.   I also don't know where this shared variable is written to. But the first idea is have the other sections of the code write to the shared variable and let this one update the front panel indicator.
    The second idea is to create a local variable of the front panel indicator.  Right click on the terminal within your code and select Create / Local Variable.  But again, you will have to be careful with conflicts with the different portions of your code writing to the LED.  This is also known as a "race condition".
    (Yes you can use either shared variables to store numeric data, or create local variables of numeric controls or indicators.)
    I'm a bit nervous about your code.  It looks like you have a decent amount of LV experience as you have created quite a sophisticated VI there.  However, it doesn't seem like it is easy to expand or modify.  It takes up quite a bit of screen real estate.  It doesn't use any subVI's even though a lot of the code seems to be duplicated or very similar.  And it seems like it uses a lot of shared variables, probably more than necessary.
    Message Edited by Ravens Fan on 05-29-2009 01:38 PM

  • Swipe up to control screen not working from within an app?

    Hi everyone,
    Iphone 4, ios 7.0.6 user.  From the home screen, I can "swipe up" on my iphone to get to a control screen where I can control the music player, turn on/off the flashlight, etc.  I used to be able to swipe up while within an app (for example, while looking at a website on safari) and get to this same screen, however currently it doesn't work when an app is open, only from the home screen.
    Any suggestions to get this working from within an app as well?
    thanks,

    Settings > Control Center > Access Within Apps > Turn switch ON (green side showing)

  • How can I control paper tray selection from within a report?

    Hello everybody
    I need to print out a report (preferably in the PDF format) in which certain pages need a specific paper. I am therefore looking for a way to control the paper tray on per page basis. It seems hard to do even though there must be thousand of people out there with the same need - or please proof me wrong
    I really appreciate any suggestions.
    Regards from Zurich, Switzerland
    Peter Buchmann

    doesn't support it right now. it will figure it out what tray if the paper is a different size but that's about it. you have two options, have two printers or no preprinted stationary. Most companies go with two printers.
    Good luck,
    Ike

  • Controlling page setup properties from JSF page

    Hi there :)
    How to control print properties like size,margins on left,right,top,bottom,header,footer etc in page setup through jsf page?
    Thanks in advance.
    Cheers.

    Not.

  • Is there a way to control Adobe PDF plugin from within a Web Application? For Example, Can we highlight text in the PDF/A document programatically?

    Hi,
    I am trying to open a PDF document in browser using Adobe PDF plug-in for IE 9. The plugin version is 10.x
    I need to highlight certain text in the PDF document ( which is searchable) programmatically. For example, when a user selects certain text on the web-page, we want to automatically highlight that in the PDF document.

    I don't think this is a question one can answer by simply downloading the SDK. And even if one reads all the documentation (it rarely happens for obvious reasons), it is not easy to reach an answer because its explanation is not trivial at all.
    In my own opinion, this is right the type of question to be put and (hopefully) answered in a Forum.
    Now, I am not sure about the correct answer but I will give one hint.
    If I am not wrong, the Internet Explorer, IE, PDF viewer by Adobe is actually a .dll file which is put under IE once Adobe Reader is installed. A custom plug-in for Reader or Acrobat is also a .dll file (Windows) but its extension is .api and it needs to be copied under Reader or Acrobat (or both). Therefore, I don't see how we can merge the IE viewer .dll with a custom plug-in .api. Though maybe technically possible, I don't think it is something we can do.
    If above reasoning is correct, the answer to the question is No.

  • How to control the main timeline from within a symbol?

    I have a small world map as a symbol called "verden" and I want the user to click Europe, Asia, or Africa and jump to named labels in the main timeline.
    http://www.dagbladet.no/grafikk/neshorn/neshorn.html
    On the main timeline a have the label "intro" with a Stop action and the label "europa". At label "europa" I have a symbol also called "europa" which has a display of None at label "intro" and On at the label "europa".
    The animation never goes to label "europa"
    I have this code on europa in the symbol "verden" :
    // insert code for mouse click here
    sym.getComposition().getStage().getSymbol("europa").play("europa");
    The files are on Dropbox here
    Update, now it works:
    sym.getComposition().getStage().play("europa");

    Hi Bill,
    There are plenty of threads on here about scope, but here's one way to create a global variable:
    // code on Stage.compositionReady
    sym.myGlobalVar = 1;
    Then, anywhere in your project, you can check/set that var like so:
    sym.getComposition().getStage().myGlobalVar = 2;
    And here's one way to create a global function:
    // code on Stage.compositionReady
    sym.myGlobalFunction = function(){
              console.log('myGlobalFunction');
    Then, anywhere in your project, you can call that function like so:
    sym.getComposition().getStage().myGlobalFunction();

  • How to open remote front panel of vi's within an executable from an executable.

    How do I remotely open front panels of subvi's contained within an executable, where both computers just have LabVIEW Real Time loaded (programs are run as executables)? I want to use the Method: Remote Panel Open Connection to Server to make this work. I have been getting error 1032 "VI Server Access Denied". I do not want to use the web page method (connection is too slow when controlling front panel objects and I can not programmatically exit out (release control of vi) of the web page).
    Ex. 
    PC1: Has executable1 using Remote Panel Open Connection to Server Method etc. code inside. This program will make a call to executable2 (on PC2) to open up different vi front panels (within executable2), so the controls can be changed from PC1. I want to be able to make changes to the vi's running on PC2 from PC1.
    PC2: Has executable2 containing several subvi's.

    Not sure if this is what you are looking for but here is how to launch executables that can interact
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • Able to interact with a cRIO remote front panel from one computer but not another

    I have a cRIO application that publishes a remote front panel for monitoring and control of the application. From one PC (Win7 & firefox) I can see, interact and control the cRIO through the published remote front panel. From a second PC, also Win7, I can see and monitor the cRIO's state, but the remote panel that is opened does not allow for any interaction and this is true whether I'm using IE, FF or Chrome as the browser. When either PC is connected to the cRIO, it is via a dedicated Ethernet link and only the cRIO and the one PC are on that network. For this two-device private network, the PC is always at address 192.168.1.1 while the cRIO always uses 192.168.84.199 (port 8000).
    The firewall rules on both PCs are setup to allow all incoming and outgoing programs/ports/protocols to be used between these two IP addresses.
    Both PC's have up-to-date LabVIEW development systems installed on them (which more or less guarantees they have the minimum require LV runtime needed to see and use a remote front panel).
    What might be different on the PC that view but cannot interact with the remote panel?
    Solved!
    Go to Solution.

    Sam_Sharp wrote:
    Right click on the second one and select "take control of this VI".
    As far as I am aware - only one viewer of the remote front panel can control the panel at any time - the rest can only view.
    As I tried to say in my original post, there was only one host physically connected to the private network at any given time (by virtue of the fact that the one Ethernet cable connection to the private network was being moved back & forth between the two hosts) so there was no way both hosts could be trying to control the cRIO at the same time. I even went so far at one point of restarting the cRIO while it was connected to the problem host to see if would render it functional, but it did not.
    But I did not know that it was possible to do what you suggested, much less that there was a right-click context menu associated with a remote panel, so I tried it and it worked!    Thank you!

  • Controlling printer formatting from within program

    Hi Experts,
    I have a requirement in which the user wants to that the printer's default setting of format 'X_65_1024'  should be changed to 'X_65_255' in case of if he executes this perticular report.
    The output of the report is ALV list display.
    Is it possible to control printer's setting from within the program?
    I serached and found two FMs.
    'SET_PRINT_PARAMETERS' and 'GET_PRINT_PARAMETERS' .
    But I am unable to understand how to use these FMs.
    Is there any other way to achieve this?
    Any pointers to resolve this issue would be very helpful.

    Hi,
    look here:
    http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dba56d35c111d1829f0000e829fbfe/content.htm
    All Print Parameters are described.
    And a little code example:
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
        EXPORTING
          destination    = lv_pdest
          copies         = lv_count
          list_name      = lv_lnam
          list_text      = lv_prtxt
          immediately    = lv_flg_prn
          release        = ' '
          new_list_id    = 'X'
          expiration     = lv_days
          line_size      = 255
          line_count     = 65
          layout         = 'X_65_255'
          sap_cover_page = ' '
          cover_page     = ' '
          receiver       = lv_prrec
          department     = lv_prabt
          no_dialog      = 'X'
        IMPORTING
          out_parameters = ls_params
          valid          = lv_valid.
      IF lv_valid <> space.
        NEW-PAGE PRINT ON
          PARAMETERS ls_params NEW-SECTION NO DIALOG.
    ENDIF.
    Hope it helps.
    Regards,
    David

  • VI Analyzer Front Panel Size and Postion Test fails

    Hi
    We make a lot of use of the VI Analyser and I have been playing with the configuration settings to try and make it only fail the tests that matter to us and I have one test I do not understand correctly.
    From the LabVIEW help
    Panel Size and Position—Checks that a front panel
    completely resides within the bounds of the screen. The test also checks whether
    the front panel is larger than the maximum specified width and height. If you
    are using a multi-monitor system, the test fails if the panel does not reside
    entirely within the bounds of the primary monitor. This test works only on
    standard, control, and global VIs.
    I would like to apply this test, a simple check developers are not creating huge VI, it sounds simple enough, but I cannot seem to get this test to pass.
    I am working with two monitors and this test fails when my VI is on either monitor with the message  "This VI's front panel does not reside entirely within the specified bounds (1280 x 1024)" my current screen resolutionis 1280 x 1024, so I assume as long as my VI front panel fits within one screen it should be a pass.
    I can clearly see my that VI front panel (and block diagram for that matter) fits within the screen of either monitor. If I look at the VI properties of my VI the Window Size is 474 x 513, could anybody please suggest when why this might be failing.
    cheers 
    Dannyt
    Danny Thomson CLAD
    Sub10 Systems Ltd
    Solved!
    Go to Solution.

    Hi Norbert,
    Thanks for the prompt reply, my asking the question and your reply has made me play with this a little deeper and I have managed to solve my problem.
    In case anyone else has a similar problem here are the details.
    When you have two monitors and look at the Windows properites you see one monitor is identified as 1 and the other as 2, thses identities are based on the graphics card and the which monitor is plugged into which ouptput connector. You can then chose which monitor you wish to act as your primary monitor. You would suspect it would not matter once you have selected your primary monitor BUT IT DOES.
    My inital set-up   
    Left Hand Monitor    - idenity 2 selected to be primary monitor
    Right Hand Monitor - identiy 1 
    With this set-up everything looks and acts as I expect it to task bar, icons etc on my primarry monitor.  However if you run the VI Analyser it will fail Panel Size and Position on BOTH the left and right hand monitors.
    I crawlled under my desk and swapped the monitors cables round so now the set-up is
    Left Hand Monitor    - idenity 1 selected to be primary monitor
    Right Hand Monitor - identiy 2
    Now the VI Analysers Panel Size & Position Tests will pass on the left hand monitor but fail on the right hand monitor, just as would expect.
    It appears that LabVIEW is looking not only at the windows "Primary Monitor" setting but also the identies, this does not seem the behaviour I would expect nor the correct behaviour.
    cheers 
    Dannyt
    Danny Thomson CLAD
    Sub10 Systems Ltd

Maybe you are looking for

  • How to change existing terminals from "view as icon" to view as data type through program

    I got some legacy LabVIEW code from other people. And there are tons of existing terminals displayed as icon. Is there any way to do batch process to change all of them to view as data type? Thanks a lot! Solved! Go to Solution.

  • FI-SD integration

    Hi all of you, We have done account determination for SD. Accounting documents are also generating, but with in the invoice accounting document, number of line items are generating for each item with in the sales order, standard invoice type F2 like

  • How do I add different cookies to youtube and hotmail?

    Actually this is really simple: When I enter hotmail.com, I save my setting to enter automatically And when I open Youtube, it enters my account automatically, but my Youtube email and my Hotmail e-mail are different. Can I add a cookie to Youtube an

  • Change location of the iphone upgrade files

    My PC's C: drive has limited disk space, as I use it only for operating system. But when I tried to upgrade the firmawre of my iphone 3G to version 2.0.2, the iTune download more than 240 MB data into my C: drive, and left only about 150 MB free spac

  • Cisco WLC username/mac address

    Hi Im are having problems with editing the User Field in the WCS. The purpose was to enable the ease to identify clients on the wireless network through their names rather than through MAC addresses which are currently the only method of authenticati