ActiveX/COM adapter - how to assign a Variant to contain an integer

We use a component 3 rd-party and need to interface for TestStand using COM. The interface uses a variant of spend data in various objects. We are unable to pass an integer.

When expected contained in the variant type is a string or a double bed, the call is successful. When the expected type is an integer, the call fails. Passing a Boolean value will succeed, but only for 0 and -1.

How we can assign an integer value to a Variant?  We can only find Int64() convert functions.

May be a function that returns an integer type to convert a number of TestStand (double) in an integer value, but so far, no luck.

There is currently no way to pass a 32-bit integer in a VARIANT using the ActiveX/COM adapter You can pass a 64-bit integer as you have no doubt already determined it, but teststand does not natively store numbers as the 32-bit integers and ActiveX/COM adapter currently has no way to specify a conversion of a data type Variant, so just TestStand stores the digital type it uses natively as a VARIANT.

To call this method from TestStand, you will need to write a wrapper function that performs the conversion of the required parameter and calls the method and then call the wrapper of TestStand rather function.

-Doug

Tags: NI Software

Similar Questions

  • Variant for ActiveX/COM adapter (HyperAccess)

    Hello

    Have automate Terminal VT100 emulation. For this task is my preferred choice

    Hilgraeve (thanks Dennis Knutson who recommended in several Threads-LV).

    It provides an OLE Interface. So I'm able to use it with the TS ActiveX Apadater.

    Unfortunately, in some API functions, it will use the data type 'variant '.

    And most times it will wait a long/VT_I4 (4 bytes).

    I know TS stores each number in double (8-byte).

    Is there a way to express the values in the adapter of the ActiveX

    or is it posible to create types of data of the user as provied this feature?

    because I do not want to write a wrapper Dll that manages this casts.

    Greetings

    Jürgen

    I recorded this issue as something to look for in a future version of TestStand. As a side note, some COM servers better tolerate the type of data past in one variant than others. It's pretty easy to take a variant and convert it to the type expect you using the Windows SDK VariantChangeType function and some servers will make it to be more flexible about the types of data that can be passed in. That said, it would still be nice if the automation adapter was a way to choose the data type for numeric values as variants and that's good feedback.

    Thank you

    -Doug

  • Programmatically insert step of ActiveX/COM using LabVIEW

    Hello

    I would like to be able to create sequences like the one set using LabVIEW.

    This sequence has only 2 steps, a LabVIEW VI call and an adapter of ActiveX/COM call.

    I was able to do using an adaptation of the code here: https://decibel.ni.com/content/docs/DOC-36337

    However, I am struggling to add the step of the ActiveX/COM.

    Any help would be welcome.

    Thank you

    Of course, there is a way, if you look for it

    Since you have an existing 'Step' class object, you can also get a 'Module' object for her. Subsequently, you will need to specify that it is an ActiveX module. If you do not know which - probably you need to get the object 'map' somehow... Our case is simpler, so just cast to the ActiveX module and... to set certain properties like ServerId, ActiveXReferenceExpr and so on.

    I've attached an example for you. Interesting thing is the ServerId - I just read this chain of the TS for similar action and reused it here so do not ask me how to get automatically

    You will need to complete your 'properties' as 'file' - but I'll gracefully leave this work for you =.

    Best regards

  • Satellite L300-2 - How to assign a new email address when registering

    I am writing this message on behalf of the end user of our Toshiba.

    She bought the TOSHIBA Satellite L300-2This and because she didn't have an internet connection at home, I order him to register his new Toshiba by our care.
    I took his laptop and I made a mistake by e-mail. I wrote the wrong email address. How to assign a new email address?

    Best regards

    SAMO Praprotnik

    Hello Samo

    If you have registration problems, please contact Toshiba [email protected]

    You should contact Toshiba in your country. Details are at http://eu.computers.toshiba-europe.com/innovation/contact_toshiba.jsp

    Explain what is the problem and I hope someone will help you.

    Post edited by: ADMIN

  • How to assign a keyboard macro to a keyboard shortcut

    Does anyone know how to assign a keyboard macro to a keyboard shortcut?  I'm spoiled CodeWright by, if there is no selected item only when a 'Ctrl c' is issued, CodeWright automatically copy the line that the cursor is located. I'm trying to replicate this feature and the only way I can see it's a macro of the "copy line" keyboard right click on command.  Any thoughts?

    NABI:

    Looks like you're talking about modifying the source code.  I don't know a way to create your own keyboard macro.  You can change the shortcut key assignments (CVI 9.1: Options-> change the shortcut keys), but it seems that you need more than that.

    To make your example (a line no copying), I often have to press Ctrl-O, to cut the current line, immediately followed by a Ctrl-V to restore the original line.  This line is still in the buffer zone of the Clipboard, so I can go where I want the copy of the original line and press Ctrl + V.

    In the event that you do not change the code but create shortcuts for your users in your application, you can catch the EVENT_KEYPRESS in your panel or command callback callback and check for key code combinations.  See the multikey.prj example program comes with CVI and the CVI for EVENT_KEYPRESS help.

  • Change settings of the add-on ActiveX/COM-step programmatically

    I would like to change program settings of the add-on ActiveX/COM-step (Automation server, object reference, class of object, method/property, list of parameters).

    Could not find this in context. How can it be changed?

    Thank you!

    Hey bestware,

    You need to get a reference to the step: RunState.Sequence.Main ["MyActiveXStep"]

    Then you can use it to convert the ActiveX module: RunState.Sequence.Main ["MyActiveXStep"]. Module.AsActiveXModule

    Once you have that you can do whatever you want with it.  You can read to help more with this.  Search for ActiveXModule.

    You can see all kinds of properties: MemberType, MemberName, ServerID, ActiveXReferenceExpr.  If you have read about them they are referring to different things that you want to set.  For example, the ActiveXReferenceExpr is where you store the object reference.  The MemberType is the method call (1), Property (2) Get Set Property (4) or not, Call(-1), etc...

    So to change the step to be a step to Get property I would do this:

    "" "RunState.Sequence.Main ["MyActiveXStep"]." Module.AsActiveXModule.MemberType = 2

    To store a reference to the object to Locals.MyObj I could do this:

    "" "RunState.Sequence.Main ["MyActiveXStep"]." Module.AsActiveXModule.ActiveXReferenceExpr = "Locals.MyObj".

    Hope that gives you you pointed in the right direction.

  • How to assign values to the nested table and passes as a parameter for the procedure?

    How to assign values to the nested table and passes as a parameter for the procedure?

    Here are the object and its type

    create or replace type test_object1 as an object
    (
    val1 varchar2 (50).
    val2 varchar2 (50).
    VARCHAR2 (50) val3
    );


    create or replace type test_type1 is table of the test_object1;


    create or replace type test_object2 as an object
    (
    val1 varchar2 (50).
    val2 varchar2 (50).
    VARCHAR2 (50) val3
    );


    create or replace type test_type2 is table of the test_object2;


    GRANT ALL ON test_object1 to PUBLIC;


    GRANT ALL ON test_type1 to PUBLIC;


    GRANT ALL ON test_object2 to PUBLIC;


    GRANT ALL ON test_type2 to PUBLIC;

    Here is the table object type:

    create the table test_object_tpe
    (
    sl_num NUMBER,
    Description VARCHAR2 (100),
    main_val1 test_type1,
    main_val2 test_type2
    )


    NESTED TABLE main_val1 STORE AS tot1
    NESTED TABLE main_val2 STORE AS earlier2;


    -----------------------------------------------------------------------------------------------------------

    Here is the procedure that inserts values into the nested table:

    PROCEDURE INSERT_TEST_DATA (sl_num in NUMBER,
    Description in VARCHAR2,
    p_main_val1 IN test_type1,
    p_main_val2 IN test_type2
    )
    IS
    BEGIN

    FOR rec in p_main_val1.first... p_main_val1. Last
    LOOP

    INSERT INTO xxdl.test_object_tpe
    (
    sl_num,
    Description,
    main_val1,
    main_val2
    )
    VALUES
    (
    sl_num
    description
    test_type1 (test_object1)
    p_main_val1 .val1 (CRE),
    p_main_val1 .val2 (CRE),
    p_main_val1 .val3 (rec)
    )
    )
    test_type2 (test_object2 (p_main_val2 .val1 (CRE),
    p_main_val2 .val2 (CRE),
    p_main_val2 .val3 (rec)
    )
    )

    );

    END LOOP;

    commit;

    END INSERT_TEST_DATA;

    -------------------------------------------------------------------------------------------

    Here are the block anonymoys what values attributed to the object type and pass values in the procedure:

    Set serveroutput on;

    declare

    p_sl_num NUMBER: = 1001;
    p_description VARCHAR2 (50): = 'Test Val1;

    inval1 test_type1: = test_type1();
    inval2 test_type2: = test_type2();

    Start


    inval1 (1) .val1: = "testx1";
    inval1 (1) .val2: = "testx2";
    inval1 (1) .val3: = "testx3";

    inval2 (1) .val1: = "testy1";
    inval2 (1) .val2: = "testy2";
    inval2 (1) .val3: = "testy3";

    CSI_PKG. INSERT_TEST_DATA (sl_num = > p_sl_num,)
    Description = > p_description,
    p_main_val1 = > inval1,
    p_main_val2 = > inval2
    );

    end;
    /
    Someone can correct me.

    Thank you
    Lavan

    Thanks for posting the DOF and the sample code but whenever you post provide your Oracle version 4-digit (result of SELECT * FROM V$ VERSION).
    >
    How to assign values to the nested table and passes as a parameter for the procedure?
    >
    Well you do almost everything bad that could be hurt.

    Here is the code that works to insert data into your table (the procedure is not even necessary).

    declare
    p_sl_num NUMBER := 1001;
    p_description VARCHAR2(50) := 'Testing Val1';
    inval1 test_type1 := test_type1();
    inval2 test_type2 := test_type2();
    begin
    inval1.extend();
    inval1(1) := test_object1('testx1', 'testx2', 'testx3');
    inval2.extend();
    inval2(1) := test_object2('testy1', 'testy2', 'testy3');
    
    INSERT INTO test_object_tpe
    (
    sl_num,
    description,
    main_val1,
    main_val2
    )
    VALUES
    (p_sl_num, p_description, inval1, inval2);
    commit;
    end;
    /
    

    See example 5-15 making reference to an element of nested Table Chapter 5 using PL/SQL collections and records in the PL/SQL doc
    http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28370/Collections.htm#CJABEBEA

    1. you don't even have the procedure because it is a simple INSERTION in the table you can do directly (see my above code)

    inval1(1).val1 := 'testx1';
    

    Since you have not yet created all the elements, there is no element 1 "inval1". You need EXTEND the collection to add an element

    inval1.extend();
    

    And then, there is an empty element, but "inval1" is a container for objects of type 'test_object1' not for scalars as "val1", "val2", and "val3".
    If you can not do

    inval1(1).val1 := 'testx1';
    

    You must create an instance of 'test_object1 '.

    inval1(1) := test_object1('testx1', 'testx2', 'testx3');
    

    And so on for the other collection

    You don't need the procedure (as my code example shows), but once you fill in the variables correctly it will work.

  • How to assign request to the Manager of competitor Custom

    Dear all,
    How to assign the query to execute in competitor Custom Manager

    Regards
    ANUP

    Salvation;

    Pelase check:
    How to create and Custom competitor Manager [ID 250755.1]
    http://www.Scribd.com/doc/3076487/how-to-create-custom-concurrent-requests

    For other notes too see Hussein great snoussi previous post
    Re: create new custom simultaneous Manager

    Respect of
    HELIOS

  • How to assign variables itemrender in a global public variable of my application.


    Hi friends,

    How to assign values to render internal elements in a global public variable. You can see example below.

    List an itemrender, the itemrender breast I use the data grid. The dataGrid control have itemrender.now I tried the values to assign public variable in my application data grid itemrender, but is it from the error... How can I slove u this problem Any One can help me.

    Example:

    public var myData:arrayCollection;

    < mx:List variableRowHeight = "true" dataChange = "validateNow ()" width = "900" id = "Lst_userlist" verticalScrollPolicy = "off" horizontalScrollPolicy = "off" "
    buttonMode = "true" >

    < mx:itemRenderer >

    < fx:Component >

    < mx:VBox paddingTop = "-5" horizontalScrollPolicy = "off" verticalScrollPolicy = "off" >

    < fx:Script >
    <! [CDATA]

    override public function set data(value:Object):void
    {
    ------

    -----
    }

    []] >

    < / fx:Script >

    < mx:VBox id = "vbox_grid" horizontalScrollPolicy = "off" verticalScrollPolicy = "off" width = paddingLeft '890' = "10" paddingTop = "5".

    backgroundColor = "#317152" color = "#FFFFFF" >

    < mx:DataGrid visible = "false" includeInLayout = "false" height = "100%" id = "membershipGrid" alternatingItemColors = "[#DCDCDC, F8F8FF #]".

    "5" paddingLeft = horizontalScrollPolicy = "off" color = 'black '.
    horizontalGridLines = "false" verticalScrollPolicy = 'auto' verticalGridLines = "false" rowHeight = "25".
    borderSkin = "{null}" showHeaders = 'true' borderVisible = "false" dataProvider = "{data.dataCollection}" width = "900" > "

    < mx:columns >

    < mx:DataGridColumn width = "180" headerText = "Name" minWidth = "150" sortable = "true" wordWrap = "true" >
    < mx:itemRenderer >
    < fx:Component >

    < mx:HBox horizontalScrollPolicy = "off" >

    < fx:Script >
    <! [CDATA]

    override public function set data(value:Object):void
    {
    -----

    -----

    }

    function Click_Name (): void
    {

    outerDocument.myData = data;  Here the error came

    }

    []] >

    < / fx:Script >
    < mx:Image id = "fileimg" buttonMode = "true" toolTip = "This is organization at the home page of the user" / >
    < s:Label id = "lbl_Gridcloumn_name" width = "200" buttonMode = "true" textDecoration = "underline" click = "Click_Name ()" / > "

    < / mx:HBox >
    < / fx:Component >

    < / mx:itemRenderer >
    < / mx:DataGridColumn >

    < / cloumn >

    < / datagrid >

    Error:

    MyData property possibly access not defined through a reference with static type com.istmanagement.views:ProgramAcessRights_ComponentInnerClass3.

    Thank you

    Mamoudou R.

    Have you tried outerDocument.outerDocument.myData?

  • How scam assignment affects iPad and iPhone

    How scam assignment affects iPad and iPhone

    UH... What? Could you elaborate?

  • Is it possible to plug a USB to my new iPad Pro, to transfer PDF files and some Jpeg files from the USB key with an adapter of lightning? If there is NO adapter, how can I get these files on the USB key and my iPad pro?

    Is it possible to plug a USB to my new iPad Pro, to transfer PDF files and some Jpeg files from the USB key with an adapter of lightning? If there is NO adapter, how can I get these files on the USB key and my iPad pro? I need these PDF files transferred my I touch pro. Any suggestions?  Please

    Thank you

    Mike Tingey

    The iPad does not support USB keys. There are some wireless flash drives that can be used, but not the classical records. I suggest you transfer files to a computer and their synchronization then back to the iPad via iTunes.

  • How to assign the TAB sequence?

    Hey...

    Can someone tell me how to assign tab...? I mean if I have a few buttons and controls on the front panel are trying to view the login Panel; whenever I press TAB on the keyboard, I want that the selection of buttons & controls should be in order... Can someone tell me how...?

    See the order of Edit\Tabbing, and with the right button on the control of Navigation Advanced\Key

    See you soon!

  • How to assign different drive letter in the new hard drive?

    My hard drive for OS window is broken, which is the C: drive, so I buy a new HARD drive, but my original D: drive become a C: drive and new HARD drive is assigned with drive E:, I can't restore my Ghost in new HARD drive image, because the image is restored in the C: drive only.

    Anyone have any suggestions on how to assign different drive letter under cmd?

    Thanks in advance for your suggestions

    Hi oem7110,

    Follow the steps in the article.

    How to change drive letter assignments in Windows XP

    How automatically assign a drive letter by using the Diskpart.exe command on a Windows Server 2003-based computer or on a Windows XP-based computer

  • What are the Activex/COM components?

    All my registry cleaners keep coming many - about 25 - ActiveX/COM points... and telling me that they can be deleted, but not advised... EXACTLY what they are and what harm it will do to remove these items from pain in the neck?   thank EVERYONE in ADVANCE FOR ANY HELP or SUGGESTIONS...

    Hi DancingTaurus,

    As you use the third-party registry cleaners we are not aware of its functions and so we do not recommend you to carry out actions.

    If you want to continue you can do so at own risk.

  • How to assign a constant name 'letter' to the USB port?

    My Compaq Presario with Windows 7 has two USB ports on the front and on the back.  I use both to the front to connect a drive hard ext to the back, usb flash drives and a camera. Everytime Iplug in the disk hard ext, the PC assigns a letter to port such as J.  The next time I plug the camera into the same port, the PC gives it a different letter and I need to go back up and reconfigre Norton where to back up.  How to assign a constant name 'letter' to the USB port?

    I think that the previous answer may have been cut off, but they were right. You assign it a letter on the USB port, you assign a letter to the device. With your drive plugged, if you right-click on the computer icon and select manage you will arrive at the computer management screen. Click the disk management icon and you should see your drive listed. Right click on that and you should see a choice to change the drive letter and path. From there, click change and select a drive letter for your device.

Maybe you are looking for

  • Route specified cannot be fulfilled for edge on Dev1/AI/SampleClockTimebase counter

    Hi all The synchronization signal digital recording using PFI0/PFI1 , I was able to record the arrival time of a digital signal on PFI0 compared to samples in an analog input task with the task of the SampleClockTimebaseSource. This well it worked wh

  • How can I change the brightness on my o f my Inspiron one screen?

    My Inspiron screen is SO bright.  I can not find the command to change the brightness.  Anyone know how?

  • AppAssure BMR cannot find the Destination disk.

    I am preforming a bare metal restore material disimillar and Appassure cannot find the drive on the target computer. Restore dell Poweredge R430 13g. The discs are in a controlled by a H330 PERC RAID 1. Is there something I am missing, usually displa

  • Disorder Prpoperties printer

    I have a HP 1050 J410 series AIO printer works on win 7 (32-bit OS starter) HP laptop. Recently, I noticed that the printer properties do not display the choices of color selection / BW / greayscale options. In fact it does not show on the side of co

  • Select and mask is not an option

    Hello everyone. I have a problem with the new ' select and mask ", it basically does not appear in my Photoshop. I have only the option "refine edge". Someone who can help?And Yes, I have the latest version of Photoshop, which should include the tool