Updating Tab Control programmatically from within StateChart

I would like to update a tab control, visible page, based on the current state, using the StateChart Module.  I first tried creating a reference to the tab control and passing that to a property node within the state in the statechart.  However when I drop the reference in the state it pulls every control associated with the tab control into the state, no good.  I tried with a property node with same results.  My next thought was to use a shared variable, but I dont believe that I can have a shared variable with enum data type.  Anyone have a solution for this problem?  It seems like someone else must have encountered the same issue at some point.  Any thoughts will be appreciated.
Cheers!
CLA, CLED, CTD,CPI, LabVIEW Champion
Platinum Alliance Partner
Senior Engineer
Using LV 2013, 2012
Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.

The example uses the StateChart module, if you have the statechart module it is probably easier for you to try and replicate, just create a state in the statechart and place a tab control on the front panel of the vi that calls the statechart, and then create a reference to the tab and place it in the state of the statechart.  I will go ahead and make a quick example, but be warned that without the statechart module you wont be able to open it.
I apologize for the zipped folder, I needed to attach more than 3 files.
Message Edited by jmcbee on 05-15-2008 10:16 AM
CLA, CLED, CTD,CPI, LabVIEW Champion
Platinum Alliance Partner
Senior Engineer
Using LV 2013, 2012
Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
Attachments:
SC Test.zip ‏175 KB

Similar Messages

  • Controlling iTunes from within Keynote 2?

    Is it possible to control iTunes from within Keynote, when I'm using the presentation tools? I haven't been able to make it work, and it is an essential part of being able to use Keynote in my lectures. It would be nice to switch from Powerpoint.
    Right now, I'm using Synergy to control iTunes, and PPT lets me do it, but control keys/functions seem to be locked out in Keynote. Am I missing something?
    Thanks for any help,
    Geoff

    Games often hardwire their keyboard functions into the code which means you can't change them,and they override your own settings.
    The best option I can suggest is playing Urban Terror from a new user account on your Mac, in which you remove all Dashboard widgets and add the iTunes widget. A quick click of your mouse scroll wheel while playing Urban Terror will bring up Dashboard (you may have to set this in advance) and while that is not quite "ingame" it is as near as you will get... unless someone else has a better idea.
    (I am assuming that you don't want to use Command-tab to switch to iTunes itself while you are playing?)

  • HT4623 The 'software update' tab is missing from the General menu. How do I get it reinstalled?

    Software Update tab is missing from General settings. How do I fix this.  I NEED TO LOAD NEW new a new iOS

    If you have an iPad 1, the max iOS is 5.1.1. For newer iPads, the current iOS is 6.1.3. The Settings>General>Software Update only appears if you have iOS 5.0 or higher currently installed.
    iOS 5: Updating your device to iOS 5 or Later
    http://support.apple.com/kb/HT4972
    How to install iOS 6
    http://www.macworld.com/article/2010061/hands-on-with-ios-6-installation.html
    iOS: How to update your iPhone, iPad, or iPod touch
    http://support.apple.com/kb/HT4623
    If you are currently running an iOS lower than 5.0, connect the iPad to the computer, open iTunes. Then select the iPad under the Devices heading on the left, click on the Summary tab and then click on Check for Update.
    Tip - If connected to your computer, you may need to disable your firewall and anitvirus software temporarily.  Then download and install the iOS update. Be sure and backup your iPad before the iOS update. After you update an iPad (except iPad 1) to iOS 6.x, the next update can be installed via wifi (i.e., not connected to your computer).
    Tip 2 - If you're updating via wifi, place your iPad close to your router to preclude getting a corrupted download.
     Cheers, Tom

  • Change the pages of a TAB control programmatically

    How can I change the pages of a TAB control programmatically, but not by pushing the tabs in Front Panel when program runs?

    100% correct, Thanks
    Matthew Fitzsimons
    Certified LabVIEW Architect
    LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison

  • How many ways can I update a control programmat​ically???

    1. local (or global) variables
    2. property nodes.
    3.
    I'd like to know if there are more possibilities especially when a control is used. we can always right a value into an indicator when an indicator is used.

    Ok, so the CLD could be a moving target. I posted these question in an email and now awaiting an answer.
    What are the criteria used to grade the CLD exam? What are the specific finding and recommendations used when determining a grade?
    In two instances of taking the CLD the graders comments are shown below.
    After a comparison of the two cases, here are my comments. “Property nodes and local variable are not to be used”. I’ve posted a question asking what other ways are there to programmatically update a control. “Unnecessary bends in wires are not to be used”. What criteria determine when a wire bend is unnecessary? Should all wires not have bends thus bends in wires are not allowed? “Errors not handled….error terminal on property node not wired”.  As I read the exam requirements, I did not come across a case to handle an error in any step. Simply connecting an error terminal and providing a case doesn’t handle errors. I’m almost certain my code in Case2 does not generate programmatic errors. “NOT gate used rather than inverted input where available”. Are you saying NOT gates are not be used, is there some advantage? Maybe I was able reuse duplicate code in Case2 and in one of the cases the NOT gate was appropriate since is read well on a block diagram and the change was effortless.
    Case1:
    Style: Overly complex solution. Property Nodes used to update values. Unnecessary bends in wires. Error terminals on property nodes unwired. Errors not handled.
    Functionality: Application not fully implemented. Logic of implementation is not correct. Boolean latch action is not implemented where necessary.
    Documentation:
    Case2:
    Style: VI is not modular – repeated code is not placed in SubVIs. Use of local or global variables. Unnecessary bends in wires. NOT gate used rather then inverted input where available. Errors not handled.
    Functionality: Application does not function as specified.
    I have no idea what NI is looking for as far as “Style”. Lets define this and have a point system in place for determining “Style”. What “Style” allocates 15 points in the CLD exam?

  • How can I lock a tab control untill fuction within tab is complete?

    Hi
    I am a little stumpt.  What I would like to do is to lock a Tab control until the fuction within the tab is complete (and have a dialogue box saying something like "fuction 1 must stop before you can run function 2").
    I realise some event based programming would have been best but I wonder if there is a quicker fix as the code I produced is quite complex now. 
    I attach an example (tab control and two case stuctures) to clarify what I need to do.
    I know there is probably a really simple answer so sorry to be so dim.
    Many thanks
    Ash
    Attachments:
    Example.vi ‏13 KB

    I'm still of the opinion that you need to disable the tab control. It's quite hard to give advice without knowing the background. Ok, I know what you want to accomplish, but I don't know how it fits in the rest of your app.
    Ha look at the "wizard" template which could be another solution for you. 
    Using LV8.0
    Don't be afraid to rate a good answer...
    Attachments:
    LV_Wizard_Dialog.vit ‏120 KB

  • Connecting my iPod to my Car's 30-pin Dock but Being Able to Control It from Within the iPod?

    I have a 5th Generation iPod nano. I own a 2008 VW Eos which has a 30-pin dock. It functions but, my car's UI for iPod is nefastous. I wanted to know if there was a way to control the music within the iPod.

    Not using the dock connection.  That is for data, and your car audio system is "in charge" of playing the songs.  However, if the car audio system has an auxiliary audio input that is a standard mini-stereo jack (looks like headphones jack), you can connect the iPod there using a commonly available cable, like this
    http://www.amazon.com/Monster-iCable-Auxiliary-Discontinued-Manufacturer/dp/B002 AR5XIK
    Then, play your iPod through the car's speakers.

  • Is it possible to print a waveform graph programmatically from within Labview 7.1.1 Base Edition?

    I would like to be able to print the results of a test from a Waveform Graph programmatically in a Labview 7.1.1 vi.

    Hi
    There is a way of doing it.
    1. Create a sub-vi that will act as your report page.
    2. You can then populate the Front Panel of this sub-vi with all the controls and decorations that you want to print. Make it look like a report page. The controls will need to attached to the connector pane so that you can pass the data into the sub-vi from you main vi for printing.
    3. In the sub-vi, Go to File->Properties->Print Options and make sure that you check Automatically Print Front Panel every time VI completes execution.
    4. Modify your Main VI so that it calls the  "Print Report" sub vi that you have just created on demand e.g. in response to clicking a button.
    5. Remember to include the Front Panel if you build this into an application using app builder. The builder will normally strip front panels from sub vi's.
    Hope that helps
    David
    Message Edited by David Crawford on 11-25-2005 02:44 AM
    Attachments:
    Print Options.jpg ‏30 KB

  • How can I access the control lines of a PCI-1422 from within C++?

    I would like to know how the control lines of a PCI-1422 can be accessed (set) programmatically from within C++ (MS VC++7, Windows XP). A flat panel sensor connected to the PCI-1422 needs the control lines to switch on features like binning which I want to use.
    Unfortunately I was unable to identify an appropriate command in the IMAQ documentation. Does anyone have experiences with this?
    Thank you very much in advance!

    Kluas,
    The control lines are not exposed through any API. The control lines are run by the driver based on the instructions in the camera files. If the cammera file supports the binning functionality of your camera then you should be able to set the attributes such that the board runs the control lines approriately.
    Hope this helps,
    Amaury
    NI Applications Engineer

  • Tab Control - change page name and color

    a)
    Is there any possibility to
    change the names of pages in a Tab Control programmatically?
    (I want to change the names in a runtime version depending on the user
    selected language. Therefore I can't use the Import Strings function.)
    b)
    Is it possible to change the colors of a Tab Control ?
    Robert
    (using LV6.02 on WinNT)

    Hello,
    If you use the property "Independant Label" of the tab, you can change the TabCaption.
    You cannot use blank names.
    See attached file. It was written with LabVIEW 6.1 and converted back to 6.0.
    Attachments:
    Change_Tab_Page_Name.vi ‏15 KB

  • FieldPoint WEB Remote Panel Tab Control

    Using a TAB control on Fieldpoint (FP 2000) and Labview 7.1
    I wanted to implement a password feature mainly for the Web browser
    remote panel feature for my Filedpoint application, as suggested in "Developing Remote Front Panel LabVIEW Applications"
    http://zone.ni.com/devzone/conceptd.nsf/2d17d611efb58b22862567a9006ffe76/e789515b9976253786256b1f007e039b?OpenDocument#5
    (see bottom of the page)
    "Alternatively, you can program security into the VI itself. For
    example, you can require a user to log in when the VI first runs, and
    disable all other aspects of the VI until you verify the login. To do
    so, place a login field on one page of a tab control, the other
    controls on subsequent pages, and enable the other pages after the user
    successfully logs in.
    I find that I can "Hide tabs" using the "Page Selector Visible" feature
    if the Remote panel is hosted by Labview in Development Mode but this
    feature does function with the Web remote panel mode. In fact you can
    use the Tab Control normally from the Web remote panel.
    I find that I can disable a specific tab if the Remote panel is hosted by Labview in Development Mode but this feature is ignored by the Web remote panel mode.
    Thus: -
      Do you know of any limitations (a list would be usefull, if there are specific limitations)?
      If its a limitation, is it of FieldPoint or the Web remote panel or the Runtime Engine installed in the Browser or ...?
      Do you know of a better way of getting a password feature.
        ( I am aware of IP security available - the IP
    addresses are DHCP supplied - " 'Doh' says Homer Simpson", the P.C's
    will change as well)
    I lookforward to any insights..., wisdom or experiences you may have had

    This discussion covers some restrictions placed by LabVIEW-RT:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=133674#M133674
    Regards,
    -Khalid

  • 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.

  • Identifying selected tabs within tab control

    I'm looking for a way to determine which tab is selected within the CVI tab control. The index is available, but the index isn't that helpful if the tabs aren't always in the same order. The Constant Name is used to identify controls on the tab page, but it doesn't look like there is a function to find the actual tab ID.
    I was thinking that a work-around is to programmatically add the panels to the tab control and track the IDs against the index in a table.
    The header file that is generated from the UIR only refers to the Constant Name as part of the #define associated with the controls.
    Any ideas ?

    It's true that you can use the label text and discover the active panel by means of a series of comparisons between strings, but it seems to me not the best way to go and surely not the fastest. The same consideration applies to ATTR_CONSTANT_NAME (the panel attributes which returns the text of the constant name, e.g. "MyPanel"). Moreover, this last solution leads to these additional critical points
    1. If you load a panel more than once, this approach doesn't give you a unique solution
    2. On the other side, supposing you can retrieve the value associated to the constant name, this value is unique only if all tab panel are defined in the same UIR file, otherwise their IDs could overlap
    In my opinion your solution of programmatically load panels and save panel handles in a array is the only possible way to go, since only panel handles are unique throughout the whole application.
    BTW, in the header file associated with the UIR panel constant names are listed too: in every group of #defines that refer to a panel and its controls, the very first is the panel constant name with its associated value (used in LoadPanel).
    Message Edited by Roberto Bozzolo on 01-05-2007 12:15 AM
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Event Structure: update the structure with a tab control

    Hi!
    I want to be able to update the code contained within an event structure by a tab control value change, in addition to the usual bool controller in the UI. 
    The problem is that the event structure don't seem to run when the bool has a value change for the tab control. I have made a short .vi to demonstrate. A counter is placed in the Event structure so it is possible to see if it is running or not. 
    Any ideas?
    Best regards
    Is my avatar the dog from the fraggle rock?
    Attachments:
    forum_question.vi ‏12 KB

    Here is a version of your code using a Value Signaling property node.
    I "think" it does what you want ...
    steve
    Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
    question. Give "Kudos" to replies that help.
    Attachments:
    forum_question_mod 2009.vi ‏15 KB

  • WPF UI running in seperate runspace - able to set/get controls via synchronized hash table, but referencing the control via the hash table from within an event handler causes both runspaces to hang.

    I am trying to build a proof of concept where a WPF form is hosted in a seperate runspace and updates are handled from the primary shell/runspace. I have had some success thanks to a great article by Boe Prox, but I am having an issue I wanted to open up
    to see if anyone had a suggestion.
    My goals are as follows:
    1.) Set control properties from the primary runspace (Completed)
    2.) Get control properties from the primary runspace (Completed)
    3.) Respond to WPF form events in the UI runspace from the primary runspace (Kind of broken).
    I have the ability to read/write values to the form, but I am having difficulty with events. Specifically, I can fire and handle events, but the minute I try to reference the $SyncHash from within the event it appears to cause a blocking condition hanging both
    runspaces. As a result, I am unable to update the form based on an event being fired by a control.
    In the example below, the form is loaded and the following steps occur:
    1.) Update-Combobox is called and it populates the combobox with a list of service names and selects the first item.
    2.) update-textbox is called and sets the Text property of the textbox.
    3.) The Text value of the textbox is read by the function read-textbox and output using write-host.
    4.) An event handle is registered for the SelectionChanged event for the combobox to call the update-textbox function used earlier.
    5.) If you change the selection on the combobox, the shell and UI hangs as soon as $SyncHash is referenced. I suspect this is causing some sort of blocking condition from multiple threads trying to access the synchronized nature of the hash table, but I am
    unsure as to why / how to work around it. If you comment out the line "$SyncHash.TXT_Output.Dispatcher.Invoke("Send",[action]{$SyncHash.TXT_Output.Text = $Value})" within update-textbox the event handler will execute/complete.
    $UI_JobScript =
    try{
    Function New-Form ([XML]$XAML_Form){
    $XML_Node_Reader=(New-Object System.Xml.XmlNodeReader $XAML_Form)
    [Windows.Markup.XamlReader]::Load($XML_Node_Reader)
    try{
    Add-Type –AssemblyName PresentationFramework
    Add-Type –AssemblyName PresentationCore
    Add-Type –AssemblyName WindowsBase
    catch{
    Throw "Unable to load the requisite Windows Presentation Foundation assemblies. Please verify that the .NET Framework 3.5 Service Pack 1 or later is installed on this system."
    $Form = New-Form -XAML_Form $SyncHash.XAML_Form
    $SyncHash.Form = $Form
    $SyncHash.CMB_Services = $SyncHash.Form.FindName("CMB_Services")
    $SyncHash.TXT_Output = $SyncHash.Form.FindName("TXT_Output")
    $SyncHash.Form.ShowDialog() | Out-Null
    $SyncHash.Error = $Error
    catch{
    write-host $_.Exception.Message
    #End UI_JobScript
    #Begin Main
    add-type -AssemblyName WindowsBase
    [XML]$XAML_Form = @"
    <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Window.Resources>
    <DataTemplate x:Key="DTMPL_Name">
    <TextBlock Text="{Binding Path=Name}" />
    </DataTemplate>
    </Window.Resources>
    <DockPanel LastChildFill="True">
    <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
    <Label Name="LBL_Services" Content="Services:" />
    <ComboBox Name="CMB_Services" ItemTemplate="{StaticResource DTMPL_Name}"/>
    </StackPanel>
    <TextBox Name="TXT_Output"/>
    </DockPanel>
    </Window>
    $SyncHash = [hashtable]::Synchronized(@{})
    $SyncHash.Add("XAML_Form",$XAML_Form)
    $SyncHash.Add("InitialScript", $InitialScript)
    $Normal = [System.Windows.Threading.DispatcherPriority]::Normal
    $UI_Runspace =[RunspaceFactory]::CreateRunspace()
    $UI_Runspace.ApartmentState = [System.Threading.ApartmentState]::STA
    $UI_Runspace.ThreadOptions = [System.Management.Automation.Runspaces.PSThreadOptions]::ReuseThread
    $UI_Runspace.Open()
    $UI_Runspace.SessionStateProxy.SetVariable("SyncHash",$SyncHash)
    $UI_Pipeline = [PowerShell]::Create()
    $UI_Pipeline.Runspace=$UI_Runspace
    $UI_Pipeline.AddScript($UI_JobScript) | out-Null
    $Job = $UI_Pipeline.BeginInvoke()
    $SyncHash.ServiceList = get-service | select name, status | Sort-Object -Property Name
    Function Update-Combobox{
    write-host "`nBegin Update-Combobox [$(get-date)]"
    $SyncHash.CMB_Services.Dispatcher.Invoke($Normal,[action]{$SyncHash.CMB_Services.ItemsSource = $SyncHash.ServiceList})
    $SyncHash.CMB_Services.Dispatcher.Invoke($Normal,[action]{$SyncHash.CMB_Services.SelectedIndex = 0})
    write-host "`End Update-Combobox [$(get-date)]"
    Function Update-Textbox([string]$Value){
    write-host "`nBegin Update-Textbox [$(get-date)]"
    $SyncHash.TXT_Output.Dispatcher.Invoke("Send",[action]{$SyncHash.TXT_Output.Text = $Value})
    write-host "End Update-Textbox [$(get-date)]"
    Function Read-Textbox(){
    write-host "`nBegin Read-Textbox [$(get-date)]"
    $SyncHash.TXT_Output.Dispatcher.Invoke($Normal,[action]{$Global:Return = $SyncHash.TXT_Output.Text})
    $Global:Return
    remove-variable -Name Return -scope Global
    write-host "End Read-Textbox [$(get-date)]"
    #Give the form some time to load in the other runspace
    $MaxWaitCycles = 5
    while (($SyncHash.Form.IsInitialized -eq $Null)-and ($MaxWaitCycles -gt 0)){
    Start-Sleep -Milliseconds 200
    $MaxWaitCycles--
    Update-ComboBox
    Update-Textbox -Value $("Initial Load: $(get-date)")
    Write-Host "Value Read From Textbox: $(Read-TextBox)"
    Register-ObjectEvent -InputObject $SyncHash.CMB_Services -EventName SelectionChanged -SourceIdentifier "CMB_Services.SelectionChanged" -action {Update-Textbox -Value $("From Selection Changed Event: $(get-date)")}

    Thanks again for the responses. This may not be possible, but I thought I would throw it out there. I appreciate your help in looking into this.
    To clarify the "Respond to control events in the main runspace"... I'm would like to have an event generated by a form object in the UI runspace (ex: combo box selectionchanged event) trigger a delegate within the main runspace and have that delegate in
    the main runspace update the form in the UI runspace.
    ex:
    1.) User changes selection on combo box generating form event
    2.) Event calls delegate (which I have gotten to work)
    3.) Delegate does some basic processing (works)
    4.) Delegate attempts to update form in UI runspace (hangs)
    As to the delegates / which runspace they are running in. I see the $synchash variable if I run get-var within a delegate, but I do not see the $Form variable so I am assuming that they are in the main runspace. Do you agree with that assumption?

Maybe you are looking for

  • Why doesn't the App Store have a Google Talk client FROM Google?

    An IM client without push notifications isn't an IM client. I don't know why a person wouldn't just use email as opposed to a Safari-based IM client on a device that can't run Safari+anything (or when the device is idle). Web-based Google Talk is poi

  • Constant wait cursor when editing with LVOOP

    I've searched around several times for any mention of this problem but have never found anything. It continues to drive me crazy so I figure I'd ask about it. I have a decently sized project utilizing about 25 LVOOP classes in the hierarchy. Whenever

  • How to make the name of a column apear as many times as the column on page

    Hi, This is what i want to do: I have a basic report looking like this: <Column name> value 1 value 2 value 3 value n Since the column is small it can fit in a page more then one time. I know how to make it print more then once: i switch the repeatin

  • Get.Text(), set.Text(); problems

    hi i'm new to the site, ummmmm...leme get to the point, i'm making this program that involves methods, file creation and applets, and i've stumbled accross some problems when i run the program.... import java.applet.*; import java.awt.*; import java.

  • How can I merge my adobe account with my wife's account.

    How can I merge my adobe account with my wife's account. I had been using lightroom since 2011 up to version 4. I wanted to upgrade to version 5 and decided to just go with the Photographers package and I signed up for that. Now I have a conflict sin