Pass string by reference from subsequence to caller

Hi, I am unable to pass a string parameter by reference from a subsequence to its caller. Is there a trick in doing this or is it not possible?
Thank you,
Chris
Solved!
Go to Solution.

Right Click on the parameter in the subsequence.
Make sure Pass By Reference is checked.
jigg
CTA, CLA
teststandhelp.com
~Will work for kudos and/or BBQ~

Similar Messages

  • Passing an ActiveX reference from TestStand to Labview

    How can I pass and ActiveX reference (for a dll) created and used in a TestStand sequence (under Locals) to a VI running within that sequence so that I can then call the same instance of the dll from Labview?
    (I know this isn't the best approach to programming but I'm more interested in proving the point than anything else)
    Cheers
    Dan

    Here's what I think you are tyring to do. Within your sequence, instantiate an object from an ActiveX DLL, storing a reference to it within a TS variable. Then, within a VI called by this sequence, call a method of the intantiated object.
    To do this, when specifying your module on your LV step you must check the Sequence Context ActiveX Pointer check box. In the called VI you must have the a Sequence Context control on your front panel and have it wired to your connector pane along with a TestData cluster control and a LV Error Out cluster control.
    Within the VI you use an invoke node to invoke the AsPropertyObject method on the SequenceContext (Make sure you use the ActiveX close function on this new reference when you are done with it.). Use another invoke node to call GetValInterface method on the sequence context property object reference (you could probably also use the GetValIDispatch method. See the help). For this invoke node you will want to use a lookupstring that reference the variable, relative to yo sequence context, in which you stored the refernce to the instantiated object in your sequence file. This will return a variant reference. You must convert this reference to a LV reference using the "To G Data" function in the ActiveX palette. The "To G Data" function requires a type input. You will need an ActiveX Automation Refnum control as the input to this (see ActiveX control palette). You will need to right click on this automation refnum control and browse the ActiveX automation server until you find the DLL ActiveX server from which you instantiated your object within your sequence. Once selected, also select the object that you instantiated. The "To G Data" function will then give you a reference to you object on which you can happily used in your desired manner. Make sure to close this reference with an ActiveX Automation close function when you are done with it.
    I would definitely clean this up with a subVI to perhaps generalize the solution.

  • Cannot pass String by reference !

    I have the same problem. I understood that if you pass "jxxxarray" or "String" they are passed by reference but I could not make it working. Here are the 2 parts of my code:
    JAVA (The call to native function):
    String toto = new String("toto");
    int nativeCodeReturned = finreadGetFCRAProperties(toto)
    System.out.println("fcra name: " + toto);
    ==> this prints "toto" but should print "FCRA1" !!!
    C (The native function):
    JNIEXPORT jint JNICALL
    Java_com_trustedlogic_qa_CBridge_finreadGetFCRAProperties(JNIEnv
    *env, jobject obj, jstring FCRAName) {
    FCRAName is modified and now contains "FCRA1" in jstring format (I used the appropriate method to do that, and verified the content)
    Please help !!!
    Thx in advance,
    Eg\\*

    Please help !!!You can't modify the string, that is why strings are immutable.
    So what you are doing is trying to change the reference (not the string that the reference points to.) And the reference is passed by value.
    This is exactly the same thing that happens in java. It has nothing to do with JNI.

  • Passing a internal table from method

    Hi All,
       I am using Object Oriented Programming in my program.
       I want to pass a Internal Table from a method calling statement written in a start-of-selection.
       Can any one give me the syntax for
    1. Declaring a method with importing parameter as internal table.
    2. Syntax for Method Implementation
    3. Syntax for calling the method from start-of-selection.
    helpful answers are rewarded.
    Regards,
    Azaz Ali.

    Hi,
      Calling Method is similar to calling function Module.
    CALL METHOD cl_gui_frontend_services=>gui_download
       exporting
          filename    =
    IMPORTING
       FILELENGTH                =
      changing
        data_tab                  = <b>( this is ur internal table name )</b>*  EXCEPTIONS
       FILE_WRITE_ERROR          = 1.
    <b>In OO ABAP u avoid creating table with header line</b>
    Best way to call method is to use <b>PATTERN</b> Button  
    1) Click Pattern Button
    2) Select Abap Object Pattern
    3) Enter
    4) Select Call Method
    5) Enter instance name ( i. e  used for create object ) ( No need for static method like gui_download )
    6) Enter Class / Interface name
    7) Enter Method Name
    done.
    <b>passing value to method is similar to FM.
    Creating internal table for Method
    any TYPE ........SAY  TY_Intern
    Then Syntax Should Be
    DATA : OO_INTERNAL_TABLe type table of TY_Intern.
    pass this to the Method.
    Hope This will solve ur problem.
    Please Mark Helpful Answers</b>
    Message was edited by: Manoj Gupta

  • How do you pass vi references from one event to another

    I have a vi which gets vi references (thereby loading the vi's into memory) for all the vi's in a given directory when a user clicks a button on the front panel. To do this I use an event structure. My question is whether it is possible to have another event (user button on the front panel) which unloads the vi's from memory. I have tried passing the vi references that are initially generated to the close reference function but whenever I do I get a 'vi reference invalid' error. Does this have to do with trying to pass the vi references between one event and another? If I use a local variable simply pass a reference to another indicator and then probe it, the originally-generated refnum and the local vari
    able refnum match up. However once I try to wire that same indicator to the close reference function I get the 'vi reference invalid' error. Is there a different/better way to unload the vi's from memory based on a user button click? Any suggestions would be welcome.
    Jason
    Attachments:
    Load_Directory_of_vi's.vi ‏57 KB

    Several problems with your code:
    1... Bad idea to use lights as buttons. Yes it can be done, but it's not "natural".
    2... If you've gotta do that, set their mechanical action to "LATCH WHEN RELEASED"
    3... Because of #2, you are getting TWO copies of every array when you click the LOAD VIs light (er... button).
    4... No need for the conversion from path to string and back - use BUILD PATH to append each file name to he folder path.
    5... Set the BROWSE OPTIONS on your PATH control to EXISTING DIRECTORY to allow browsing of directories, not files.
    6... Your code doesn't care whether the file is a .VI file, or a .ZIP file, or a .TXT file, or what. Use the PATTERN input on the LIST function to discriminate.
    7... Your code is only storing the latest refer
    ence, not the array of references.
    8... An ERROR DIALOG on the OPEN REFERENCE function will tell you that you're getting an error. Why? You are asking to prepare a non-reentrant VI for reentrant execution (why use options = 8?)
    9... Because of #8, the latest VI reference is invalid.
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • Is it possible to call a LabVIEW VI by reference from a CIN?

    I am calling by reference in my LabVIEW program and would like to do the same from a CIN, if possible.

    > I am calling by reference in my LabVIEW program and would like to do
    > the same from a CIN, if possible.
    >
    It is not possible to directly call a VI by reference from a CIN.
    There are a couple approaches that are similar that will work. If you
    have the professional version, you can build a DLL from VIs and can call
    the DLL entrypoints from your CIN.
    It is also possible to signal a LV occurrence from a CIN, and a LV
    diagram could run a VI or perform an operation when the occurrence is
    set. You will not be able to pass parameters with the occurrence though.
    Finally, the approach that will be easiest to debug is to change the CIN
    so that it returns to the diagram more often. Call the CIN and have it
    return with an action. The actions can be -- run
    a particular VI, delay
    for x ms and call the CIN again, end the program, etc.
    This last approach will be slightly less efficient at runtime, but in my
    experience they are much more flexible and much easier to debug.
    Greg McKaskle

  • Failure using {CALL } syntax & passing string params w/ # (hash)

    We are experiencing a problem calling functions using the {CALL } syntax and passing string parameters that contain # (hash) symbols. Apparently, something interprets the # inside the string literal and fails the call.
    We use this syntax with procedure calls from a Java applet to an Oracle 8i database using the 8.1.6.2.0 ODBC Oracle driver. The applet is running under the Java 1.3.1 plug-in and we are using a third party JDBC, type III, driver from JDataConnect to link the applet to the Oracle ODBC driver.
    Any insight on this would be greatly appreciated.

    What's the result of con.getAutoCommit()?
    You might try con.setAutoCommit(true) to see if that sorts it.
    /k1

  • How can I pass a String by reference in java?

    Hello!
    My question is how to pass a String by reference in java.
    I tried to declare my variable, instead of using "String xxx = "f";", I used "String xxx = new String ("f");" :
    public static void main (String []args)
    String xxx = new String("f");
    StatusEnum result2 = getErrorPointStr(xxx);
         public StatusEnum getErrorPointStr(String text)
              StatusEnum testStatus = StatusEnum.PASS;
              StringBuffer buffer = new StringBuffer();
    buffer.append("123");
              text = buffer.toString();
              return testStatus;
    After calling to getErrorPointStr(String text) function, xxx = "f"
    So it does not work.
    How can I solve this? It is very important, the function will receive String and not something else.
    Thanks!

    Tolls wrote:
    Which is why I said:
    Which is why you only managed to change what 'text' referred to in the methodExcept that's not why. Even if String was mutable, doing text = whatever; would have the same effect; it would change what that variable refers to in the method, but it would not change the object's state.
    I meant that, since there was no way to actually change the data (ie the char[] or whatever) within the object 'text' referred to, the OP was attempting to change what 'text' referred to and hoping it would be reflected outside the method...which we know won't happen as Java is pass-by-value.\Ah, now I see.
    These by-value/by-reference threads tend to get confusing, because usually the person is passing a String, so the immutability of String tends to get in the way and just muddy the waters.

  • Pass object reference from TestStand to C#

    Hi,
    I have created a GUI in .NET which i invoke in TestStand (through a custom step type). User can enter a object reference teststand variable in the UI input expression box. So i need to get the object value in that variable and use it to call some .net functions. To get the values from expression box of UI and put in TestStand step variable i use:
             PropertyObject.SetValInterface("Step.TestStationObj", 0, tsexprTestStationObj.DisplayText.Trim()); To check the value in the step variable if i do:
             MessageBox.Show("TestStation obj after setting:",PropertyObject.GetValInterface("Step.TestStationObj",0).ToString());
    But i do not get any value. Guess it is null. Is this a correct way? My intension is to get the value corresponding to a teststand object reference and pass it to C#. The C# UI control is of type NationalInstruments.TestStand.Interop.UI.Ax.AxExpressionEdit

    Thanks Andy.
    I still get the error when i am trying to pass the object created from C# to Teststand. I have explained what i am trying to do. Kindly requesting your assitance on this issue.
    I have 2 classes in C# (code given below), I am trying to pass the object of "Counter" (c1) class from the "Mainfrm" to teststand. In teststand(counter.seq), I am trying to access the function "GetCount() and SetCount()". I have attached the snapshot of the error that i get from teststand.
    Class Counter
        private int count;
        public int GetCount ()
           return (count);
        public void SetCount(int _count)
           count = _count;
    Class Mainfrm : Form
        public Counter c1;
            private void Mainfrm (object sender, EventArgs e)
                InitializeComponent();
                axApplicationMgr1.Start();
                mEngine = axApplicationMgr1.GetEngine();
                currentFile = axApplicationMgr1.OpenSequenceFile(@"Counter.seq");
                pobj = mEngine.NewPropertyObject(NationalInstruments.TestStand.Interop.API.PropertyValueTypes.PropValType_Container, false, "", 0);
                pobj.NewSubProperty("Parameters.ObjRef1", NationalInstruments.TestStand.Interop.API.PropertyValueTypes.PropValType_Reference, false, "", 0);
                pobj.SetValInterface("Parameters.ObjRef1", 0, (object)c1);
                mExecution = mEngine.NewExecution(currentFile, "MainSequence", null, false, 0, pobj, null, null);
    Attachments:
    ErrorFromTestStand.JPG ‏28 KB

  • How to get caller object reference from a method

    Hi,
    I am working a already existing Java Swing project, now I got a problem, in a method I need to get the caller object reference otherwise, I can't succeed this operation. So please tell me a way how to get the caller object reference from a method. that method would be static or regular method anything will do for me.
    Edited by: navaneeth.j on Jan 29, 2010 11:20 PM

    navaneeth.j wrote:
    Actually my doubt is, I have a method "addition" method, which is using by many classes so my requirement is in the addition method I want to write a code snippet which will identify and get the the caller object. Actually I tried Reflection.getcallerclass but there I am getting "CLASS" object not the actual object reference, but I want object reference.
    Actually we have a huge project which is writen plain JAVA, so in this project the authors written the Database connection package for single database transaction. so now we are using this project source code for JSF application in this web application the DB package has serve based on the dynamic db connection parameters, so if we want to change this package fully means need to solve the dependency problem in hundreds of classes, so my point is if I can access the caller object in the DB package when ever it gets called by any class from any where of the project. So actually I liked Reflection.getcallerclass, the way of implementation perfectly works for me but it is not giving caller object reference, if something gives the caller object then I can get the DB connection parameters then there is no need to pass the parameters in the hierarchy.You can add a parameter (of type Object) to your addition() method
    and everywhere you call the addition() method also pass this (which from the POW of the addition() method will be a reference to the calling class instance).
    There may be alternative solutions
    but none that require less effort.

  • How to pass string from a class to another on button click

    Hai forum i'm developing an application in which i have frame1(seperate class without main) where i get a excel files and get the tablenames of it(sheets).
    There i choose a sheet from availabe sheets and i have to pass it frame2 on clicking a button on frame1.
    The sheet name is chosen from a JComboBox in frame1:(code)
    sheetcombo.addActionListener(new java.awt.event.ActionListener()     
                        public void actionPerformed(java.awt.event.ActionEvent e)
                                  JComboBox cb = (JComboBox)e.getSource();
                                  String sheetname = (String)cb.getSelectedItem();
    I dont get how to pass this String sheetname to frame2 where i call the constructor of frame1 initialize it. Help me out. Thanks in advance...

    1 write a set method in frame 2 class
    2 create a instance of frame 2 class in frame 1
    3 in actionaPerformed method write code as follows
    frame2obj.set(sheetname)
    this should work :-)

  • Passing / parsing XML String IN / OUT from PL / SQL package

    Hello, People !
    I am wondering where can I find exact info (with code sample) about following :
    We use Oracle 8.1.6 and 8.1.7. I need to pass an XML String (could be from VARCHAR2 to CLOB) from VB 6.0 to PL/SQL package. Then I need to use built in PL/SQL XML parser to parse given string (could be large hierarchy of nodes)
    and the return some kind of cursor thru I can loop and insert data into
    different db Tables. (The return value may have complex parent/child data relationship - so I am not sure If this should be a cursor)
    I looked online many site for related info - can't find what I am looking
    for - seems like should be a common question.
    Thanx a lot !

    Hello, People !
    I am wondering where can I find exact info (with code sample) about following :
    We use Oracle 8.1.6 and 8.1.7. I need to pass an XML String (could be from VARCHAR2 to CLOB) from VB 6.0 to PL/SQL package. Then I need to use built in PL/SQL XML parser to parse given string (could be large hierarchy of nodes)
    and the return some kind of cursor thru I can loop and insert data into
    different db Tables. (The return value may have complex parent/child data relationship - so I am not sure If this should be a cursor)
    I looked online many site for related info - can't find what I am looking
    for - seems like should be a common question.
    Thanx a lot !

  • Calling a web service reference from PL/SQL

    Hello,
    could anyone give me a hint how to call a web service that is defined as web service reference from a PL/SQL page process (PL/SQL anonymous block).
    Many thanks in advance
    Lukasz

    >
    The problem is that I have a PL/SQL page process that processes the result that was returned by a web service (triggered by web-service page process (-; ) and <b>need to call it again transparently for the user</b>. If there is a way to execute a page process from this PL/SQL block the question would be answered as well.
    >
    Same parameters and repeating at pre-defined time intervals? If yes, use Javascript as described here.
    Regards,

  • Example of passing String Array from java to C using JNI

    hi all
    i searched net for passing string array from java to C but i dont get anything relevent
    i have
    class stu
    int rollno
    string name
    String [] sub
    i want to pass all as String array from java to C and access it C side

    1. Code it as though it were being passed to another method written in java.
    2. Redefine the method implementation to say "native".
    3. Run jnih to generate a C ".h" file. You will see that the string array
    is passed into C as a jobject, which can be cast to a JNI array.
    4. Write the C code to implement the method and meet the interface
    in the generated .h file.

  • Passing objects by reference in PL/SQL

    Hi,
    I have come across an unexpected problem using object types in PL/SQL that is causing me some grief. I'm from a Java background and am relatively new to Oracle Objects but what I'm trying to do is fairly trivial, I think. The code below illustrates the problem.
    --- cut here ---
    CREATE OR REPLACE TYPE test_obj_t AS OBJECT
    num INTEGER,
    CONSTRUCTOR FUNCTION test_obj_t RETURN SELF AS RESULT
    CREATE OR REPLACE TYPE BODY test_obj_t IS
    CONSTRUCTOR FUNCTION test_obj_t RETURN SELF AS RESULT IS
    BEGIN
    num := 0;
    RETURN;
    END;
    END;
    CREATE OR REPLACE PACKAGE test_obj_ref AS
    PROCEDURE init(o IN test_obj_t);
    PROCEDURE inc;
    FUNCTION get_num RETURN INTEGER;
    END;
    CREATE OR REPLACE PACKAGE BODY test_obj_ref IS
    obj test_obj_t;
    PROCEDURE init(o IN test_obj_t) IS
    BEGIN
    obj := o;
    END;
    PROCEDURE inc IS
    BEGIN
    obj.num := obj.num + 1;
    END;
    FUNCTION get_num RETURN INTEGER IS
    BEGIN
    RETURN obj.num;
    END;
    END;
    --- cut here ---
    The object type test_obj_t holds a integer and the test_obj_ref package holds a 'reference' to an instance of the object.
    To test the above code I run this PL/SQL block:
    declare
    obj test_obj_t;
    begin
    obj := test_obj_t;
    test_obj_ref.init(obj);
    dbms_output.put_line('obj.num='||obj.num);
    dbms_output.put_line('test_obj_ref.get_num='||test_obj_ref.get_num);
    test_obj_ref.inc;
    dbms_output.put_line('obj.num='||obj.num);
    dbms_output.put_line('test_obj_ref.get_num='||test_obj_ref.get_num);
    test_obj_ref.inc;
    dbms_output.put_line('obj.num='||obj.num);
    dbms_output.put_line('test_obj_ref.get_num='||test_obj_ref.get_num);
    end;
    giving the output:
    obj.num=0
    test_obj_ref.get_num=0
    obj.num=0
    test_obj_ref.get_num=1
    obj.num=0
    test_obj_ref.get_num=2
    It appears that the object held by the test_obj_ref package is being incremented as expected, but I would have expected the object declared in the PL/SQL block to be pointing to the same object and so should report the same incremented values.
    I suspect that the object is copied in the call to test_obj_ref.init() so I end up with two object instances, one that is held by the test_obj_ref package and one in the anonymous block. Although, I thought that all IN parameters in PL/SQL are passed by reference and not copied!
    Am I right?
    Is passing objects by reference possible in PL/SQL, if so how?
    I'm using Oracle 10.2.0.3.
    Cheers,
    Andy.

    the object being passed to the test_obj_ref.init+ procedure is passed by reference; however, when you assign it to your package variable obj it is being copied to a new instance. you can pass object instances as parameters to procedures using the +IN OUT [NOCOPY]+ *calling mode, in which case modifications to the attributes of the passed object will be reflected in the calling scope's instance variable.
    oracle's only other notion of an object reference is the +"REF &lt;object-type&gt;"+ datatype, which holds a reference to an object instance stored in an object table or constructed by an object view.
    hope this helps...
    gerard

Maybe you are looking for

  • 2012 MBP will not boot after 10.8.4 update

    Has anyone else had problems with booting to 10.8.4?  I have a 2012 15" MBP with dual boot 10.8.4 and Win 8 via BC on a single Seagate Thin SSHD 1TB.  Win 8 will boot but the OS X drive will not even mount during boot.  I tried single user, verbose,

  • ITunes 9 is FREEZING PC!!

    Hello! Is anyone having problems with iTunes v9? Have PC, Pentium D 2.8, 3Gb Ram, Radeon 128Mb video card, 2 250Gb HDD! Was using iTunes 8.x which ran well. AFTER installing iTunes v9, iTunes will appear then .... FROZEN!!! Must hit Ctr-Alt-Del to sh

  • Get an item at a particluar position in Advanced Datagrid

    I want to access some property of an item lying at nth position in an advanced datagrid. I was not able to find any method which can return me this result. getChildAt method returns display objects of the adv DG and not the items in it. Also numChild

  • How do I change iTunes back to australia

    iTunes changed me to the States iTunes now I can't get back to Australia.  Please help

  • Trouble with line spacing and text flow in Indesign 6

    Hello everyone. I'm a graphic artist working with magazine layout new to Indesign. I've used Quark for years and recently came across this problem... Within a paragraph we'll usually use a soft return to bump certain words to the next line. However,