Pass data between Tab Control Pages

I’d like to initiate a serial VISA session in the first page of a Tab Control to use the VISA Serial Configure.VI outputs (Visa resource name and Error cluster) in other pages or outside the tab control.
So, how can I pass those references outside the page? I used local variables, but it doesn't seem the best way to do this because I need to create several variables to capture the reference in each page of the tab control...
I created a sub-VI to initialize the VISA session, but in this case it always starts a new session every time I use the sub-VI….
Thanks in advance!
Klein
=====================================
Block Diagrams (LabVIEW 8)
Message Edited by Klein on 04-03-2007 12:56 PM
Attachments:
TabControl.vi ‏37 KB
TabControl - Page1.jpg ‏94 KB
TabControl - Page2-3.jpg ‏165 KB

There's no reason at all to wire the tab control to a case statement. Since you have the read and write Booleans and they can't be clicked until the user changes tab pages, no code for the tab is necessary.With the Booleans for write and read, you should just have an event structure for those. You could initialize the serial port outside the main while loop and just pass the resource name in. Of course, if you wanted a tab for the init funciton, you could do that to but put a Boolean on that page to execute it. The only time you need to wire the tab control to a case statement is if you want to run some code immediately when the page is clicked.
Attachments:
Tab_Example.vi ‏45 KB

Similar Messages

  • Are indicators updated on an inactive tab control page

    To decrease loop execution speed (increase acquisition speed) I have placed diagnostic displays on a seperate tab control page which is normally not the active page.  The thought is that speed will be increased as these displays would not be updated unless needed (screen I/O is normally time consumming).
    Is this a viable method?
    Roy

    It is not that those controls will not be updated, but the drawing of
    those controls on the screen that you save. This can definitely be very
    significant. It is also good programming praxis to hide unnecesary
    front panel elements.
    Also keep in mind that the eye can only handle 10-20 updates a second,
    and even that is for most controls much too fast. Lowering the
    indicator update rate to, say, 5-10 times a second, can  already
    achieve  major CPU relief. depending on the kind of interfacing I
    would go to much slower updates still.  If you use big data sets,
    you should also try to prevent creating too many copies in memory.

  • Best method for passing data between nested components

    I have a fairly good sized Flex application (if it was
    stuffed all into one file--which it used to be--it would be about
    3-4k lines of code). I have since started breaking it up into
    components and abstracting logic to make it easier to write,
    manage, and develop.
    The biggest thing that I'm running into is figuring out a way
    to pass data between components. Now, I know how to write and use
    custom events, so that you dispatch events up the chain of
    components, but it seems like that only works one way (bottom-up).
    I also know how to make public variables/functions inside the
    component and then the caller can just assign that variable or call
    that function.
    Let's say that I have the following chain of components:
    Component A
    --Component B
    -- -- Component C
    -- -- -- Component D
    What is the best way to pass data between A and D (in both
    directions)?
    If I use an event to pass from D to A, it seems as though I
    have to write event code in each of the components and do the
    bubbling up manually. What I'm really stuck on though, is how to
    get data from A to D.
    I have a remote object in Component A that goes out and gets
    some data from the server, and most all of the other components all
    rely on whatever was returned -- so what is the best way to be able
    to "share" data between all components? I don't want to have to
    pass a variable through B and C just so that D can get it, but I
    also don't want to make D go and request the information itself. B
    and C might not need the data, so it seems stupid to have to make
    it be aware of it.
    Any ideas? I hope that my explanation is clear enough...
    Thanks.
    -Jake

    Peter (or anyone else)...
    To take this example to the next (albeit parallel) level, how
    would you go about creating a class that will let you just
    capture/dispatch local data changes? Following along my original
    example (Components A-D),let's say that we have this component
    architecture:
    Component A
    --Component B
    -- -- Component C
    -- -- -- Component D
    -- -- Component E
    -- -- Comonnent F
    How would we go about creating a dispatch scheme for getting
    data between Component C and E/F? Maybe in Component C the user
    picks a username from a combo box. That selection will drive some
    changes in Component E (like triggering a new screen to appear
    based on the user). There are no remote methods at play with this
    example, just a simple update of a username that's all contained
    within the Flex app.
    I tried mimicking the technique that we used for the
    RemoteObject methods, but things are a bit different this time
    around because we're not making a trip to the server. I just want
    to be able to register Component E to listen for an event that
    would indicate that some data has changed.
    Now, once again, I know that I can bubble that information up
    to A and then back down to E, but that's sloppy... There has to be
    a similar approach to broadcasting events across the entire
    application, right?
    Here's what I started to come up with so far:
    [Event(name="selectUsername", type="CustomEvent")]
    public class LocalData extends EventDispatcher
    private static var _self:LocalData;
    // Constructor
    public function LocalData() {
    // ?? does anything go here ??
    // Returns the singleton instance of this class.
    public static function getInstance():LocalData {
    if( _self == null ) {
    _self = new LocalData();
    return _self;
    // public method that can be called to dispatch the event.
    public static function selectUsername(userObj:Object):void {
    dispatchEvent(new CustomEvent(userObj, "selectUsername"));
    Then, in the component that wants to dispatch the event, we
    do this:
    LocalData.selectUsername([some object]);
    And in the component that wants to listen for the event:
    LocalData.getInstance().addEventListener("selectUsername",
    selectUsername_Result);
    public function selectUsername_Result(e:CustomEvent):void {
    // handle results here
    The problem with this is that when I go to compile it, it
    doesn't like my use of "dispatchEvent" inside that public static
    method. Tells me, "Call to possibly undefined method
    "dispatchEvent". Huh? Why would it be undefined?
    Does it make sense with where I'm going?
    Any help is greatly appreciated.
    Thanks!
    -Jacob

  • Performace tuning: how to pass data between different batch job programs?

    Hi everyone,
        now i have one problem about performance tuning using threading in SAP programs: split one big program into two programs - one is main program and the other is sub program. using batch jobs, we can submit multi jobs of sub program at the same time.
        does anybody know how to pass data between different batch jobs? I don't want to use temp files. can ABAP memory can implement this?
        thanks!

    Wei,
    Yes we can transfer the data by using
    SAP Memory OR ABAP Memory.
    Ex:  V_count TYPE i.
      V_count = 100.
    LOOP AT  itab.
    IF v_count EQ 25.
    Here For every batch job
      EXPORT data TO MEMORY ID 'ABC'
       Function module
        JOB_OPEN
       JOB_SUBMIT
       JOB_CLOSE.
      ENDIF.
    ENDLOOP .
    IN your 2nd program.
    INITIALIZATION.
    IMPORT data FROM MEMORY IF 'ABC'.
    FREE memory if .---When you free the memory you will get recent data.
    Don't forget to reward if useful.

  • SAP threading-how to pass data between different batch job programs?

    Hi everyone,
        now i have one problem about performance tuning using threading in SAP programs: split one big program into two programs - one is main program and the other is sub program. using batch jobs, we can submit multi jobs of sub program at the same time.
        does anybody know how to pass data between different batch jobs? I don't want to use temp files. can ABAP memory can implement this?
        thanks!

    Passing Data Between Programs
    [http://help.sap.com/saphelp_47x200/helpdata/en/9f/db9df735c111d1829f0000e829fbfe/frameset.htm|http://help.sap.com/saphelp_47x200/helpdata/en/9f/db9df735c111d1829f0000e829fbfe/frameset.htm]

  • How do i set tab control page size programmatically?

    Hi,
    I have a tab control in my program and each page has different amounts of controls on it. I would like to know how I can make the tab control pages resize automatically, only to fit the controls on the page and not have extra space underneath that other pages require.

    romulus wrote in message news:<[email protected]>...
    > Hi,
    >
    > I have a tab control in my program and each page has different amounts
    > of controls on it. I would like to know how I can make the tab control
    > pages resize automatically, only to fit the controls on the page and
    > not have extra space underneath that other pages require.
    You can use the tab control property 'PaneDimension' to
    programatically change the size of the tab control. To
    programatically find the areas occupied by the controls on each page:
    Use the 'Pages' property of the tab control to get a reference to the
    desired page; wire that to a property node and select the
    'ControlsOnPage[]' property; iterate through all the control
    refere
    nces, getting the position and bounds of each control, using
    'Max & Min' and shift registers to find the extent occupied by the
    controls.
    Paul Cardinale

  • Pass data between InfoPath forms in SharePoint

    Hello!
    Maybe someone has ideas about the next issue: how to make pass data between InfoPath forms in SharePoint, like it is shown in a video: https://www.youtube.com/watch?v=-nGl-Se2cOQ
    I've read similar topics, but still can't find solution.
    Thank you.

    When you go to modify the submit connection, you can specify whether or not to overwrite, as well as a default title value. If you use the now() function in the title, it should never have the same name.
    Andy Wessendorf SharePoint Developer II | Rackspace [email protected]

  • Cannot drag an indicator off a tab control page

    I inherit this VI and try to change certain controls in the tab control pages. But the controls are locked together, every time I select an item on the control, everything is selected. And when I make a new string indicator and drop onto the page, I cannot select or delete it. also when I use the arrow down key to move a control onto the tab control page, it does not have a normal shadowed effect to indicate that it's a floating control.
    The tab control is in the attachment.
    Attachments:
    Untitled 2.vi ‏22 KB

    Click on the control, then click on the Reorder button in the toolbar (should be the far right) then click Ungroup.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • Array of Tab Control page names

    Hi,
    I wish to programatically create an array of the names of the pages within a Tab Control.
    See the attached VI for my attempt at this.
    It works, but as it runs it changes which page is displayed on the front panel.
    Is there a way to do this without changing the page displayed on the front panel?
    Cheers,
    Dan
    Dan
    CLD
    Solved!
    Go to Solution.
    Attachments:
    array of tab control page names.vi ‏9 KB

    Hi,
    Take a look at the attachment.
    Hope it helps,
    Paulo
    Attachments:
    array of tab control page names2.vi ‏10 KB

  • How to  pass data between JDialog and its parent window ?

    Hi,
    I am new to swing. I want to know how pass data between a JDialog and its parent window.
    If you have any information please reply with example code.
    Thank You

    hi Encephalopathic ,
    I was looking for something like as it was given in the link provided by you.
    Thank you for reply It really helped me.

  • How to pass data between components?

    Hi everyone,
    How can I pass data between components? If possible, please
    give me sample code. Thanks.
    Note: I am using Flex 3.
    May

    There are lots of examples in the doc. You can start here:
    http://livedocs.adobe.com/flex/3/html/mxmlcomponents_advanced_1.html
    Stephen

  • Tab control page

    Dear all:
    I want to change Tab Control "page captin" name by program control ,but I don't find any property node about this.
    Please help me!
    Like this picture.
    Solved!
    Go to Solution.

    Hi 新手一號
    see this link
    http://forums.ni.com/ni/board/message?board.id=170&message.id=16404&query.id=305842#M16404
    Mike

  • SapErrorMessage=Inconsistent IDocs passed: Data records or control records

    Dear Friends
    I am not a basis guy but am doing that work, since we don't have any basis admin in our company. One of our clients using our server in the lab is doing some testing of sending IDOCs from one server to another and are getting the following error message
    SapErrorMessage=Inconsistent IDocs passed: Data records or control records missing..
    AdapterErrorMessage=Error occurred while calling function module "INBOUND_IDOC_PROCESS" in R/3
    Is there any log files or some thing that I can see to get more info on this problem. I don't know where the log files related to this kind of problems get stored. Any feedback will be highly appreciated.
    Thanks
    Ram

    Hi,
    thanks all for your help, great progress has been made!
    There was no idoc record in sap as the document had not made it that far
    A large part of the problem was my lack of understanding of sap versioning. My previous understanding was that you had a major version of the document: ORDERS01, ..., ORDERS05 and each of these have a version that relates to the software version, e.g. 47, 62, 64 etc.. which appears in the control record.
    So I apparently have:
    ORDERS05   64    V2
    ORDERS05   64    V3
    Can anyone explain this versioning model?
    I would assume that V3 is the newer version but ...
    thanks and regards
    m

  • How to pass data between two internal sessions using ABAP memory?

    Hi,
    How to pass data between two internal sessions using ABAP memory?
    It would be fine if you could explain with an example.
    And also let me clear about the data passing between two main sessions and two external sessions with specific examples.
    Thanks.

    Hi ,
      check the example.
    Reading Data Objects from Memory
    To read data objects from ABAP memory into an ABAP program, use the following statement:
    Syntax
    IMPORT <f1> [TO <g 1>] <f 2> [TO <g 2>] ... FROM MEMORY ID <key>.
    This statement reads the data objects specified in the list from a cluster in memory. If you do not use the TO <g i > option, the data object <f i > in memory is assigned to the data object in the program with the same name. If you do use the option, the data object <f i > is read from memory into the field <g i >. The name <key> identifies the cluster in memory. It may be up to 32 characters long.
    You do not have to read all of the objects stored under a particular name <key>. You can restrict the number of objects by specifying their names. If the memory does not contain any objects under the name <key>, SY-SUBRC is set to 4. If, on the other hand, there is a data cluster in memory with the name <key>, SY-SUBRC is always 0, regardless of whether it contained the data object <f i >. If the cluster does not contain the data object <f i >, the target field remains unchanged.
    In this statement, the system does not check whether the structure of the object in memory is compatible with the structure into which you are reading it. The data is transported bit by bit. If the structures are incompatible, the data in the target field may be incorrect.
    PROGRAM SAPMZTS1.
    DATA TEXT1(10) VALUE 'Exporting'.
    DATA ITAB LIKE SBOOK OCCURS 10 WITH HEADER LINE.
    DO 5 TIMES.
      ITAB-BOOKID = 100 + SY-INDEX.
      APPEND ITAB.
    ENDDO.
    EXPORT TEXT1
           TEXT2 FROM 'Literal'
      TO MEMORY ID 'text'.
    EXPORT ITAB
      TO MEMORY ID 'table'.
    SUBMIT SAPMZTS2 AND RETURN.
    SUBMIT SAPMZTS3.
    The first part of this program is the same as the example in the section Saving Data Objects in Memory. In the example, the programs SAPMZTS1 and SAPMZTS2 are called using SUBMIT. You can create and maintain the programs called using the SUBMIT statement by double-clicking their names in the statement. For further information about the SUBMIT statement, refer to Calling Executable Programs (Reports)
    Example for SAPMZTS2:
    PROGRAM SAPMZTS2.
    DATA: TEXT1(10),
          TEXT3 LIKE TEXT1 VALUE 'Initial'.
    IMPORT TEXT3 FROM MEMORY ID 'text'.
    WRITE: / SY-SUBRC, TEXT3.
    IMPORT TEXT2 TO TEXT1 FROM MEMORY ID 'text'.
    WRITE: / SY-SUBRC, TEXT1.
    Example for SAPMZTS3:
    PROGRAM SAPMZTS3.
    DATA JTAB LIKE SBOOK OCCURS 10 WITH HEADER LINE.
    IMPORT ITAB TO JTAB FROM MEMORY ID 'table'.
    LOOP AT JTAB.
      WRITE / JTAB-BOOKID.
    ENDLOOP.
    The output is displayed on two successive screens. It looks like this:
    and
    The program SAPMZTS2 attempts to read a data object TEXT3 from the data cluster "text", which does not exist. TEXT3 therefore remains unchanged. The existing data object TEXT2 is placed in TEXT1. In both cases, SY-SUBRC is 0, since the cluster "text" contains data.
    The program SAPMZTS3 reads the internal table ITAB from the cluster "table" into the internal table JTAB. Both tables have the same structure, namely that of the ABAP Dictionary table SBOOK.
    Pls. reward if useful.....

  • Using events (?) to share data between tab pages

    I don't know whether this is an event question or an Object-Oriented design question or a JTabbedPane question.
    I'm pretty new to Java, so be patient!
    I wish to have a JTabbedPane with a tab to do 'Import' of data, and a tab to do 'Export' of data (the SAME data which was imported). Now, how do I share the data between the 2 tabs?
    It seems the data belongs at the JFrame level, but then how does the data in each tab access it? In other languages I would pass a reference to the data object in the window to each tab.
    Or how do I get (or set) the data when the tab changes? And how do I know when the tab changes?
    I think I need to set trigger some sort of event to the parent window, who I suppose has a listener, and then it can then query the appropriate pane? If so, I'm not sure what sort of event trigger I should be using, where etc.
    I know if I had one tab with an import/export functionality then I could declare the Collection within that panel.
    Help!!!
    Thanks ;)

    I think this is an OO design question.
    You basically have two views (the two panes) of the same data. So I'd suggest the Observer pattern (see the Design Patterns book) where one model holds the data and the model is observed by several views.

Maybe you are looking for