Pass an int64 variable by reference from CVI to Teststand

I tried searching for this problem but couldn’t find a solution. I run test scripts that call a function in C AA_Dat_Get_Statistic( Stats_Record *p_stats ). If I call this function, I sometimes get system level errors (-17001, -17002), TestStand will sometimes crash, and a load of other problems. These errors do not occur until steps after. If I take out this call, TestStand will not crash. There is an obvious problem with this function.
I wrote a program in C that calls this function. By bypassing TestStand, I avoid crashes too.
Stats_Records contains a few unsigned _int64 variables. The custom struct in TestStand uses another custom struct called Int64. Int64 contains two double variables, High and Low. In short, the variables being passed as a 64 integer are being stored in two 32 double.
Does anyone know if passing by reference an int64 will cause these memory crashes? Is this how I should handle this or is there a better way.
Thanks in advance. ⨪

Below is the structure and function:
typedef struct
    unsigned __int64 frame_count;
    double                                   BER;
  }   Stats_Record;
AA_Dat_Get_Statistics
                   (int p_card, int p_channel, Stats_Record *p_stats)
    typedef union
      { __int64  int64_BER;
        double   float64_BER;
      }  BER_Union;                  
   BER_Union  BER;
    memset (&aa_stats, 0, sizeof(aaSTATS_DATA64));
    aa_status = aa_datGet (aa_handle, aa_channel, AA_DATAID_STATISTICS64, &aa_d_ptr);
    p_stats->frame_count           = aa_stats.ullFrameCount;
   BER.int64_BER        = aa_stats.floatCumulativeBER;
    p_stats->BER         = BER.float64_BER;
    return (status);
 }⨪

Similar Messages

  • How to pass table type variable into function from SQL*PLUS ?

    How to pass a table type variable from sql*plus prompt into a function ?
    Thanx in advance.

    Krishna,
    Do you mean like this?SQL> DECLARE
      2      TYPE t_tbl IS TABLE OF VARCHAR2(20);
      3      l_sample_tbl           t_tbl;
      4
      5      FUNCTION print_contents ( p_tbl IN t_tbl )
      6      RETURN VARCHAR2
      7      IS
      8          l_string            VARCHAR2(1000);
      9      BEGIN
    10          FOR i IN 1..p_tbl.COUNT LOOP
    11              IF (i = 1) THEN
    12                  l_string := p_tbl(i);
    13              ELSE
    14                  l_string := l_string || ', ' || p_tbl(i);
    15              END IF;
    16          END LOOP;
    17          RETURN (l_string);
    18      END print_contents;
    19
    20  BEGIN
    21      l_sample_tbl := t_tbl();
    22      l_sample_tbl.EXTEND;
    23      l_sample_tbl(1) := 'one';
    24      l_sample_tbl.EXTEND;
    25      l_sample_tbl(2) := 'two';
    26      l_sample_tbl.EXTEND;
    27      l_sample_tbl(3) := 'three';
    28      l_sample_tbl.EXTEND;
    29      l_sample_tbl(4) := 'four';
    30      l_sample_tbl.EXTEND;
    31      l_sample_tbl(5) := 'five';
    32      DBMS_OUTPUT.PUT_LINE(print_contents(l_sample_tbl));
    33  END;
    34  /
    one, two, three, four, five
    PL/SQL procedure successfully completed.
    SQL> HTH,
    T.

  • Passing values from CVI dll to TestStand gives wrong values

    Initially I wanted to pass an array of booleans from CVI to TestStand.  I read that this was not possible because you cannot set Boolean as a parameter.
    So I declared it as unsigned intin CVI.
    Strangely enough, TestStand does receive it as an arrayof Booleans.  However the values are still wrong.  I wonder if it actually is possible to pass an array of Booleans.
    Using TestStand 3.1 and CVI ver 7.1 (no impact)
    Here is how I declare the parameters in CVI:
    void __declspec(dllexport) __stdcall MemTest
        CAObjHandle     thisContext,
        unsigned char *    apbResult,
        int             alComport,
        int                alSocketNum,
        UINT32            aulHostAddr,
        BOOL        *    apbTestOutcome,
        UINT32             testSize,
        UINT32          startAddress
    The other functions within CVI use an array of booleans.
    Here is how I declare the parameters in TestStand:
    Here are the results I get.  They should match...
    The obvious question is:
    How do I get the results in TestStand to match those from CVI?
    The printout >>  no. 1 Passed << etc..  are the values of the array apbResult in CVI.  bSippResuls should match.
    Message Edited by Ray.R on 10-16-2009 10:41 AM
    Attachments:
    TS_prms.PNG ‏29 KB
    TSwrongValues.PNG ‏12 KB

    Ray,
    Try this:
    void __declspec(dllexport) GetResults(unsigned char arg1[16])
     //Insert function body here.
     arg1[0] = (unsigned char)0;
     arg1[1] = (unsigned char)1;
     arg1[2] = (unsigned char)0;
     arg1[3] = (unsigned char)1;
     arg1[4] = (unsigned char)1;
     arg1[5] = (unsigned char)0;
     arg1[6] = (unsigned char)1;
     arg1[7] = (unsigned char)1;
     arg1[8] = (unsigned char)1;
     arg1[9] = (unsigned char)0;
     arg1[10] = (unsigned char)1;
     arg1[11] = (unsigned char)1;
     arg1[12] = (unsigned char)1;
     arg1[13] = (unsigned char)1;
     arg1[14] = (unsigned char)0;
     arg1[15] = (unsigned char)1;
    Regards
    Ray
    Regards
    Ray Farmer

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

  • 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

  • Passing SAFEARRAY Pointer from CVI

    Hi,
    I am having problem in importing IVI-COM dll to C wrapper dll in Labwindows/CVI. I have to do that for my TestStand application to call the functions of the dll. After registering the COM dll, I have used �Create Activex Controller� option to create .c, .fp and .h files. With this, I was able to create dll but without any prototype info. So, I included the fp file to include prototype info. But while I create my dll with the type lib info, odl file gave error to use SAFEARRAY pointer. So I have declared a structure mySAFEARRAY (same parameters as that of SAFEARRAY) and has replaced all the (SAFEARRAY *) to (mySAFEARRAY *). After doing this, I have created the dll successfully.
    Now in TestStand when I have called the dl
    l with �Flexible Prototype Adapter�, few of the data types (structures) are not applicable to TestStand. So it is taking all the unknown data types to �long�. When I check the prototype with my C file, it is telling mismatch prototype.
    Now, please help me what do we do for the C wrapper dll to work proper. Is the procedure (which I have described above) proper?
    I have got one info from NI site, that the functions using the structure parameters should not be exported directly. Instead a wrapper function should be created, with each and every element of the structure as it parameter. Now do we create a wrapper function for each and every function which has the structure parameter in it? I am eagerly waiting for your information. Actually i am new to both CVI and TestStand.
    Thank you in advance for your help.
    Thank you,
    Sasi.

    Hello Sasi -
    I am uncertain what your situation is, but it sounds like you are trying to pass the SafeArray as a parameter of your DLL back to TestStand? TestStand only recognizes certain known types when it comes to creating new memory to hold variables. A SafeArray is fundamentally an array of objects, so passing it directly to TestStand is unlikely to work. Your best bet is to look into the LabWindows/CVI examples and functions for converting SafeArrays to one-dimensional arrays of numbers, and passing that array back to TestStand via a parameter or some API call.
    As an additional note, there are generic examples of how to successfully pass structures back and forth between TestStand and code modules, but it requires both environments having a definition o
    f the structure as well as agreeing upon the byte-packing of the data. The best resource I can provide is to point you to the TestStand shipping example located in the /Examples/Struct Passing/ directory. However depending on how you are attempting to extract that SafeArray, this may not be an issue (as far as writing a numeric array vs. writing a structure).
    If this doesn't help answer your question, maybe you can give me a little more information, maybe a function declaration for your code, to try and see what you are doing in more detail?
    --Regards
    Elaine R.
    National Instruments
    http://www.ni.com/ask

  • Currency Translation not working with "Time Reference from Variable"

    We have created several Currency Translations using RSCUR with a fixed "Key Date".  All have been working fine until we got the request to allow a variable date for the exchange rate date.  I have built a variable on 0DATE which I am putting a default date value into using user exit.  This default date is the SAME date as the fixed "Key Date" which we have been using.  Unfortunately when we use the "Time Reference from Variable" option and use this new variable, no currency conversion is taking place, instead it only shows the original currency values.  I am 100% sure that my variable is getting a value and it is the same date we are using for the fixed "Key Date" value so both methods should be using the exact same exchange rates.  The documentation that I can find states:
    ●      Time reference: The time reference for the currency translation can be either fixed or variable.
    If the time reference is fixed, the time at which the exchange rate is determined is independent of the data. You have the following options:
    ○       You can establish that the time reference be determined upon translation.
    ○       You can select the current date.
    ○       You can specify a fixed date as the key date.
    ○       You can specify any variable that exists for InfoObject 0DATE.
    ○       You can establish that the query key date be used. This is determined in the query settings.
    In my case I am only switching from option "You can specify a fixed date as the key date"=(Key Date) to "You can specify any variable that exists for InfoObject 0DATE"=(Time Reference from Variable).
    What am I missing?  Any help is appreciated.

    I neglected to mention that we are calling this currency translation through a WAD button using the SET_CURRENCY_TRANSLATION command.  I did do a test by applying the currency conversion within query key figure.  This seems to work.  So it appears the issue is with how the WAD is processing the variable, not the query.  When I display the variable in a drop down item within the WAD it does have the default value that I have assigned in user exit.

  • Can i pass parameter or global variable in view from 6i form

    hi master
    sir can i pass parameter or global variable in view from 6i form
    i use view for some diff column calculation within the date then i use
    where date between data1 and date2
    in view but view not create
    please give me idea how i pass external value in view
    thank
    aamir

    Hi Antony!
    I feel it may not produce the right results if you
    dont include the where clause and using only group by
    in view.You felt? Please clear, logical thoughts put here, not feelings.
    (It may very well have all the Debit, Credit
    for all the Accid where as the user wants only for
    r some date range)Data range is determinated in Form by user, so if view should give final data set then you must back
    on Ranjana first question: How to pass parameter or global variable to view from 6i form?
    And also as Ranjit pointed out, If you have only
    accid, sum(debit), sum(credit) in View, wheres this
    enddate ??Of course, column entdate (or enddate?) must be included in view...
    Cheers!

  • How can i pass a variable's value from PR to PFR

    Dear all,
    hope you are fine.
    i would like to pass a variable's value from PR to PFR.
    how can i do that.
    please suggest.
    in PR:
    String transactionId = (String) vo_trans.first().getAttribute("Getnexttrans");
    i would like to get this value to PFR.

    Mofizur,
    You can achieve the same using Session variable.
    If u are not executing the VO after PR. Then you will be able to get the same value as u are using in PR
    String transactionId = (String) vo_trans.first().getAttribute("Getnexttrans");
    Note - You have a few of the threads left open, mark it as answered if solved.
    Regards,
    Gyan

  • Passing ICM peripheral variables from Agent to IVR

    Hello,
    I need to know if this is possible since i can't manage to make it work.
    The call-flow is :
    VG->CVP->ICM->Agent
    While the call is in the ICM script , i saved the ICM peripheral variable 4 as the language the customer chooses at the beginning of the call.
    I pass this variable to the Agent (we are using CAD 8.5) and i can see it in the Agent Layout.
    What i need now is to give the Agent the ability to send the call back to any IVR menu (already managed to make that works using single step transfer)
    with the ability to pass the peripheral variable 4 to script so that i can use it as the locale instaed of letting the customer chooses the language again.
    Is this possible ?
    Amer

    David ,
    Here is the assigment from the script for the local to ICM peripheral variable 4
    Then when the call arrived to the agent , i can see the ICM peripheral variable 4 as the value of the language (correctly)
    when i use a task (single step transfer) to another script , at the begining i assign the call.user.microapp.locale to PV4 and then i try to play wav file (failure)
    see below

  • Time reference from variable in crcy transl. type

    Hi guys,
    does anybody know, where to create the variables displayed in RSCUR, when I want to create a crcy. transl. type with time reference from variable?
    Thanks in advance, Clemens

    Hi,
    With  step by step :
    http://www.sapdb.info/wp-content/uploads/2008/11/bw-howtousevariablestimereferencesincurrencyconversion.pdf
    with  steps and Definitions :
    http://www.scribd.com/doc/7061035/How-to-Use-Variables-for-Currency-Conversion
    The time reference for the currency translation can be either fixed or variable.
    If the time reference is fixed, the time at which the exchange rate is determined is independent of the data. You have the following options:
    ○       You can establish that the time reference be determined upon translation.
    ○       You can select the current date.
    ○       You can specify a fixed date as the key date.
    ○       You can specify any variable that exists for InfoObject 0DATE.
    ○       You can establish that the query key date be used. This is determined in the query settings.
    If the time reference is variable, the time at which the exchange rate is determined is decided by a time characteristic value.
    ○       A variable time reference can, for example, be determined using the end or start of a fiscal year or calendar year, a period and a month u2013 or even to the exact day. The following standard time characteristics are available: 0FISCYEAR, 0FISCPER, 0CALYEAR, 0CALQUARTER, 0CALMONTH, 0CALWEEK and 0CALDAY.
    ○       The time reference can also be determined using a customer-specific InfoObject of type date (for example, trading day). Note that this InfoObject has to have the same properties as the standard InfoObject selected in the variable time reference or must reference it.
    ○       You can specify an InfoSet: This is only necessary if you are determining the target currency using an InfoObject that exists in the InfoSet more than once. You enter the field alias so that the InfoObject can be specified uniquely.
    In the Business Explorer, you can only set time variable currency translations in query definition, and not for an executed query. See also Setting Variable Target Currency in the Query Designer.
    ○       In the Time Adjustment field of type INT4, you can specify whole numbers with a +/- sign.
    ○       In the Time Adjustment from Variable field, you can specify formula variables (1FORMULA). As these values of the variables may have to be whole numbers, they are rounded to whole numbers (integers) where necessary.
    The time adjustment (regardless of whether it is fixed or variable) is always related to the InfoObject specified under Variable Time Reference.
    Example of a time adjustment of -3:
    The variable time reference is To the exact day and the InfoObject under Variable Time Reference is 0CALDAY. Instead of 07.11.2006, after the time adjustment, 04.11.2006 is used for the translation.
    The variable time reference is End of Week and the InfoObject under Variable Time Reference is 0CALWEEK. Instead of 52.2004, the week 49.2004 is calculated and the end date is calculated from this.
    For more info pls refer this link:
    http://help.sap.com/saphelp_nw2004s/helpdata/EN/80/1a6806e07211d2acb80000e829fbfe/content.htm
    I hope these will helps you.
    Thanks .
    Hema

  • Scripting - Passing and Enterprise variable from script to script

    Hello all,
    We are using UCCX 7.0_SR5
    I am looking to be able to pass a captured variable from one script to another.
    We use a message in queue where a caller waiting in queue can choose to leave a message and then that message is queued back into the sytem for the next available agent. When that agent recieves the message in queue they basically call back out to the customer leaving the message.
    We capture a variable in the first script when they decide to leave a message. The variable holds the call back number that they enter into the system. There is a second script that presents these message in queue calls to the agents. We would like to pass that variable that holds the number enterend by the customer to the second script so that that number appears on CAD in the enterprise data fields. The reason behind this is so the agent has a number to call back in the event they don't reach anyone when the system calls back out and the message left by the customer does not contain a call back number.
    How can I pass that variable from one script to another so it can be presented in CAD for the agents?
    Thanks for any help and let me know if you need any further information.

    You would use a "Get Call Contact Info" step to set your callerID variable, where the "Calling Number" attribute is set to your callerID variable.

  • Passing hierachy node variable from BW to BO Webi Report in open doc link

    Hello All,
    We are working on BW-BO integration and creating Webi reports based on Bex queries.
    The question is regarding passing of a hierachy node value from BW to BO through open doc link.
    I see that when we pass hierarchy node value, we have to associate that with the corresponding infoobject technical name in the link but not sure in what format it has to be sent.
    For example, if ARM is the node value and 0HIERNODE is the infoobject , how should we send this value to BO.
    Please help.
    Thanks for your help,
    Regards,
    Tangudu S

    You cannot change anything here. You should really find out how the values are retrieved from the database
    THere is another option:
    1) Activate the tracing on your BOBJ server
      Check the following SAP notes (http://service.sap.com/notes) for that:
      Unix: Note 1235111
      Windows: Note 1260004
    2) Run your WebI report from the InfoView by choosing first the desired hierachy node value from the LOV of your prompt.
    3) Extract the MDX statement from the log file. It should contain the value for the hierarchy node. Copy this to the URL
    It is easier to find this out if you have access to a Crystal Reports Designer installation. Do you?
    Regards,
    Stratos

  • CAN I PASS A TABLE NAME AS A VARIABLE IN THE FROM CLAUSE?

    For some reason, I am trying to use a variable name containing the actual table name in the from clause and it won't allow me. I keep getting the error saying I need to declare the variable I'm using eventhough I've used it in another statement that is not the FROM clause.
    Example
    SELECT count(col1), sum(col2)
    FROM v_table_name;
    v_table_name was declared as:
    v_tablename VARCHAR2(20);
    v_tablename := real_table_name;
    Is it not allowed to use variables in the FROM clause or am I missing something here?

    You can use the Forms "From Clause Query" as the datasource for the data block. Then you can change the QUERY_DATA_SOURCE_NAME using set_block_property, so you can use any SQL statement you like. Of course you must name/alias the columns in a consistent manner so that the number of database items on the block matches those being queried.

  • Passing an APEX variable to another web page outside of APEX

    I need to pass an item variable from an APEX page to another web site outside of APEX. Does anyone know what syntax I would need to use? It needs to keep the session in tact.
    Thanks.
    Kelly

    Ah, as I read more closely ...   You say
    FIND_USER_IN_DB is defined as an application item.
    Application items get treated differently from Page Items.  They aren't on any page so there's nothing to directly tie them to a particular page operation. [You may have tried an obvious approach that doesn't work.]  Please check where you
    sets FIND_USER_IN_DB to the value in &P8_USERNAME.
    Does it say "Page Item" / "Item" there?   Check the selector?  Can you select an Application Item.  If memory serves, my (sad) experience is that you can list an Application Item here but it doesn't "work" and there's no warning that it's a problem -- except it doesn't work!  Application Items can't be given values this way.  Hey, it is what it is.  That's the way it doesn't work!
    So I believe you must "Submit" FIND_USER_IN_DB and then you can reference it on Page 11.  There must be several ways to do this.  I'll seaarch / ponder for a plain vanilla one.
    Howard
    (more)
    Well, maybe I have to take it back.   There is this documentation that suggests you can pass Application Items. http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35125/bldapp_item_app.htm#BCEHFDDJ   See Note in Paragraph 8.
    "Note: If you must set this item's value in session state using Ajax, then an Unrestricted protection level must be used for the item (for example in Dynamic Actions, Set Value, Page Items to Submit or Cascading LOVs, Page Items to Submit)."
    I'll try to run a test.  Still, the best solution for me still seems to assign the value of P8_USERNAME to FIND_USER_IN_DB and then submit the page which will plce the value in session.
    (more)  I was able to pass an Application Item if I set Session State Protection to Unrestricted.  Probably not a good idea!

Maybe you are looking for

  • HT201303 My Apple ID has been disabled and I want to enable it again

    my Apple ID and my iTunes account has been disabled by iTunes because of the authorise  transactions , I would  like to in  enable them again if that is  possible or do I need to create a new Apple ID , not sure what to do?,, help

  • __is there a way to save a preset for audio mixer settings...??

    I have CS5 Looking to speed up the process so that I don't have to redo the audio mixer settings for every project - rather just tweak where needed. So wanted to setup the audio mixer how I want it - and just have it set as default for all projects o

  • How do I connect two apple compuiters

    I would like to connect two apple computers together - how can I do it.

  • ITunes 11 migration to Windows (yeah, backwards) :)

    I need to migrate my iTunes 11 Library, including all playlists and cue points to a Windows 7 laptop also running iTunes 11. I cannot find a single solution that works. Can anyone tell me specifically what needs to be done for iTunes 11? The solution

  • Need help adding AM/PM to my clock program

    Hi everyone I would be grateful if you could help me adding AM/PM to my clockDisplay program, been trying but i'm not very familiar with Java. Thanks I have used 2 classes: NumberDisplay and ClockDisplay the clock automatically convert hours after 12