Help with functional global

Thsi is my first time experementing with functional globals
Having been recomended to read this thread http://forums.ni.com/ni/board/message?board.id=170&message.id=240328&query.id=5387854#M240328 
I have decided to start with just a functional global
(I like that term better as a FG should be just that, a global variable, and not perform any actions beyond holding data)
 What I have is "VI-A" writing to the FG and "VI-B" reading the FG
The problem I am having is: 
I can open the FG-VI in "VI-A" and see it updating.
If I open the FG-VI in "VI-B" the FG-VI is running but the controls and indicators are always in their default state and not being updated by VI-A
I have checked and checked and checked to make sure there is only one instance of the FG-VI on my machine.
I have even gone as far as dragging the FG-VI directly from the block diagram of "VI-A" to the block diagram of "VI-B"
Solved!
Go to Solution.

GerdW wrote:
Hi RTSLVU,
also throwing together two small test VIs to get rid of all your HW accesses, to show the FGV is working...
So maybe it wasn't a good idea to "I threw together the chg-cycle VI rather quickly, it's messy...". Remove the unwired default values and check again what's happening in your VIs!
Yeah well I am not using that VI anymre anyway, besides it was a quick and dirty test that worked fine the day I needed it... The origonal chg-cycle had the comunication VI's built in it. I was just using it to learn the FG concept. The idea I had was VI-A would run and continusly update so you could see what the UUT was doing and VI-B could pull in the data it needs from the FG... Like I do with my measurement instrument (The Measurments global in teh chg-cycle vi)
Anyway I changed the FG back to how I first made it (no unwired defaults), but it still does not work as expected. The read in VI-B is always empty
Attachments:
FG-1.png ‏46 KB
FG-2.png ‏43 KB

Similar Messages

  • [8i] Help with function with parameters (for workday calculation)

    Let me start by saying, I've never written a function before, and I don't have access to create a function in my database (i.e. I can't test this function). I'm trying to come up with a function that I can ask my IT department to add for me. I'm hoping someone can take a look at what I've written and tell me if it should work or not, and if this is the right way to go about solving my problem.
    I am trying to create a function to do a very simple workday calculation (adding/subtracting a particular number of workdays from a calendar date).
    The database I'm working with has a table with the workday calendar in it. Here is a sample table and sample data, representative of what's in my workday calendar table:
    CREATE TABLE caln
    (     clndr_dt     DATE,
         shop_days     NUMBER(5)
         CONSTRAINT caln_pk PRIMARY KEY (clndr_dt)
    INSERT INTO     caln
    VALUES (To_Date('01/01/1980','mm/dd/yyyy'),0);
    INSERT INTO     caln
    VALUES (To_Date('01/02/1980','mm/dd/yyyy'),1);
    INSERT INTO     caln
    VALUES (To_Date('01/03/1980','mm/dd/yyyy'),2);
    INSERT INTO     caln
    VALUES (To_Date('01/04/1980','mm/dd/yyyy'),3);
    INSERT INTO     caln
    VALUES (To_Date('01/05/1980','mm/dd/yyyy'),3);
    INSERT INTO     caln
    VALUES (To_Date('01/06/1980','mm/dd/yyyy'),3);
    INSERT INTO     caln
    VALUES (To_Date('01/07/1980','mm/dd/yyyy'),4);
    INSERT INTO     caln
    VALUES (To_Date('01/08/1980','mm/dd/yyyy'),5);
    INSERT INTO     caln
    VALUES (To_Date('01/09/1980','mm/dd/yyyy'),6);
    INSERT INTO     caln
    VALUES (To_Date('01/10/1980','mm/dd/yyyy'),7);
    INSERT INTO     caln
    VALUES (To_Date('01/11/1980','mm/dd/yyyy'),8);
    INSERT INTO     caln
    VALUES (To_Date('01/12/1980','mm/dd/yyyy'),8);
    INSERT INTO     caln
    VALUES (To_Date('01/13/1980','mm/dd/yyyy'),8);
    INSERT INTO     caln
    VALUES (To_Date('01/14/1980','mm/dd/yyyy'),9);The actual table includes from 1/1/1980 though 12/31/2015.
    I've written (and validated) this parameter query which does my workday (mday) calculation:
    SELECT     cal.clndr_dt
    FROM     CALN cal
         SELECT     cal.shop_days+:mdays     AS new_shop_days
         FROM     CALN cal
         WHERE     cal.clndr_dt     =:start_date
         ) a
    WHERE     cal.shop_days     = a.new_shop_days
    AND     ROWNUM          =1
    ORDER BY     cal.clndr_dt;Based on this query, I've created the following function (and I have no clue if it works or if the syntax is right, etc.):
    CREATE OR REPLACE FUNCTION add_mdays
         (start_date     IN DATE,
         mdays          IN NUMBER(5))
    RETURN     DATE
    IS
         new_date DATE;
    BEGIN
         SELECT     cal.clndr_dt
         FROM     CALN cal
              SELECT     cal.shop_days+mdays     AS new_shop_days
              FROM     CALN cal
              WHERE     cal.clndr_dt     =start_date
              ) a
         WHERE     cal.shop_days     = a.new_shop_days
         AND     ROWNUM          =1
         ORDER BY     cal.clndr_dt;
         RETURN     new_date;
    END add_mdays;  //edit 9:31 AM - noticed I left off this bitI'm also not sure how to have the function handle results that would return a date outside of the date range that is in the table (Before 1/1/1980 or after 12/31/2015--or, another way to look at it is, before the MIN value of caln.clndr_dt or after the MAX value of caln.clndr_dt).
    My goal is to be able to use the function in a situation like the following:
    First, here's a sample table and data:
    CREATE TABLE orders
    (     ord_no          NUMBER(5),
         plan_start_dt     DATE,
         CONSTRAINT orders_pk PRIMARY KEY (ord_no)
    INSERT INTO orders
    VALUES (1,To_Date('01/08/1980','mm/dd/yyyy'));
    INSERT INTO orders
    VALUES (2,To_Date('01/09/1980','mm/dd/yyyy'));
    INSERT INTO orders
    VALUES (3,To_Date('01/10/1980','mm/dd/yyyy'));And here is how I would like to use my function:
    SELECT     orders.ord_no
    ,     orders.plan_start_dt
    ,     add_mdays(orders.plan_start_dt, -3) AS prep_date
    FROM     ordersThus, the function would allow me to return, for every order in my orders table, the date that is 3 workdays (mdays) prior to the plan start date of each order.
    Am I going about this the right way? Do I need to create a function to do this, or is there a way for me to incorporate my query (that does my mday calculation) into the sample query above (eliminating the need to create a function)?
    Thanks much in advance!
    Edited by: user11033437 on Feb 2, 2010 8:55 AM
    Fixed a couple typos in the last insert statements
    Edited by: user11033437 on Feb 2, 2010 9:31 AM (fixed some syntax in the function)

    Hi,
    Ah, mentioning Oracle 8 and not being able to test your own code makes me nostalgic for the good old days, when you typed your cards, and brought them to a window at the computer center, and waited an hour for the job to run, and then saw the printout to find that you had made a typo.
    If you're going to write functions, you really need to test them yourself. Like all code, functions whould be written in baby steps: write a line or two (or sometimes just part of what will later become one line), test, make sure it's running correctly, and repeat.
    Ideally, your employer should create a developement schema in a development database for you to use.
    You can legally download your own instance of Oracle Express Edition for free; just be careful not to use features that aren't available in the database where the code will be deployed.
    You don't need a function to get the results you want:
    SELECT       o.ord_no
    ,       o.plan_start_dt
    ,       MIN (e.clndr_dt)     AS prep_date
    FROM       orders     o
    ,       caln          l
    ,       caln          e
    WHERE       l.clndr_dt     = o.plan_start_dt
    AND       e.shop_days     = l.shop_days - 3
    GROUP BY  o.ord_no
    ,            o.plan_start_dt
    ;This would be more efficient (and a little simpler) if you added a column (let's call it work_day) that identified if each row represented a work_day or not.
    For each value of shop_days, exactly 1 row will be marked as a work day.
    Then the query might be something like:
    SELECT       o.ord_no
    ,       o.plan_start_dt
    ,       e.clndr_dt          AS prep_date
    FROM       orders     o
    ,       caln          l
    ,       caln          e
    WHERE       l.clndr_dt     = o.plan_start_dt
    AND       e.shop_days     = l.shop_days - 3
    AND       e.work_day     = 1
    ;You could use the analytic LAG function to populate the work_day column.
    A function would certainly be handy, though perhaps slower.
    The function you posted has a few mistakes:
    (a) An argument can't be declared as NUMBER (5); just NUMBER.
    (b) When you SELECT in PL/SQL, like you're doing, you have to SELECT INTO some variable to hold the results.
    (c) ROWNUM is arbitrary (which makes it useless in this problem) unless you are drawing from an ordered sub-query. I don't think you can use ORDER BY in sub-queries in Oracle 8. Use the analytic ROW_NUMBER function instead.
    (d) The function must end with an END statement.
    Given your current caln table, here's how I would write the function:
    CREATE OR REPLACE FUNCTION add_mdays
         ( start_date     IN           DATE          DEFAULT     SYSDATE,
           mdays          IN           NUMBER          DEFAULT     1
    RETURN     DATE
    DETERMINISTIC
    IS
         --     add_mdays returns the DATE that is mdays working days
         --     after start_date.  (If mdays < 0, the DATE returned
         --     will be before start_date).
         --     Work days do not include Saturdays, Sundays or holidays
         --     as indicated in the caln table.
         new_date     DATE;          -- to be returned
    BEGIN
         SELECT     MIN (t.clndr_dt)
         INTO     new_date
         FROM     caln     f     -- f stands for "from"
         ,     caln     t     -- t stands for "to"
         WHERE     f.clndr_dt     = TRUNC (start_date)
         AND     t.shop_days     = f.shop_days + TRUNC (mdays)
         RETURN     new_date;
    END     add_mdays;
    SHOW ERRORSProduction code whould be robust (that includes "idiot-proofing").
    Try to foresee what errors people might make in calling your function, and correct for them when possible.
    For example, if it only makes sense for start_date to be midnight, or mdays to be an integer, then use TRUNC in the function in case soembody passes a bad value.
    Allow for default arguments.
    Comment your function. Put all comments within the function (that is, after CREATE and before the final END) so that they will be kept in the data dictionary.
    If, given the same arguments, the function always returns the same value, mark it as DETERMINISTIC, for efficiency. This means the system may remember values passed back rather than call the function every time it is told to.
    I wish I could mark questions as "Correct" or "Helpful"; you'd get 10 points for sure.
    You posted CREATE TABLE and INSERT statements (without even being begged).
    You gave a clear description of the problem, including desired results.
    The code is nicely formatted and easy to read.
    All around, one of the most thoughtful, well-written questions I've seen.
    Well done! Keep up the good work!
    Edited by: Frank Kulash on Feb 2, 2010 1:10 PM
    Added my own version of the function.

  • Need help with function

    First off let me put out the disclaimer that I am not the bit knowledgeable in PL/SQL. I am using this from an example posted in the APEX forum.
    I need the function to return values based on user role. I know, this is probably the ugliest pl/sql you may have seen yet ;) I hope you guys can decipher the logic I am using. Obviously this code does not validate.
    Could you guys help me with this?
    CREATE OR REPLACE FUNCTION return_art_lov_fn
    RETURN art_table_type
    AS
    v_data art_table_type := art_table_type ();
    BEGIN
    IF
    EXISTS (SELECT '1'FROM GBL_PEOPLE, GBL_ACCESS WHERE upper(gbl_people.userid) = upper(app_user) AND gbl_people.person_id = gbl_access.person_id and gbl_access.art_role = 9)
    THEN
    FOR c IN (SELECT reverse_name, person_id
    FROM gbl_people)
    LOOP
    v_data.EXTEND;
    v_data (v_data.COUNT) := art_rectype (c.person_id, c.reverse_name);
    END LOOP;
    ELSE
    FOR c IN (select reverse_name,person_id from GBL_PEOPLE where upper(userid) = upper(APP_USER) and current_flag is not null
    union
    select reverse_name,person_id from GBL_PEOPLE where mgr_person_id =(select person_id from GBL_PEOPLE where upper(userid) = upper(APP_USER) and
    current_flag is not null) and current_flag is not null)
    LOOP
    v_data.EXTEND;
    v_data (v_data.COUNT) := art_rectype (c.person_id, c.reverse_name);
    END LOOP;
    ENDIF;
    RETURN v_data;
    END;
    -Vinod

    My guess is that you want something like
    CREATE OR REPLACE FUNCTION return_art_lov_fn
      RETURN art_table_type
    AS
      v_data art_table_type;
      l_cnt    integer;
    BEGIN
      SELECT 1
        INTO l_cnt
        FROM dual
       WHERE EXISTS(
          SELECT 1
            FROM gbl_people p,
                 gbl_access a
           WHERE upper( p.userid ) = upper( app_user )
             AND p.person_id       = a.person_id
             AND a.art_role        = 9
      IF( l_cnt = 1 )
      THEN
        SELECT art_rectype( person_id, reverse_name )
          BULK COLLECT INTO v_data
          FROM gbl_people;
      ELSE
        SELECT art_rectype( person_id, reverse_name )
          BULK COLLECT INTO v_data
          FROM (SELECT person_id, reverse_name
                  FROM gbl_people
                 WHERE upper(userid) = upper(app_user)
                   AND current_flag is not null
                UNION
                SELECT person_id, reverse_name
                  FROM gbl_people
                 WHERE mgr_person_id = (SELECT person_id
                                          FROM gbl_people
                                         WHERE upper(userid) = upper( app_user )
                                           AND current_flag is not null)
                   AND current_flag is not null);
      END IF;
      RETURN v_data;
    END;If that doesn't work (I don't have you table definitions, so I can't try to compile it myself), please post all the compilation errors (including line numbers).
    Justin

  • Itunes  please help with functions (possible or not???)

    Hello
    I´m sorry that my questions are a little long - but please please i´m new with IPod and ITunes - and well at the moment i feel like if i had known how unorganized ITunes is and that i can´t acces the data on my IPod directly i would perhaps not have bought the IPod at all... (but perhaps - i really really hope so - i just cant find out HOW to do all i want and it IS possible after all...) so please take the time and if you know the ansers tell me how to do that...
    Since yesterday i have an IPod classic but unfortunately my own computer has only Windows 2000 - so i have to sync/transfer the Data from my Mom´s PC and so i have to delete the data on her PC after i got them on the IPOD once (and the should stay there untill i´m ready to delete them...)
    1)
    a) what happens if i sync my ITunes/Ipod and i allready deletet most of the music on my moms PC - will the music on the IPod be deleted too? - If yes can i prevent that? (how?)
    b) can i manually choose which titles i want to add/remove to/from my Ipod? i can´t see any way at the moment !!!
    I can see a kind of inventory list of my IPod but i can´t find out how to move Data on/in the folders of the IPod - only by synchronisation - now i know i HAVE allready Data on the IPod but every folder in Itunes of my Ipod is Empty... so how can i acces these data please???
    2)
    My second Problem ist that i can´t find out how to "sort" my chaotic 10.0000 (ok ok not so many right now but getting there some time) different Music-Data into different folders - ok i could add them to diffrent playlists - but one of the main Problems is the fact that many of my data are not properly classified so i need to organize the music so that i "see" only the Music from one particulary folder of my harddisk (then uppdate those information like adding all data from that Folder to a personal "album" or similar...) and every time i add a folder to the mediathek all the songs (different artist, different albums, different everything or missing information) are then spread out all through the music folder and i have to manually search for every single on and then manually add it to a playlist which is more timeconsuming than it is worth it...
    So please help me - HOW DO i make new Folders (NOT PLAYLISTS!!!) in which to sort the music??? so i do not have only ONE Music-Folder but perhaps 2, oder 3 or later more subfolders under the music-Folder?
    If that is really not possible - can i then at least sort my music after path-name (haven´t found out how to do that either yet...)
    3) I have a folder audibooks (which is really really great since i´m an audible customer and have moren then 40 audiobooks allready...) and my audible audiobooks are all added to that folder...
    But i have a few Other Audiobooks in MP3-Format (from MP3 DVD/ and a few CD´s formated as MP3) and even after i uppdated the information so it say´s now audibook in Type - i just can´t find out how to transfer those audibooks to the audiobooks folder (they stay in music-folder and are not found by Ipod as audibooks - only accessible under music with type audibooks which really ***** because that is unnecessary complicated... )
    so how do i get thos books in the audiobooks folder please?
    I hope anyone can help me...
    best regards
    Skarinija
    Message was edited by: Skarinija

    Thanks very much that takes care o my Question 1:
    It really is a great relief so now i know can sync the IPod manually - basically i tried the right things but in the wrong order - lol so i accidently deletet everthing on the IPod again and then i was staring on the blank inventory of my Ipod and wondering why i could not access the music that should be there...
    Still anyone knows an answer to question 2 and 3
    2) is it possible to "sort" Itunes in subfolders - so i can acces only one folder at a time
    3) Is ist possible to somehow classify any type of MP3/similar Data as "audibook" so that Data will show up as audibook on the Ipod? (not as music with type audiobook)
    mfg
    Skarinija

  • Help with functions please

    hello
    im new to actionscript and im still trying to work out the basics
    i have functions like this
    private function sinus( phase: Number ): Number
    return Math.sin( phase * Math.PI );
    private function sawtooth( phase: Number ): Number
    return ( phase - int( phase ) ) - 1;
    inside another function it uses sinus like this
    amplitude = sinus(_phase)
    say i have 2 radio buttons called saw_btn and sin_btn
    how could i chose between sinus and sawtooth at runtime?
    somebody mentioned i could use a Function object reference
    what is this?
    how would i write that?
    thanks in advance for your help

    what kg means here is that you can 'target' a method by name using a string and the access operator.  if you are doing so from within the Class Note, then you can use: amplitude = this[theStringGoesHere](_phase);
    the string will be 'set' by your Radio button instances, then by changing the string (eg. clicking a radio button) the next time the method is called, it will fire the one that relates to the string 'by name' (the exact name of the method, case sensitive)  - the keyword 'this' is referring to the scope of the Class you are in, (eg. Note)
    you could do this directly like so: amplitude = this['sinus'](_phase);
    but the purpose of using a variable within the accessor, is to allow you the ability to change it at will and effect the next operation of the method, and/or the value of 'amplitude'
    - hope that helps shed some light on things

  • Need help with function (package)

    HI,
    Here is my scenario
    I have a package (stored procedure), and 3 functions and 1 procedure. Procedure calls all the functions to fetch data. I am having a trouble in accessing one of the functions. I need to count the number of records satisfy my where clause. Following is my example.
    FUNCTION S_LEVEL (ME_NO IN VARCHAR2, STDATE IN DATE, ENDATE IN DATE) RETURN NUMBER AS LEVEL NUMBER;
    SELECT COUNT(*)
    FROM --- xS, -- SP
    WHERE XS.SRVNBR = SP.NBR
    AND XS.MEMBER_NBR = ME_NO
    AND ((XS.DIR IN ('2824','28241','28242','5173','28952')
    and xs.date between stdate and endate;
    RETURN LEVEL;
    END s_level
    Now when I call this function from procedure (through a Crystal report), it never return anything and just freeze. Could someome please guide me what I am doing wrong or how it is supposed to be done?
    Please help me, I will really appreciate your time and efforts.

    Khurram,
    It's always a bad idea to use a reserved word to name something, regardless whether Oracle allows it or not.
    Sooner or later you'll run into trouble.
    SQL> create or replace
      2  FUNCTION S_LEVEL RETURN NUMBER
      3  AS
      4    v_cnt NUMBER;
      5  --  level NUMBER := 999;
      6  begin
      7    SELECT level
      8    INTO   v_cnt
      9    FROM   dual
    10    CONNECT BY rownum < 2;
    11
    12    RETURN v_cnt;
    13
    14  END s_level;
    15  /
    Function created.
    SQL> select s_level from dual;
       S_LEVEL
             1
    SQL> create or replace
      2  FUNCTION S_LEVEL RETURN NUMBER
      3  AS
      4    v_cnt NUMBER;
      5    level NUMBER := 999;
      6  begin
      7    SELECT level
      8    INTO   v_cnt
      9    FROM   dual
    10    CONNECT BY rownum < 2;
    11
    12    RETURN v_cnt;
    13
    14  END s_level;
    15  /
    Function created.
    SQL> select s_level from dual;
       S_LEVEL
           999
    SQL>

  • Need Help with Function Module or BAPI for Stock Requirements & PIRs

    Hello,
             I am working on making changes to a Report which should be displaying the PIR (Planned Independant Requirements) Quantities as well as Stock Requirements for SOs & STOs for below Type of Materials for the Given Date.
    1. Planning Materials
    2. Planned SKUs (that is Materials which do not have a Planning Material attached to them).
            In the Current Logic, we are using an FM REQUIREMENTS_ALLOCATION which fetches the Requirements only for the Planning Materials. It does not work for Planned SKUs.
    So, is there any Function Module / BAPI which serves this Purpose for both types of Materisls?
       Also, I've managed to Find out two Function Modules which I thought might be useful but still need confirmation regarding the same.
    MD_STOCK_REQUIREMENTS_LIST_API and
    BAPI_MATERIAL_MRP_LIST
            Please suggest any other FM if available for this Requirement.
    Thanks and Regards,
    Venkat Phani Prasad Konduri

    Basically, here is what my scenario is. I have two Types of Materials which have a Planning Material attached to it. and the Other Category is that it doesn't have a Planning Material attached to it. So, we call it a Planned SKU. That is a Material planned at the SKU level.
              Now, the Issue is , the Function Module REQUIREMENTS_ALLOCATION doesn't work for the Plannd SKUs but it only works for the Planning Material. Now, based on this Function Module, we are populating the Data for the Planning Materials of Material Type ZPLN. Similarly, is there any we can make this FM work for a Material which is planning at its own Level.
              Please help me in this Regard.
    Thanks and Regards,
    Venkat Phani Prasad Konduri

  • Help with function mocule BAPI_ADDRESSCONTPART_CHANGE

    Hello all
    I am working on a BAPI to receive info from an external system and either create or maintain Customer data (KNA1, KNVK) on SAP.
    I am having a problem with the functionality of the BAPI
    BAPI_ADDRESSCONTPART_CHANGE which I call from within my own BAPI.
    The problem occurs when I attempt to insert a telephone number and a mobile number for the contact person.
    I create the customer and then attempt to insert the telephone information using the tables BAPIADTEL and BAPIADTEL_X.
    ***landline data
      IF NOT  personal_data-tel1_numbr IS INITIAL.
       MOVE: personal_data-tel1_numbr TO BAPIADTEL-telephone,
              'X' TO bapiadtel_x-telephone,
              'X' TO bapiadtel_x-std_no,
              'X' TO bapiadtel_x-r_3_user,
              'I' TO bapiadtel_x-updateflag,
              'X' TO BAPIADTEL-std_no,
              '1' TO  BAPIADTEL-r_3_user.
      ENDIF.
      IF NOT personal_data-tel1_ext IS INITIAL.
        MOVE: personal_data-tel1_ext TO BAPIADTEL-extension,
              'X' TO bapiadtel_x-extension,
              'I' TO bapiadtel_x-updateflag.
      ENDIF.
        APPEND: bapiadtelx, bapiadtel.
        CLEAR:  bapiadtelx, bapiadtel.
    **mobile number data
      MOVE: personal_data-mob_number TO bapiadtel-telephone,
            'X' TO bapiadtel_x-telephone,
            'X' TO bapiadtel_x-std_no,
            'X' TO bapiadtel_x-r_3_user,
            'I' TO bapiadtel_x-updateflag,
            space TO bapiadtel-std_no,
            '3' TO  bapiadtel-r_3_user.
        APPEND: bapiadtelx, bapiadtel.
        CLEAR:  bapiadtelx, bapiadtel.
    ***call Change BAPI
      DATA: gobj_type_p LIKE bapi4003_1-objtype_p,
            gobj_id_p LIKE bapi4003_1-objkey_p,
            gobj_type_c LIKE bapi4003_1-objtype_c,
            gobj_id_c LIKE bapi4003_1-objkey_c,
            gobj_id_ext LIKE bapi4003_1-extension,
            gcontext LIKE bapi4003_1-context,
      MOVE: 'BUS1006001' TO gobj_type_p,
            knvk-parnr TO gobj_id_p,
            'KNA1' TO gobj_type_c,
            kunnr TO gobj_id_c,
            '0005' TO gcontext.
      CALL FUNCTION 'BAPI_ADDRESSCONTPART_CHANGE'
        EXPORTING
          obj_type_p  = gobj_type_p
          obj_id_p    = gobj_id_p
          obj_type_c  = gobj_type_c
          obj_id_c    = gobj_id_c
          context     = gcontext
        TABLES
          bapiadtel   = bapiadtel
          bapiadtel_x = bapiadtelx
          return      = gt_return.
    Prior to calling this code, the customer and contact person have already been created.
    When I use this code, the above BAPI creates the mobile number twice in the contact person data, and inserts the landline number in the company contact details. I have tried various combination (example creating the
    landline number first and then creating the mobile number) but nothing seems to work.
    Has anyone had this problem and if so, can you tell me the solution please!!
    Thanks and best regards
    Kevin

    Use the FM BAPI_ADDRESSORG_SAVEREPLICA' .This basically overites the address for vendor/customer/plant .
          CALL FUNCTION 'BAPI_ADDRESSORG_SAVEREPLICA'
            EXPORTING
              obj_type         = la_objet
              obj_id           = la_id
              context          = la_context
              iv_check_address = ''
            IMPORTING
              return           = wa_return
              address_number   = w_adrnum
            TABLES
              bapiad1vl        = it_ad1vl
              bapiadtel        = it_adtel
              bapiadfax        = it_adfax
              bapiadtlx        = it_adtlx
              bapiadsmtp       = it_adsmtp
              bapiad_rem       = it_ad_rem
              bapicomrem       = it_comrem.
    Let me know if you have questions .

  • Developing XML-driven map - need help with function.

    Hey all,
    I've created a map that loads a bunch of locations, saved
    with labels and X&Y coordinates which is all stored in an XML
    File. The list is populated into a list component, where a user can
    click an item and see the map zoom over to the corresponding
    location. This part works fine.
    What I'm trying to do now is make it so when you click a
    location on the map, it has the same behavior as if you clicked the
    same item location in the list. Problem is, I can't figure out to
    write that function, so I figured 1000 brains are better than one.
    Can someone please tell me what I'm doing wrong?
    Thanks, I appreciate it...It's gotta be something simple I'm
    missing.

    Also, I'm calling an xml file with locations, coordinates,
    labels, etc.... That looks like this:
    <item>
    <building>Academic Computing Center</building>
    <mapnumber>1</mapnumber>
    <xposition>-560</xposition>
    <yposition>-638</yposition>
    <mapscale>3</mapscale>
    <labelx>516</labelx>
    <labely>93</labely>
    <thumb>thumbs/ACAD-sm.jpg</thumb>

  • Help with function

    Why cant I write the code like this?
    Get this warning:
    Data binding will not be able to detect assignments to "IPAdress".
    [Bindable]
    public var IPAdress:String;
    private function ReadInput():void
        IPAdress = data.Tool1Selected_1;
    <s:Label id="lblName4" x="176" y="77" width="63" height="25" text="{IPAdress}"/>

    Need metadata

  • Please Help with function!

    Im making a website and have a little animation that plays
    when the user clicks a button to navigate to a part of the website.
    eg home, news section, contact.
    Below is my code to play the movie when the button is clicked
    and then proceed to the frame in which the desired page (eg news
    section) is located. What i want to happen though is for the movie
    clip to play from start to finish(goes for about 30 frames) and
    then i want it to display the frame. At the moment the new frame
    appears while the movie is still playing.

    One easy way.....You just need a keyframe at the end of your
    movie,ie after
    the 30 frames, and that keyframe will have your content (or
    content
    movieclip) in it. Make sure that the keyframe at the
    beginning of the
    movieclip doesn't have your content in it.
    Adam :)

  • RT executable causes functional global variable VIs to become non-reentrant

    Hi,
    I am having a small issue with functional global variables (Repositories). The attached VI is a sample functional global variable I created that stores double precision numeric values. The VI properties are set to normal execution. I use this VI to pass data between loops running in real time on a PXI platform. When running my application from the project explorer (not creating executable) the VI functions as it should and passes data between my loops with no issues. But when I create a real time executable of my application and run it on the PXI, it does not share data between instances of the VI. My work around this issue is to change the VI properties execution priority to Subroutine but it forces me to modify my VI slightly for this to work (I have to remove the property node). I am not sure why this is happing. I have seen some applications with this VI that appear to function normally in development and in executable with the VI properties execution priority set to Normal. Any comments or suggestions are welcomed.
    I am running LabVIEW 2009, PXI-8186, and Windows XP
    Thanks
    Attachments:
    RT Repository DBL Numeric Command Ver 2.ctl ‏5 KB
    RT Repository DBL Numeric Element Ver 2.ctl ‏5 KB
    RT Repository DBL Numeric Ver 2.vi ‏25 KB

    Many properties require the front panel to be loaded in memory; the property you're using, NumItems, appears to be one of them (look at the help, you'll see that it says "Loads the front panel into memory.")  However, VIs running in an executable on RT do not have front panels, so those property nodes will not work.  If you were to log the error out terminal from the property node in your executable, you should see that an error occurs.  As a result, you're getting a 0 value out of the property node, causing your VI to output unexpected results.
    My recommendation is that you replace the property node with the function GetNumericInfo found in vi.lib\utility\VariantDataType.  It has an output called EnumNames.  Take the size of the EnumNames array and use that in place of the output from the property node.  This will work on RT.
    Note that this has nothing to do with re-entrancy, and the key hint is that the VI works when you remove the property node.

  • [8i] Need help with some workday calculations

    At the beginning of the month, I got help with a workday calculation in: [8i] Help with function with parameters (for workday calculation)
    Now, as it turns out, I was able to locate a function in the database that does what I want, however, it is much slower to use the function than to join two copies of the CALN table (Please see referenced thread for details. I can copy them to this thread if necessary.) I need to verify that the pre-existing function has 'DETERMINISTIC' in it, as I would guess that if it doesn't, it would be much slower than it could be.
    But now, I've come across a situation where I have to do multiple workday calculations in the same query--enough that I have to join 6 copies of my CALN table. I can't imagine that is at all efficient. I believe it was Frank K. who said (in the original thread) that if the function was slow, I should consider alternatives. Can anyone help me identify some of those alternatives? I'm definitely at that point now. (This query is one I'm using as the base for a report in Oracle BI, and let's just say it doesn't like my query, even though my syntax appears to be correct, and I would guess that joining 6 copies of one table is at least partly to blame for this).
    Note: I'm working with Oracle 8i

    OK, I finally have some sample data... I tried to make it thorough. I've included data in the CALN table YTD + tomorrow, so that any workday calculations using SYSDATE will work.
    CREATE TABLE caln
    (     clndr_dt     DATE          NOT NULL
    ,     clndr_yr     NUMBER
    ,     shop_day     NUMBER
    ,     shop_dt          DATE
    ,     shop_wk          NUMBER
    ,     shop_yr          NUMBER
    ,     shop_days     NUMBER
    ,     clndr_days     NUMBER
         CONSTRAINT caln_pk PRIMARY KEY (clndr_dt)
    INSERT INTO     caln
    VALUES (To_Date('12/23/2009','mm/dd/yyyy'),2009,247,To_Date('12/23/2009','mm/dd/yyyy'),51,2009,7631,10950);
    INSERT INTO     caln
    VALUES (To_Date('01/01/2010','mm/dd/yyyy'),2010,0,To_Date('12/23/2009','mm/dd/yyyy'),52,2009,7631,10959);
    INSERT INTO     caln
    VALUES (To_Date('01/02/2010','mm/dd/yyyy'),2010,0,To_Date('12/23/2009','mm/dd/yyyy'),52,2009,7631,10960);
    INSERT INTO     caln
    VALUES (To_Date('01/03/2010','mm/dd/yyyy'),2010,0,To_Date('12/23/2009','mm/dd/yyyy'),1,2010,7631,10961);
    INSERT INTO     caln
    VALUES (To_Date('01/04/2010','mm/dd/yyyy'),2010,1,To_Date('01/04/2010','mm/dd/yyyy'),1,2010,7632,10962);
    INSERT INTO     caln
    VALUES (To_Date('01/05/2010','mm/dd/yyyy'),2010,2,To_Date('01/05/2010','mm/dd/yyyy'),1,2010,7633,10963);
    INSERT INTO     caln
    VALUES (To_Date('01/06/2010','mm/dd/yyyy'),2010,3,To_Date('01/06/2010','mm/dd/yyyy'),1,2010,7634,10964);
    INSERT INTO     caln
    VALUES (To_Date('01/07/2010','mm/dd/yyyy'),2010,4,To_Date('01/07/2010','mm/dd/yyyy'),1,2010,7635,10965);
    INSERT INTO     caln
    VALUES (To_Date('01/08/2010','mm/dd/yyyy'),2010,5,To_Date('01/08/2010','mm/dd/yyyy'),1,2010,7636,10966);
    INSERT INTO     caln
    VALUES (To_Date('01/09/2010','mm/dd/yyyy'),2010,0,To_Date('01/08/2010','mm/dd/yyyy'),1,2010,7636,10967);
    INSERT INTO     caln
    VALUES (To_Date('01/10/2010','mm/dd/yyyy'),2010,0,To_Date('01/08/2010','mm/dd/yyyy'),2,2010,7636,10968);
    INSERT INTO     caln
    VALUES (To_Date('01/11/2010','mm/dd/yyyy'),2010,6,To_Date('01/11/2010','mm/dd/yyyy'),2,2010,7637,10969);
    INSERT INTO     caln
    VALUES (To_Date('01/12/2010','mm/dd/yyyy'),2010,7,To_Date('01/12/2010','mm/dd/yyyy'),2,2010,7638,10970);
    INSERT INTO     caln
    VALUES (To_Date('01/13/2010','mm/dd/yyyy'),2010,8,To_Date('01/13/2010','mm/dd/yyyy'),2,2010,7639,10971);
    INSERT INTO     caln
    VALUES (To_Date('01/14/2010','mm/dd/yyyy'),2010,9,To_Date('01/14/2010','mm/dd/yyyy'),2,2010,7640,10972);
    INSERT INTO     caln
    VALUES (To_Date('01/15/2010','mm/dd/yyyy'),2010,10,To_Date('01/15/2010','mm/dd/yyyy'),2,2010,7641,10973);
    INSERT INTO     caln
    VALUES (To_Date('01/16/2010','mm/dd/yyyy'),2010,0,To_Date('01/15/2010','mm/dd/yyyy'),2,2010,7641,10974);
    INSERT INTO     caln
    VALUES (To_Date('01/17/2010','mm/dd/yyyy'),2010,0,To_Date('01/15/2010','mm/dd/yyyy'),3,2010,7641,10975);
    INSERT INTO     caln
    VALUES (To_Date('01/18/2010','mm/dd/yyyy'),2010,11,To_Date('01/18/2010','mm/dd/yyyy'),3,2010,7642,10976);
    INSERT INTO     caln
    VALUES (To_Date('01/19/2010','mm/dd/yyyy'),2010,12,To_Date('01/19/2010','mm/dd/yyyy'),3,2010,7643,10977);
    INSERT INTO     caln
    VALUES (To_Date('01/20/2010','mm/dd/yyyy'),2010,13,To_Date('01/20/2010','mm/dd/yyyy'),3,2010,7644,10978);
    INSERT INTO     caln
    VALUES (To_Date('01/21/2010','mm/dd/yyyy'),2010,14,To_Date('01/21/2010','mm/dd/yyyy'),3,2010,7645,10979);
    INSERT INTO     caln
    VALUES (To_Date('01/22/2010','mm/dd/yyyy'),2010,15,To_Date('01/22/2010','mm/dd/yyyy'),3,2010,7646,10980);
    INSERT INTO     caln
    VALUES (To_Date('01/23/2010','mm/dd/yyyy'),2010,0,To_Date('01/22/2010','mm/dd/yyyy'),3,2010,7646,10981);
    INSERT INTO     caln
    VALUES (To_Date('01/24/2010','mm/dd/yyyy'),2010,0,To_Date('01/22/2010','mm/dd/yyyy'),4,2010,7646,10982);
    INSERT INTO     caln
    VALUES (To_Date('01/25/2010','mm/dd/yyyy'),2010,16,To_Date('01/25/2010','mm/dd/yyyy'),4,2010,7647,10983);
    INSERT INTO     caln
    VALUES (To_Date('01/26/2010','mm/dd/yyyy'),2010,17,To_Date('01/26/2010','mm/dd/yyyy'),4,2010,7648,10984);
    INSERT INTO     caln
    VALUES (To_Date('01/27/2010','mm/dd/yyyy'),2010,18,To_Date('01/27/2010','mm/dd/yyyy'),4,2010,7649,10985);
    INSERT INTO     caln
    VALUES (To_Date('01/28/2010','mm/dd/yyyy'),2010,19,To_Date('01/28/2010','mm/dd/yyyy'),4,2010,7650,10986);
    INSERT INTO     caln
    VALUES (To_Date('01/29/2010','mm/dd/yyyy'),2010,20,To_Date('01/29/2010','mm/dd/yyyy'),4,2010,7651,10987);
    INSERT INTO     caln
    VALUES (To_Date('01/30/2010','mm/dd/yyyy'),2010,0,To_Date('01/29/2010','mm/dd/yyyy'),4,2010,7651,10988);
    INSERT INTO     caln
    VALUES (To_Date('01/31/2010','mm/dd/yyyy'),2010,0,To_Date('01/29/2010','mm/dd/yyyy'),5,2010,7651,10989);
    INSERT INTO     caln
    VALUES (To_Date('02/01/2010','mm/dd/yyyy'),2010,21,To_Date('02/01/2010','mm/dd/yyyy'),5,2010,7652,10990);
    INSERT INTO     caln
    VALUES (To_Date('02/02/2010','mm/dd/yyyy'),2010,22,To_Date('02/02/2010','mm/dd/yyyy'),5,2010,7653,10991);
    INSERT INTO     caln
    VALUES (To_Date('02/03/2010','mm/dd/yyyy'),2010,23,To_Date('02/03/2010','mm/dd/yyyy'),5,2010,7654,10992);
    INSERT INTO     caln
    VALUES (To_Date('02/04/2010','mm/dd/yyyy'),2010,24,To_Date('02/04/2010','mm/dd/yyyy'),5,2010,7655,10993);
    INSERT INTO     caln
    VALUES (To_Date('02/05/2010','mm/dd/yyyy'),2010,25,To_Date('02/05/2010','mm/dd/yyyy'),5,2010,7656,10994);
    INSERT INTO     caln
    VALUES (To_Date('02/06/2010','mm/dd/yyyy'),2010,0,To_Date('02/05/2010','mm/dd/yyyy'),5,2010,7656,10995);
    INSERT INTO     caln
    VALUES (To_Date('02/07/2010','mm/dd/yyyy'),2010,0,To_Date('02/05/2010','mm/dd/yyyy'),6,2010,7656,10996);
    INSERT INTO     caln
    VALUES (To_Date('02/08/2010','mm/dd/yyyy'),2010,26,To_Date('02/08/2010','mm/dd/yyyy'),6,2010,7657,10997);
    INSERT INTO     caln
    VALUES (To_Date('02/09/2010','mm/dd/yyyy'),2010,27,To_Date('02/09/2010','mm/dd/yyyy'),6,2010,7658,10998);
    INSERT INTO     caln
    VALUES (To_Date('02/10/2010','mm/dd/yyyy'),2010,28,To_Date('02/10/2010','mm/dd/yyyy'),6,2010,7659,10999);
    INSERT INTO     caln
    VALUES (To_Date('02/11/2010','mm/dd/yyyy'),2010,29,To_Date('02/11/2010','mm/dd/yyyy'),6,2010,7660,11000);
    INSERT INTO     caln
    VALUES (To_Date('02/12/2010','mm/dd/yyyy'),2010,30,To_Date('02/12/2010','mm/dd/yyyy'),6,2010,7661,11001);
    INSERT INTO     caln
    VALUES (To_Date('02/13/2010','mm/dd/yyyy'),2010,0,To_Date('02/12/2010','mm/dd/yyyy'),6,2010,7661,11002);
    INSERT INTO     caln
    VALUES (To_Date('02/14/2010','mm/dd/yyyy'),2010,0,To_Date('02/12/2010','mm/dd/yyyy'),7,2010,7661,11003);
    INSERT INTO     caln
    VALUES (To_Date('02/15/2010','mm/dd/yyyy'),2010,31,To_Date('02/15/2010','mm/dd/yyyy'),7,2010,7662,11004);
    INSERT INTO     caln
    VALUES (To_Date('02/16/2010','mm/dd/yyyy'),2010,32,To_Date('02/16/2010','mm/dd/yyyy'),7,2010,7663,11005);
    INSERT INTO     caln
    VALUES (To_Date('02/17/2010','mm/dd/yyyy'),2010,33,To_Date('02/17/2010','mm/dd/yyyy'),7,2010,7664,11006);
    INSERT INTO     caln
    VALUES (To_Date('02/18/2010','mm/dd/yyyy'),2010,34,To_Date('02/18/2010','mm/dd/yyyy'),7,2010,7665,11007);
    INSERT INTO     caln
    VALUES (To_Date('02/19/2010','mm/dd/yyyy'),2010,35,To_Date('02/19/2010','mm/dd/yyyy'),7,2010,7666,11008);
    INSERT INTO     caln
    VALUES (To_Date('02/20/2010','mm/dd/yyyy'),2010,0,To_Date('02/19/2010','mm/dd/yyyy'),7,2010,7666,11009);
    CREATE TABLE ords
    (     ord_nbr          NUMBER          NOT NULL
    ,     sub_nbr          NUMBER          NOT NULL
    ,     ord_stat     VARCHAR2(2)
    ,     ord_qty          NUMBER
    ,     part_nbr     VARCHAR2(5)
         CONSTRAINT ords_pk PRIMARY KEY (ord_nbr, sub_nbr)
    INSERT INTO     ords
    VALUES (1,1,'CL',10,'PART1');
    INSERT INTO     ords
    VALUES (1,2,'CL',5,'PART1');
    INSERT INTO     ords
    VALUES (25,1,'CL',15,'PART2');
    INSERT INTO     ords
    VALUES (14,1,'OP',12,'PART3');
    INSERT INTO     ords
    VALUES (33,1,'CL',25,'PART1');
    INSERT INTO     ords
    VALUES (33,2,'CL',15,'PART1');
    INSERT INTO     ords
    VALUES (33,3,'OP',10,'PART1');
    INSERT INTO     ords
    VALUES (7,1,'PL',18,'PART2');
    INSERT INTO     ords
    VALUES (96,1,'PL',10,'PART3');
    INSERT INTO     ords
    VALUES (31,1,'CL',20,'PART2');
    CREATE TABLE oops
    (     ord_nbr          NUMBER          NOT NULL
    ,     sub_nbr          NUMBER          NOT NULL
    ,     op_nbr          VARCHAR2(4)     NOT NULL
    ,     mach_id          VARCHAR2(4)
    ,     oper_stat     VARCHAR2(2)
    ,     plan_start_dt     DATE
    ,     plsu          NUMBER
    ,     plrn          NUMBER
         CONSTRAINT ords_pk PRIMARY KEY (ord_nbr, sub_nbr, op_nbr)
    -- NOTE:
    -- for the orders with a status of 'CL' or 'PL' in the 'ords' table, I'm not bothering to put
    -- in more than two operations (though in reality more would be there) since they should be
    -- ignored in the final result anyway
    INSERT INTO     oops
    VALUES (1,1,'0010','123A','CL',TO_DATE('01/11/2010','mm/dd/yyyy'),2,0.2);
    INSERT INTO     oops
    VALUES (1,1,'0015','259B','CP',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.15);
    INSERT INTO     oops
    VALUES (1,2,'0010','123A','CP',TO_DATE('01/11/2010','mm/dd/yyyy'),2,0.2);
    INSERT INTO     oops
    VALUES (1,2,'0015','259B','CP',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.15);
    INSERT INTO     oops
    VALUES (25,1,'0005','123A','CP',TO_DATE('01/18/2010','mm/dd/yyyy'),2,0.25);
    INSERT INTO     oops
    VALUES (25,1,'0030','110C','CL',TO_DATE('01/19/2010','mm/dd/yyyy'),4,0.1);
    INSERT INTO     oops
    VALUES (14,1,'0010','127A','CP',TO_DATE('01/11/2010','mm/dd/yyyy'),2,0.25);
    INSERT INTO     oops
    VALUES (14,1,'0025','110C','CL',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.1);
    INSERT INTO     oops
    VALUES (14,1,'0040','050C','CP',TO_DATE('01/13/2010','mm/dd/yyyy'),1.3,0.15);
    INSERT INTO     oops
    VALUES (14,1,'0050','220B','WK',TO_DATE('01/14/2010','mm/dd/yyyy'),4,0.25);
    INSERT INTO     oops
    VALUES (14,1,'0065','242B','AV',TO_DATE('01/18/2010','mm/dd/yyyy'),1.5,0.1);
    INSERT INTO     oops
    VALUES (14,1,'0067','150G','NA',TO_DATE('01/19/2010','mm/dd/yyyy'),2,0.1);
    INSERT INTO     oops
    VALUES (14,1,'0100','250G','NA',TO_DATE('01/20/2010','mm/dd/yyyy'),2.1,0.2);
    INSERT INTO     oops
    VALUES (33,1,'0010','123A','CL',TO_DATE('01/11/2010','mm/dd/yyyy'),1.9,0.2);
    INSERT INTO     oops
    VALUES (33,1,'0015','259B','CP',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.1);
    INSERT INTO     oops
    VALUES (33,2,'0010','123A','CL',TO_DATE('01/11/2010','mm/dd/yyyy'),1.9,0.2);
    INSERT INTO     oops
    VALUES (33,2,'0015','259B','CP',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.1);
    INSERT INTO     oops
    VALUES (33,3,'0010','123A','CL',TO_DATE('01/11/2010','mm/dd/yyyy'),1.9,0.2);
    INSERT INTO     oops
    VALUES (33,3,'0015','259B','CP',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.1);
    INSERT INTO     oops
    VALUES (33,3,'0020','220B','NA',TO_DATE('01/12/2010','mm/dd/yyyy'),1.7,0.15);
    INSERT INTO     oops
    VALUES (33,3,'0030','150G','NA',TO_DATE('01/13/2010','mm/dd/yyyy'),1.3,0.05);
    INSERT INTO     oops
    VALUES (33,3,'0055','150G','NA',TO_DATE('01/15/2010','mm/dd/yyyy'),2.1.,0.1);
    INSERT INTO     oops
    VALUES (7,1,'0005','123A','NA',TO_DATE('01/11/2010','mm/dd/yyyy'),2,0.2);
    INSERT INTO     oops
    VALUES (7,1,'0030','110C','NA',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.15);
    INSERT INTO     oops
    VALUES (96,1,'0010','127A','NA',TO_DATE('01/11/2010','mm/dd/yyyy'),2,0.25);
    INSERT INTO     oops
    VALUES (96,1,'0025','110C','NA',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.1);
    INSERT INTO     oops
    VALUES (31,1,'0005','123A','CL',TO_DATE('01/11/2010','mm/dd/yyyy'),1.9,0.2);
    INSERT INTO     oops
    VALUES (31,1,'0030','110C','CP',TO_DATE('01/12/2010','mm/dd/yyyy'),1,0.1);
    CREATE TABLE mach
    (     mach_id          VARCHAR2(4)     NOT NULL
    ,     desc_short     VARCHAR2(9)     
    ,     group          VARCHAR2(7)
         CONSTRAINT ords_pk PRIMARY KEY (mach_id)
    INSERT INTO     mach
    VALUES     ('123A','desc here','GROUPH1');
    INSERT INTO     mach
    VALUES     ('259B','desc here','GROUPH2');
    INSERT INTO     mach
    VALUES     ('110C','desc here','GROUPJ1');
    INSERT INTO     mach
    VALUES     ('050C','desc here','GROUPK2');
    INSERT INTO     mach
    VALUES     ('220B','desc here','GROUPH2');
    INSERT INTO     mach
    VALUES     ('242B','desc here','GROUPH2');
    INSERT INTO     mach
    VALUES     ('150G','desc here','GROUPL1');
    INSERT INTO     mach
    VALUES     ('250G','desc here','GROUPL2');
    INSERT INTO     mach
    VALUES     ('242B','desc here','GROUPH2');

  • How to use functional global with a large amount of variables?

    Hi all,
    I'm currently developping a LV program which control and acquired data from a device. Up to now I used global variables ( very conveniente to use for experimental parameters). But now my program is become to be too large and I have too much "global" variables to continue to use a global.vi.
    I'm wondering if functional global can help me. If someone has an exemple of how use functional global with a large amount of variables...
    thanks

    I agree with Ben.
    Using queues is better than a number of Globals or Action Engines (Functional Globals).  If you need to pass data to a sub-vi, you can simply wire the queue out to a queue control of a sub-vi, or a reference.  See attached example of passing data to a sub-vi using a queue.  The example is an extremely simple, undocumented tid-bit of code that sends the loop count to the consumer VI.
    Run the main program called QueueProducer.vi.
    R
    Attachments:
    QueueProducer.vi ‏18 KB
    QueueConsumer.vi ‏14 KB

  • What's wrong with a "regular" global in this case? AND WIl ActiveX objects stored in functional globals remain valid (when used in an executable)?

    I've written a plugin layer for a LV executable.  When this layer makes a call to the plugins' initialization functions, I want each plugin library to be able to initialize and maintain its own global memory (where things like VISA resource names or ActiveX objects are stored).  However, I've found that I can't manage to keep my global VIs "alive."  I'm inclined to switch to functional globals, but I suspect that this will be a problem for things like ActiveX objects (that in this particular case reference a CAN interface).  I believe that the functional global will indeed store the object from run to run, it's just that I'm somehow disinclined to think that the object will remain valid.  I think you'll have to re-initialize it.  Can anyone speak for or against this hunch?  (If you can't tell, I'm trying to avoid building a whole little test executable just to debug this problem.)
    I suppose the more profound question is "Why don't the globals stay in memory?"  I'm attaching an image of what the application layer that calls the plugins' intializations looks like.  Next I'm attaching an example of an actual initialization routine.  You'll notice that I've even gone so far as to explicitly open the ref to the global VI that I want to keep in memory.  Then I just leave it there dangling - but it still gets dropped!  In my mind I shouldn't even have to do this, since the dynamically-called subVI "MC_CMO Init.vi" actually initializes the globals and runs with AutoDisposeRef = False. 
    Lastly, this is my first-ever attempt at writting plugin software.  So if you look at my code and have any criticisms/pointers, I'll greatly appreciate them.
    Thanks in advance,
    Nick
    "You keep using that word. I do not think it means what you think it means." - Inigo Montoya
    Attachments:
    AppLayer.JPG ‏60 KB
    InitPlugin.JPG ‏103 KB

    I am not sure if I follow you completely on your work-around.
    Everything I have to say on this topic is based on obesrvations and threads I have read on Info-LabVIEW. Therefore it is subject to corecttion by those who know better.
    LV is smart enough to know when "something" that had been opened, can be closed. It is not perfect.
    If for instance you open a VISA refnum and pass the refnum  to a LV2 AS A REFNUM the refnum in the LV2 stay alive as long as the VI's are running.
    If you start another VI that uses the LV2 to fetch the refnum, it should get a valid ref as long as it starts before the first goes idle.
    You then be able to work with refnum usign the VI launched second as long as stays active.
    I often create action engine that can be invoked where required throughout an application. If the action engines get a ref in one state (like init) and use it another, I will generally write a "tester" that calls the action engine action to test the engine. In this case, my "tester" stays live and it keeps the ref's fresh.
    I suspect if you tried to trick LV you could. If you type cast the ref nums to I32 and stored those in a LV2, I could see how LV could loose track of the resource sharing, but that is something I would avoid.
    So I encourage you to do some experimenting with keeping track of who's running when to see if your work-around will work.
    If you think you understand it better than I explained it, please post.
    Trying to help,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

Maybe you are looking for