How to pass IMAQ session to subVI

Hi,
My experience with LabView is neither very good nor extensive. I am a scientist and I am acquiring data with IMAQ.My current problem is that the people who wrote the script in the beginning made it neither versatile, nor modular nor clear structured. So I am trying to reduce the ridiculous numbers of execution controls in a single flowchart to a level that people can actually understand it... and to make the script more versatile for future experiments.
I am introducing quite a few subVIs to be executed repetitively. However, I can't find out how to pass the IMAQ session on to the subVI. I always get error messages. In this case I want to acquire frames with OIDE_CollectFrame.vi controlled by OIDE_TrialPhaseCollect.vi. I couldn't figure out how to assign the IMAQ session refnum class, either.
It's probably a newbie question but I usually don't program with LabView.
Dennis
P.S. I use LabView 2009
Solved!
Go to Solution.
Attachments:
OIDE_CollectFrame.vi ‏19 KB
OIDE_TrialPhaseCollect.vi ‏15 KB

Hi,
See the attached example.  It passes the IMAQ session created in the main VI on to the subVI and then passses it again from the SubVI to the main VI.
Regards,
Greg H.
Applications Engineer
National Instruments
Attachments:
Snap.vi ‏14 KB
Snap_Main.vi ‏38 KB

Similar Messages

  • How to pass serialized session/usertoken to BO webservice from xcelsius?

    I wonder how to pass serialized session/usertoken to BO webservice from xcelsius. Could anyone help me how to pass the serialized session/user token to BO web service from Xcelsius?
    Xcelsius is working fine when i use the username/password. But i would like to pass serialized session/usertoken from jsp file to Xcelsius as flash variable , then i will use this variable to get the data from webservice.
    Is that possible to send serialized session/usertoken using soap header?
    Thanks in advance...

    Hi Micheal
    Thank you for the reply.  I have already created the CELogonToken Flash Variable and i am able get the logon token and map to the flash variable.
    Now i would like to pass the same to biws as parameter. But the service has only 2 parameters as username and password.
    Is there a way that i can create my custom parameters(CELogonToken/CESerializedSession) in BIWS service?

  • How to pass page session variable to on-demand PL/SQL process

    I am trying to execute a stored procedure that takes two page session variables as input and executes code based on those two variables. I have tried creating a stored procedure on the db-side and calling it using:
    BEGIN
    PROC_UPDT_EMP(&P23_TC_ID, &P23_EMP_ID);
    END;
    but APEX rejects the variables.
    I have also tried putting in the entire procedure in APEX as well, but I get the same problem. I have also tried using the :P23_TC_ID syntax, and still a no-go. What am I doing wrong?

    If PROC_UPDT_EMP is a stored procedure that takes 2 IN parameters, you would do
    proc_updt_emp(:P23_TC_ID,:P23_EMP_ID);in an after-submit page process. That would pass in the values of those 2 items from session state.

  • How to pass a session variable to the bussines layer?

    Hello,
    I am doing a management application, and I need to store the login user that make insertions on any table, and the pages does not has backing beans.
    I had try to do that bindding the value field of a hidden attribute with the session variable, but it only change the value of the one. My second attempt was make an javascript function to do that on the page´s load, but it not looks like a good solution.
    Someone knows a way to sent the session value to the bussines layer? O a way to access from the Bussines layer to the session?
    Thanks
    Tony

    <p>
    Hi,
    </p>
    <p>
    Another solution (that I always use) is storing simultaneously the same data in HttpSession (in view layer) and session hashtable (in businness layer).
    </p>
    <p>
    You can put and get these data in any businness component using following methods:
    </p>
    <p>
    <font face="courier new,courier" size="2" color="#0000ff">
    private void setToJboSession(String key, Object val){</font>
    <font face="courier new,courier" size="2" color="#0000ff"> Hashtable userData = getDBTransaction().getSession().getUserData();
    if (userData == null) {
    userData = new Hashtable();
     userData.put(key, val);
    }</font>
    </p>
    <p>
     and
    </p>
    <p>
    <font face="courier new,courier" size="2" color="#0000ff">
    private Object getFromJboSession(String key){
     return getDBTransaction().getSession().getUserData().get(key);
    }</font>
    </p>
    <p>
    Kuba 
    </p>

  • How to pass a server side value to an attribute of a custom jsp tag

    Hi All:
    I needed to passed an integer value from the following code:
    <%=ic.getTotalNumOfRecords()%>
    to an attribute of a custom tag
    <inquiry:tableClaimHistory numberOfRecords="5" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    The function getTotalNumOfRecords returns an int.
    The attribute numberOfRecords expects an string.
    Here are the different ways I tried in a jsp page but I get also the following errors:
    1.)
    >
    <%@ include file="../common/page_imports.jsp" %>
    <inquiry:tableClaimHistory numberOfRecords=<%=ic.getTotalNumOfRecords()%> dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    Error Message:
    claimHistoryView.jsp:190:3: Unterminated tag.
    <inquiry:tableClaimHistory numberOfRecords=<%=ic.getTotalNumOfRecords()%> dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    2.)
    >
    <%@ include file="../common/page_imports.jsp" %>
    <inquiry:tableClaimHistory numberOfRecords="<%=ic.getTotalNumOfRecords()%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    Error Message:
    claimHistoryView.jsp:190:4: The required attribute "numberOfRecords" is missing.
    <inquiry:tableClaimHistory numberOfRecords="<%=ic.getTotalNumOfRecords()%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    3.)
    >
    <%@ include file="../common/page_imports.jsp" %>
    <inquiry:tableClaimHistory numberOfRecords="<%ic.getTotalNumOfRecords();%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    Error Message:
    java.lang.NumberFormatException: For input string: "<%ic.getTotalNumOfRecords();%>"
    4.)
    >
    <%@ include file="../common/page_imports.jsp" %>
    <%
    int records1 = ic.getTotalNumOfRecords();
    Integer records2 = new Integer(records1);
    String numberOfRecords2 = records2.toString();
    %>
    <inquiry:tableClaimHistory numberOfRecords="<%numberOfRecords2;%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    error message:
    java.lang.NumberFormatException: For input string: "<%numberOfRecords2;%>"
         at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1224)
         at java.lang.Double.valueOf(Double.java:447)
         at java.lang.Double.(Double.java:539)
         at com.DisplayTableClaimHistoryTag.displayTable(DisplayTableClaimHistoryTag.java:63)
    5.)
    >
    <%
                   int records1 = ic.getTotalNumOfRecords();
                   Integer records2 = new Integer(records1);
                   String numberOfRecords2 = records2.toString();
              %>
              <inquiry:tableClaimHistory numberOfRecords=<%numberOfRecords2;%> dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    error message:
    claimHistoryView.jsp:194:3: Unterminated tag.
              <inquiry:tableClaimHistory numberOfRecords=<%numberOfRecords2;%> dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    In the custom tag java code called "DisplayTableClaimHistoryTag"
    I tried to used the following code:
    >
    InquiryContext ic = InquiryContext.getContext(session);
    >
    The problem is that in order to get session I needed HttpSession object. I don't know how to passed HttpSession "session" object
    to a custom tag. Is there a way to do this?
    >
    public class DisplayTableClaimHistoryTag extends InquiryTag
         String numberOfRecords;
         public void setNumberOfRecords(String numberOfRecords)
              this.numberOfRecords = numberOfRecords;
         public String getNumberOfRecords()
              return numberOfRecords;
         public int doStartTag()throws JspException
              InquiryContext context = (InquiryContext)pageContext.getSession().getAttribute(Constrain.CONTEXT);
              if(context==null)
                   throw new JspException(TAG_EXCEPTION+ "InquriyContext is null.");
              String hasData = (String)context.getAttribute(Constrain.CONTROL_HAS_DATA);
              if(hasData==null)
                   throw new JspException(TAG_EXCEPTION + "The hasData property can not be null.");
              boolean hd = Boolean.valueOf(hasData).booleanValue();
              Debug.println("hasData="+hd);
              Debug.println("hasDataString="+hasData);
              if(hd)
                   displayTable();
              else
                   disPlayError();
              return SKIP_BODY;
         private void displayTable() throws JspException
              String outString ="";
              Debug.println("dispalyTable() ********* dataAction="+ dataAction);
              JspWriter out = pageContext.getOut();
              * Minimum height height= 103,70
              * 21.7 per row
              * First row==103+21.5=124.5
              * Second row ==103+21.5*2=146
              * Third row ==103+21.5*3=167.5
              Double numberOfRecordsBigDouble = new Double(numberOfRecords);
              double numberOfRecordsDouble = 70 + 21.8*numberOfRecordsBigDouble.intValue();
              if(order==null || order.equals("0"))
              //     outString = "<iframe src=\"" + "/inquiry/" + dataAction + "?order=0"+ "\"" + " name=\"dataFrame\" id=\"dataFrame\" height=\""+numberOfRecordsDouble+"\"" +" width=\"100%\" scrolling=\"NO\" frameborder=\"0\"></iframe>";
              //     outString = "<iframe src=\"" + "/inquiry/" + dataAction + "?order=0"+ "\"" + " name=\"dataFrame\" id=\"dataFrame\" style=\"height:"+numberOfRecordsDouble+"px; width:100%\" scrolling=\"NO\" frameborder=\"0\"></iframe>";
              //     outString = "<iframe src=\"" + "http://www.google.ca"+ "\"" + " name=\"dataFrame\" id=\"dataFrame\" style=\"height:"+numberOfRecordsDouble+"px; width:100%\" scrolling=\"NO\" frameborder=\"0\"></iframe>";
              outString = "<iframe src=\"" + "/inquiry/" + dataAction + "?order=0"+ "\"" + " name=\"dataFrame\" id=\"dataFrame\" style=\"height:"+numberOfRecordsDouble+"px; width:100%\" scrolling=\"NO\" frameborder=\"0\"></iframe>";
              else
                   String orderStr = "?order=" + order;
                   outString = "<iframe src=\"" + "/inquiry/" + dataAction + orderStr + "\"" + " name=\"dataFrame\" id=\"dataFrame\" height=\""+numberOfRecordsDouble+"\"" +" width=\"100%\" scrolling=\"NO\" frameborder=\"0\"></iframe>";
                   //outString = "<iframe src=\"" + "/inquiry/" + dataAction + orderStr + "\"" + " name=\"dataFrame\" id=\"dataFrame\" height=\"161\" width=\"100%\" scrolling=\"NO\" frameborder=\"0\"></iframe>";
              Debug.println("dispalyTable() ********* outString = "+ outString);
              try {
                   out.println(outString);
              } catch (IOException e) {
                   this.log.error(TAG_EXCEPTION + e.toString(), e);
                   throw new JspException(e);
    >
    Any hint would be greated appreciated.
    Yours,
    John Smith

    Ok, couple of things
    1 - ALWAYS put quotes around attributes in a custom tag. That rules out items #1 and #5 as incorrect.
    2 - You were correct using the <%= expr %> tags. <% scriptlet %> tags are not used as attributes to custom tags. That rules out #3 and #4
    #2 looks the closest:
    2.)
    <%@ include file="../common/page_imports.jsp" %>
    <inquiry:tableClaimHistory numberOfRecords="<%=ic.getTotalNumOfRecords()%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>Error Message:
    claimHistoryView.jsp:190:4: The required attribute "numberOfRecords" is missing.
    <inquiry:tableClaimHistory numberOfRecords="<%=ic.getTotalNumOfRecords()%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/>
    Check your spelling of that attribute. It looks right here,.
    You also said that ic.getTotalNumOfRecords returns an int, while the attribute returns a String
    Try
    <%@ include file="../common/page_imports.jsp" %>
    <inquiry:tableClaimHistory numberOfRecords="<%="" + ic.getTotalNumOfRecords()%>" dataAction="claimHistoryViewData.do" emptyKey="error.noData"/><%= "" + ic.getTotalNumOfRecords %> is the cop-out way to convert an int to a String :-)

  • How to pass session variable value with GO URL to override session value

    Hi Gurus,
    We have below requirement.Please help us at the earliest.
    How to pass session variable value with GO URL to override session value. ( It is not working after making changes to authentication xml file session init block creation as explained by oracle (Bug No14372679 : which they claim it is fixed in 1.7 version  Ref No :Bug 14372679 : REQUEST VARIABLE NOT OVERRIDING SESSION VARIABLE RUNNING THRU A GO URL )
    Please provide step by step solution.No vague answers.
    I followed below steps mentioned.
    RPD:
    ****-> Created a session variable called STATUS
    -> Create Session Init block called Init_Status with SQL
        select 'ACTIVE' from dual;
    -> Assigned the session variable STATUS to Init block Init_Status
    authenticationschemas.xml:
    Added
    <RequestVariable source="url" type="informational"
    nameInSource="RE_CODE" biVariableName="NQ_SESSION.STATUS"/>
    Report
    Edit column "Contract Status" and added session variable as
    VALUEOF(NQ_SESSION.STATUS)
    URL:
    http://localhost:9704/analytics/saw.dll?PortalGo&Action=prompt&path=%2Fshared%2FQAV%2FTest_Report_By%20Contract%20Status&RE_CODE='EXPIRED'
    Issue:
    When  I run the URL above with parameter EXPIRED, the report still shows for  ACTIVE only. The URL is not making any difference with report.
    Report is picking the default value from RPD session variable init query.
    could you please let me know if I am missing something.

    Hi,
    Check those links might help you.
    Integrating Oracle OBIEE Content using GO URL
    How to set session variables using url variables | OBIEE Blog
    OBIEE 10G - How to set a request/session variable using the Saw Url (Go/Dashboard) | GerardNico.com (BI, OBIEE, O…
    Thanks,
    Satya

  • How to pass a general datalog type to a subvi

    I am writing a general subvi to determine if a file of a given name and optionally datalog type exists in a directory specified by the user. To match the datalog type I must be able to pass it into my subvi. To keep this question in a simple context, imagine putting the standard file/directory LIST vi inside a subvi. Now I want to pass the datalog type into this subvi so that this bit of code is generally useful. Is there a (preferrably easy) way?
    I tried a variant control and it does not work - but does not generate an error either. It simply doesn't return any files. I also tried passing a cluster control refnum, but this failed for the same reason; when I wire the Value Property node it supplies a variant . . .
    I am guessing that this job cannot be done with file/directory LIST since it checks the type of data wired to Datalog Type at program time. So if I take on the task of passing a type descriptor for a cluster/datalog type, how can I match this to the header of a datalog file? I see that most of the information matches, but not all . . .
    Thanks,
    Art Mihill
    McPherson, Inc.

    Hello,
    Well, you may be able to do this, but it may be easier to have a naming convention for your files, where you can determine immediately the datalog type from the file name.  One way you may attempt this is to read the file and use it's size, perhaps (mod) something (ie. look at the remainder after dividing by some integer) to determine the underlying datatypes.  You may also be able to parse the file and look for clues; in that case you may want to reference the following tutorial:
    LabVIEW Data Storage:
    http://zone.ni.com/devzone/conceptd.nsf/2d17d611ef​b58b22862567a9006ffe76/370dfc6fd19b318c86256a33006​...
    If this isn't sufficient or not a viable solution, repost and we'll try to get a bit more creative!
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • How to pass parameter to the method in EJB session bean from Managed Bean

    Hi,
    I need some guidance in accessing the EJB session bean methods from one of my backing Bean. I use EJB 3.0 Entity Beans and EJB Session Beans. I have to get value from my page and pass it thro the backing bean to the respective EJB session bean. I have no clue of how to do this,
    When i click a command link on the page, in its backing bean click method, i am able to get a value and store in a variable under its click action. But from there i am not knowing of how to pass it as a variable to the EJB session bean and hence execute the query(this is where we have to pass the variable as a parameter in its where clause) in the entity bean.
    I wanna know how to make a call to the EJB session bean and from there execute the Enitity bean.
    Guide me regarding this....
    Thanks
    ri

    Unfortunately dependency injection doesn't work for jsf backing beans, so you have to use a normal jndi lookup to find your session bean. The following example shows you how to find a session bean and call a method:
    public void commandButton_actionListener(ActionEvent actionEvent) {
    Context ctx;
    try {
    ctx = new InitialContext();
    helloWorldEjb = (HelloWorldEJB)ctx.lookup("HelloWorldEJB");
    hello = helloWorldEjb.sayHello(name);
    System.out.println(hello);
    } catch (NamingException e) {
    e.printStackTrace();
    }

  • How to pass session from Java to Perl

    Hi,
    I need to pass a session value from Java to Perl, does anyone knows how can I do it?
    Thanks

    If you want to run java code from Perl, and have it return a single value, that's one thing: but having Perl interact with java code - calling methods, returning values - that may not be possible.
    Look into python to see if it may be what you're looking for. It's a scripting language that allows real interaction with java.
    If all you want to do is run java code and have it return some data, that would be trivial, so I assume that's not what you mean. But in case it is heres an idea:
    Set up a network connection between them with your own protocol, seeing as both languages are good at networking.

  • How to pass data from one internal session to another internal session

    hi all sap experts ,
    How to pass data from one internal session to another internal session and from oneExternal session to another external session.
    Except : Import and Export parameters and SPA/GPA parameters.
    Tell me the otherWay to pass data ..
    Plz
    Thanks in advance

    hi,
      abap memory management u will understand about this concept.
    the import /export parameter will help u that passing data between two internal sessions by using abap memory.
      for syntax
    Passing Data Between Programs
    There are two ways of passing data to a called program:
    Passing Data Using Internal Memory Areas
    There are two cross-program memory areas to which ABAP programs have access (refer to the diagram in Memory Structures of an ABAP Program) that you can use to pass data between programs.
    SAP Memory
    SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters can be set either for a particular user or for a particular program using the SET PARAMETER statement. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement. The most frequent use of SPA/GPA parameters is to fill input fields on screens (see below).
    ABAP Memory
    ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements. Data within this area remains intact during a whole sequence of program calls. To pass data to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse. For further information, refer to Data Clusters in ABAP Memory.
    Filling Input Fields on an Initial Screen
    Most programs that you call from other programs have their own initial screen that the user must fill with values. For an executable program, this is normally the selection screen. The SUBMIT statement has a series of additions that you can use to fill the input fields of the called program:
    Filling the Selection Screen of a Called Program
    You cannot fill the input fields of a screen using additions in the calling statement. Instead, you can use SPA/GPA parameters. For further information, refer to Filling an Initial Screen Using SPA/GPA Parameters.
    Message was edited by:
            sunil kumar
    Message was edited by:
            sunil kumar

  • How to pass data from one internal session to another

    Hi SAP Experts,
    How to pass data from one internal session to another and from One external session to another external session. I used import and export parmeter and SPA/GPA parameters. What is the other way to pass data?
    Please tel me urgently
    Thank you
    Basu

    Memory Structures of an ABAP Program
    In the Overview of the R/3 Basis System you have seen that each user can open up to six R/3 windows in a single SAPgui session. Each of these windows corresponds to a session on the application server with its own area of shared memory.
    The first application program that you start in a session opens an internal session within the main session. The internal session has a memory area that contains the ABAP program and its associated data. When the program calls external routines (methods, subroutines or function modules) their main program and working data are also loaded into the memory area of the internal session.
    Only one internal session is ever active. If the active application program calls a further application program, the system opens another internal session. Here, there are two possible cases: If the second program does not return control to the calling program when it has finished running, the called program replaces the calling program in the internal session. The contents of the memory of the calling program are deleted. If the second program does return control to the calling program when it has finished running, the session of the called program is not deleted. Instead, it becomes inactive, and its memory contents are placed on a stack.
    The memory area of each session contains an area called ABAP memory. ABAP memory is available to all internal sessions. ABAP programs can use the EXPORT and IMPORT statements to access it. Data within this area remains intact during a whole sequence of program calls. To pass data to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse.
    All ABAP programs can also access the SAP memory. This is a memory area to which all sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters are often used to preassign values to input fields. You can set them individually for users, or globally according to the flow of an application program. SAP memory is the only connection between the different sessions within a SAPgui.
    The following diagram shows how an application program accesses the different areas within shared memory:
    In the diagram, an ABAP program is active in the second internal session of the first main session. It can access the memory of its own internal session, ABAP memory and SAP memory. The program in the first internal session has called the program which is currently active, and its own data is currently inactive on the stack. If the program currently active calls another program but will itself carry on once that program has finished running, the new program will be activated in a third internal session.
    Data Clusters in ABAP Memory
    You can store data clusters in ABAP memory. ABAP memory is a memory area within the internal session (roll area) of an ABAP program and any other program called from it using CALL TRANSACTION or SUBMIT.
    ABAP memory is independent of the ABAP program or program module from which it was generated. In other words, an object saved in ABAP memory can be read from any other ABAP program in the same call chain. ABAP memory is not the same as the cross-transaction global SAP memory. For further information, refer to Passing Data Between Programs.
    This allows you to pass data from one module to another over several levels of the program hierarchy. For example, you can pass data
    From an executable program (report) to another executable program called using SUBMIT.
    From a transaction to an executable program (report).
    Between dialog modules.
    From a program to a function module.
    and so on.
    The contents of the memory are released when you leave the transaction.
    To save data objects in ABAP memory, use the statement EXPORT TO MEMORY.
    Saving Data Objects in Memory
    To read data objects from memory, use the statement IMPORT FROM MEMORY.
    Reading Data Objects from Memory
    To delete data clusters from memory, use the statement FREE MEMORY.
    Deleting Data Clusters from Memory
    please read this which provide more idea about memory
    Message was edited by:
            sunil kumar

  • How to pass submitted Data from a servlet to EJB Session Bean in JPA

    How to pass Data User submitted Data from a servlet to EJB Session Bean when using JPA :
    Hi ,
    I have a jsp page in which the user fills up the Data and submits it to the servlet :
    Inside servlets i am getting all the parameters and setting it to the Entity Class .
    Sample Entity class is shown below :
    @Entity
    public class Employee {
    @Id private int id;
    private String name;
    public Employee() {}
    public Employee(int id) { this.id = id; }
    public int getId() { return id; }
    public void setId(int id) { this.id = id; }
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    }After calling setters of my Entity Class .
    I am using JNDI lookup to call my session Bean method and pass this Entity class to the session Bean to persist data
    Please let me know what will be the right approach :
    1. Passing parameters whole as a Entity Class
    that is
    public void insertData(Employee emp)
    }Or
    2. public void insertData(String Name , int ID)
    }

    they are both right as they both work. Easy huh?
    You might argue that if you have to set a lot of fields, use the entity as otherwise you get a method with a gigantic amount of parameters.

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

  • How to turn off/on triggering within same IMAQ session

    I put together an image acquisition application with a NI 1427 frame grabber and a Basler Aviator camera. I want to be able to switch between continuous (non-triggered) acquisition and triggered (acquisition is not running during the switch).
    I can switch from continuous to triggered without reconfiguring the IMAQ session by using the IMAQ Configure Trigger3 VI. However, to go back to non-triggered mode, I tried calling the Configure Trigger3 VI with "Disabled" as the Action but that gave me a "Requested triggering mode is invalid error". I also tried using "Software Trigger" as the Type and that gave me the same error. Is there no way to turn off triggering without reconfiguring the entire IMAQ session?
    Thank you for any input.
    Vadim

    Hi Kira,
    Thank you for the response. I tried what you suggested but received an error stating that this was not a valid attribute. So I looked in MAX and saw that I have 2 Camera attributes (I think based on my icd file) and they are Bit Depth and Triggering. The Triggering attribute does have a "Free Run" value which I tried using with the IMAQ Set Attribute VI (with Camera Attribute = Triggering). I had no error but the frame grabber was also not acquiring images, i.e., the IMAQ session was originally in triggered mode and it seems that it was still waiting for an external trigger. 
    Vadim

  • Passing control reference to subVI crashes labview

    Hi,
    using a image control (as indicator) provided by imaq Vision, I tried to pass the reference of the control to a subVI. On a computer it works and on a other (same labview version, same vision version, same os, same hardware and hardware drivers!), this crashes labview. I tried to close the control refnum at the end of the subVI, but that changed nothing to the issue. Now I use the reference as a global variable and it seems to work...nevertheless, I would like to understand what the issue and if I should remove any passing to subVI of control ref because this can potentially triggers an error. My correlated question is if this global passing is a "fake" workaround or have real chance of improving (this before going through the whole code for changing all passing of reference to subVI)
    thanks a lot

    Hi,
    thank CoastalMaineBird for your answer
    How do you know it's this issue which causes the crash?
    When I remove this parameter from and the only property node in the subVi that write to it, I have no longer any problem. Moreover, to ensure that's really the "passing", and made a global variable containing the reference to this control and use my original SubVi that do access the control through its reference number
    , and it works! In this last exemple, the only change is the way of transmitting the reference
    What LabVIEW version?
    8.0.1
    up to date according Measurement & Automation update tool
    Given that one computer works OK, and another crashes, I would say that
    you are seeing the effect of something else, not the cause. If passing
    a control ref via terminals was fatal, it would be fatal all the time.
    You have some other sort of issue, perhaps timing of the different
    machines triggers the bug, perhaps running out of memory, perhaps
    LabVIEW is corrupted on one machine.... But I don't think changing all
    your code to use globals would solve the real problem. Actually, saying that I wonder about problem of synchronisation. I know from Visual C++ that this kind of error happens if two process try to access the same control at the same time. This is typically an error changing from a computer to an other, and mutex or semaphore are the way to deal nicely with that. But does labview contains already such a securisation? If so, the global variable point on a single object and can "fell" the semaphore/mutex. But passing make a copy that will likely have two different semaphore/mutex but will point to a single control! Do someone know if I'm wrong in this idea or not?
    Thanks

Maybe you are looking for