CVI- activeX

I have started looking at and working through the Active X examples (e.g. 3DGraphAxis). The CA_ functions are included in the CVI help documentation but the CW3D__ functions not. 1) What is the best way to get to know the ActiveX controls (working through the examples?) 2) Where can I get help on the CW3D functions ? 3) Where can I find any relevant documentation to get me going?
Regards
Erik

Hi Flutter,
The cw3Dgrph.chm file is the only help we have available for this control. The properties and methods obvioulsy don't match 100% with the function names in CVI. This is because the CVI library is a wrapper around the original library that was developed for C++ and VB. The simplest way to use this help is to use the function panel right-click method. When you do this, are you not taken to the cw3Dgrph.chm file? Right-clicking on individual parameters in these function panels will probably not display any help. But if you right-click in a blank area of the function panel, it will take you to the appropriate page in the chm help. Note that for the example function you provided, this will link to the Plots property rather than the getPlots function because the getPlots function only exists in the wrapper. 
National Instruments
Product Support Engineer

Similar Messages

  • -17702; An error occurred accessing the CVI ActiveX automation server.

    I am now getting this error consistently whenever I try to debug my dll. I was able to successfully debug earlier, but it has degraded. I tried shutting down teststand and labwindows and restqarting them, but the error persists. I am using teststand 4.1.1 and labwindows/cvi 9.0.0 (348).
    Anyone have any ideas?  This has me stalled.

    Hello,
    Pretty old post, but I have a similar problem...How can I fix this issue ?

  • Why does the new CVI adapter not put the contextCVI parameter?

    Hi,
    With good old 2.0 prototype you could not specify arguments and you always used the parameters tTestData and tTestError. Now, with the TS3.x the recommended prototype is the new one.
    If I specify the standard prototype it puts some arguments which the sequence context is not one of them.
    The question is why?
    1) Don't you always need it? Is there a way to get the context from within the CVI code? Isn't the idea of the context argument is to be able to get/set information from the TS variables?
    2) I read the manuals but didn't see exact instructions how to specify the context as an argument. Can anybody show me how to do it? Do I need to specify it by value or by reference?
    3) Isn't there a check box to include the context in the same fashion as it was in TS2.x?
    4) I specify the context parameter with every TS step. Is that the proper way? Can I modify the standard prototype so it will automatically be inserted along with the other argument?
    Thanks
    Rafi

    Hello Rafi -
    I think the Action steptype will always give you a seqContextCVI pointer, but I agree that the default templates for the other steps don't. Certainly you don't 'always' need it. Especially if all you're doing is talking to hardware, doing some calculation and returning a measurement value, but it's very nice to have for various chores in TestStand.
    I think in TS 3.0 rather expect you to specify it manually.It's not too hard to do once you see the trick. I looked at the Action step's default arguements before I saw how it was done, but here's the simple breakdown.
    (1) create new arguement, on the right-hand side of the screen name it whatever you like.
    (2) The category is 'Object, the Type is 'CVI ActiveX Automation Handle' and the Pass is 'By Value'.
    (3) on the left-hand side of the screen, assign it the value 'ThisContext' as usual, and you're all set.
    If you build your functions manually in CVI you'll just include the parameter "CAObjHandle seqContextCVI" and use it just like you used to.
    Other options might be... I know there's still a button on the Module tab of CVI steps to allow you to create a TS 2.0 style prototype with TestData and TestError...
    Or, Yes, you can also modify the default template that comes with TestStand, but the software will likely complain at you for changing the settings on a NI steptype. If you want to explore this route, you need to add your seqContextCVI parameter in two places. Once to the actual template file at (TestStand Root dir)\CodeTemplates\User\NumericLimitCVI, and once to the type definition of the step you want to change. For example, use the Type Palette to find the Numeric Limit type and right click on it to alter it's properties. The tab you'll want to investigate is 'Code Templates'and then the template for CVI.
    I hope this helps!
    Cheers,
    Elaine R.
    www.bloomy.com
    Cheers,
    Elaine R.
    www.bloomy.com

  • Error -17704, Build project failed in CVI

    I'm using CVI7.0 with TS3.0.
    When I configure the CVI adapter to be in debug mode, the TS uses tscvirun.prj to run an additional instance of the CVI code for debugging. As soon as TS finishes to load this project I get the run-time error:
    Build project failed in CVI for the project c:\....\tscvirun.prj.
    Error Code: -17704; CVI ActiveX automation server command failed.
    Any idea where to start looking?
    p.s. This entire project was copied from another pC where I don't have this problem. I did a lot of comparing between configurations of the two pCs but found nothing.
    Thanks

    Rafi2003 -
    Does the original tscvirun project that TestStand installs work with the example on the failing system?
    To validate this you may need to repair TestStand so that the tscvirun files are refreshed and try the examples to make sure things are working properly on the system before attempting to use the files from the second system.
    If you rerun the insaller, one of the available options will be to perform a repair.
    Scott Richardson (NI)
    Scott Richardson
    National Instruments

  • Passing Engine Handle to LabWindows CVI

    Hi All,
    I have run into a situation in test stand where I want to use it in conjunction with a DLL that I have developed in CVI.  In order have them interact properly, I wanted to pass the current TestStand Engine handle into my CVI DLL.  Afterwards, the plan is to use that engine handle along with the tsapicvi activeX control to do what I need to do.
    However, I cannot seem to get this working correctly, as I keep getting an invalid handle error from my CVI activeX controls with the handle I have passed into it from teststand.  Here is what I have so far.
    In TestStand Sequence A calls the CVI DLL:
    Sequence A has a single parameter called Engine.
    Parameter Engine has the teststand Category TSObject with type TS::IEngine passed By Value.
    The value passed into the parameter Engine is RunState.Engine
    The CVI DLL has a single function GetHandle
    GetHandle has a single parameter which is TSObj_Engine *ts_engine.
    This function calls TS_EngineGetLicenseDescription (*ts_engine, NULL, 0, &desc); (just a random function that I use to test it).
    Any suggestions on where I might have gone wrong with this?
    CVI 7.0
    TestStand 3.1

    Hi Ray,
    Thanks for the quick response! 
    To answer your question, yes, I do set the Engine parameter in TestStand to RunState.Engine.
     However, all I know about the TS:IEngine containter is that it has one (or more) data fields that get passed to my DLL.  I don't know what those fields are, so on the DLL end I am not sure what I should be getting.  i.e. the function prototype in my DLL should probably contain some struct, but I don't know what the struct is.  The only guess I can make is that teststand is passing me a TS_IID_Engine type struct (defined in tsapicvi.h).  However there are 4 data fields in this struct convienently labeled Data1 - Data4, all of which i tried using as a handle, and none of which worked.

  • Recovering from ActiveX Error in TestStand

    If I were running a CVI DLL code module from TestStand using the CVI
    adapter and terminated it somewhere in the code module by using the Windows
    SDK ExitProcess(0); command it will return to TestStand and generate an
    ActiveX error as follows:
    " -17702; An error occurred accessing the CVI ActiveX
    automation server.The CVI adapter will attempt to reconnect on next
    execution."
    It appears any subsequent communication to the CVI server in this same
    execution (i.e. by other steps that follow) will fail also until the
    execution is re-started. Is there a way to reset/restart the communication
    in this sequence's execution between TestStand steps? i.e can the CVI
    adapter reconnect on this execution. How does TestStand re-establ
    ish
    communication with the CVI server using the CVI adapter ? Does it have to
    destroy that object and create a new one to recover ?

    Scott,
    Your recap is excellent. The SDK ExitProcess() function is called in a different thread in our code module when the Terminate button on our ActiveX operator interface is clicked. This kill's the code module immediately and returns to TestStand with an ActiveX error which can be ignored. Then the Cleanup group can be run to reset the test equipment. At this point you must restart another execution to reset the ActiveX connection. This model works well if you are resetting and not trying to perform other steps once you return to TestStand. This implies our code module will always be run out of process. I tried the Time Limits idea you suggested but that still does not terminate the thread our code module is executing in. The RaiseException idea I also tried. I raised the exception in the main thread of the code module that was executing. This has the side effect of returning to the CVI debugger instead of TestStand which is not good. We are going to stick with the ExitProcess() method for the time being and see how it works in the long run. In the next version of TestStand it would be nice if this feature could be added. Also for your info due to TestStand's architecture it seems all code module's that are called using the CVI adapter must return from the main of the code module that was called in TestStand. This implies that if the main has several layer's of functions below it that it calls. Somehow these call's must recognize (poll) for the termination event from TestStand and return all the way up the call stack back to the original code module that was called by TestStand. Therefore all of the users code/function's must error check every line of code in the main to see if we want to return and every function must check every line of code to return up the stack to the main. This makes the code a lot less readable in main for example if(function == FAIL) return -1; instead of function();. The only alternative to this method that I have found is the ANSI "C" setjmp/longjmp command which will allow us at any point in our Test Code or sub function's to return cleanly back to TestStand. This is preferable to me because the code is more readable and functionally equivalent to returning up the call stack. Do you know of any other methods of doing this ? Our individual code modules may be up to 1000 lines and take anywhere from 1 - 10 minutes to complete with many nested function's being called from the main.
    Thanks For Your Help,
    Tom D

  • ActiveX Wizard Initialisation Query

    I am using an ActiveX control, supplied with a Thorlabs Stepper Motor Positioning system. CVI seemed to find and create an instrument for it, with a bunch of functions, including one as follows:
    HRESULT BSC102_New_DMG17Motor (const char *Server,
                                   int Support_Multithreading,
                                   LCID Locale, int Reserved,
                                   CAObjHandle *Object_Handle);
    I took this function at face value and tried to use it to initiate communication with the instrument. It failed. Looking at the Help on ActiveX programming, I found the following information:
    "For each interface that the ActiveX server supports, the driver contains a creation function that you can use to programmatically create an instance of the ActiveX control. The name of the function is of the form <InstrumentPrefix>_New<InterfaceName>. You pass to this function the panel, label and coordinates of the new control. The function returns a control ID, which you use to identify the control when you pass it to functions from the User Interface Library."
    This seems to be a very different interface to the one generated by the wizard - the parameters are totally different, although the function name itself seems accurate. Can anyone shed any light in this area?
    JR

    That's right. In ActiveX parlance, a "controller" has nothing to do with a "control".
    In ActiveX, there really are only servers and clients, and "controller" is just another name for a client. The reason for the name probably goes back to when the most common use for ActiveX was automation, and a controller was a particular type of client which "controlled" an automation server.
    The CVI ActiveX Controller wizard helps you create the programmatic interface that a client program will use to talk to a server. Note that there is also a server wizard, which will help you create an ActiveX server (but not a control! you cannot use CVI to create ActiveX controls).
    So what are ActiveX controls? Controls are a special kind of ActiveX server which can also operated by the end user like any other GUI control (knobs, slides, etc...) They can be hosted by something called an ActiveX container. A CVI panel can act like an ActiveX container, and thus you can embed an ActiveX control onto a CVI panel. Typically, you do this in the UI editor by selecting "ActiveX" as the type of control you want to create, and then selecting from amongst the various controls you have registed on your PC. You can then use the ActiveX Controller wizard to create a programmatic interface which will allow you programmatic access to the control.
    Even though the ActiveX Controller wizard can be used to generate a programmatic interface for a server, or for a control, it will create slightly different interfaces for each type. And the primary difference is precisely for the creation functions. This function, BSC102_New_DMG17Motor, is a creation function for an object in an ActiveX server -- not for an object in an ActiveX control.
    Luis

  • How can I convert a Database Handle from TestStand to LabVIEW?

    I want to use a Database Handle (already created in TestStand by an Open Database step) in a LabVIEW-VI (called from TestStand) to connect it with the "Connection Reference" input of the "Easy SQL.vi"? If I use a directly connection via the "TestStand - Get Property Value (Number).vi" I get back the error message 4101 in LabVIEW. How can I convert the Database Handle?
    Test Engineering
    digades GmbH
    www.digades.com

    The TestStand database step types use the CVI SQL Toolkit to talk to databases. The handle that you are referencing is an internal memory location and not a actual handle that you can directly use. Currently as implemented the handle that is stored in a numeric TestStand property for the connection and the SQL statement are the handle values returned from the CVI SQL Toolkit. So for the connection handle, you could call the CVI SQL Toolkit function
    DBGetConnectionAttribute (
    int Connection_Handle,
    tDBConnectionAttr Attribute,
    void *Value);
    and get the CVI CAObjHandle reference. With this you could then call the CVI ActiveX function
    CA_GetInterfaceFromObjHandle(
    CAObjHandle Object_Handle,
    const IID *Interface_Id,
    int Force_AddRef,
    void *Inte
    rface_Ptr,
    int *Did_AddRef);
    to get the actual ActiveX interface reference. This would have to be converted into a LabVIEW reference.
    You may want to consider just using LabVIEW to open a new parallel reference only using the toolkit.
    Scott Richardson
    National Instruments

  • Ocx file

    I want to incorporate the components in this .ocx file that I have into a
    labwindows project. I choose 'Create ActiveX Automation Controller' from
    the Tools menu. I do not see that particular server (.ocx file) on the selection
    menu, so I browse and try to add it. It gives me a 'Type Library not compatible
    for ActiveX Automation'. Why is this so and how would I be able to work
    with the vendor to be able to have these controls available to me?

    When you look closely you will find that CVI is NOT fully supportive of
    ActiveX Comp. The word from NI is that it will be in the next release,
    which is due sometime in 2001.
    Richard.
    Sheila Floresca wrote in message
    news:[email protected]..
    >
    > I had already registered the .ocx file successfully using Regsvr32.exe,
    but
    > the file does not show up in the selection box as a registered server.
    When
    > I BROWSE and select my .ocx file, I still get the message, 'Type Library
    > not compatible for ActiveX Automation'. Is this because it is a .ocx
    file?
    > I've read elsewhere on some of the support pages that .ocx files cannot
    > be used and a .dll file should be created instead of a .ocx file in
    VBasic.
    > However I tried am
    ovie.ocx in the system32 folder and it allowed me to
    see
    > the methods. What would I have to ask my vendor to do to allow me to
    access
    > the methods in his software?
    >
    >
    > "Daniel Bentolila" wrote:
    > >>I think it's not enough that you have that ocx file but you need to
    register>that
    > component into your system registry, the ocx component may need
    others>dlls
    > or other files, Now I think the MS Visual C++ comes with some
    utility>named
    > RegSrv32.exe which you execute from the dos command line and you
    supply>the
    > ocx filename as an argument to that command, If the registration
    successed,>You
    > should see that ocx from the CVI ActiveX automation
    server.>>>
    > wrote>>I want to incorporate the components in this .ocx file that I
    have
    > into>a>labwindows project. I choose 'Create ActiveX Automation
    Controller'
    > from>the>Tools menu. I do not see that particular server (.ocx file) on
    > the selection>menu,>so I browse and try to add it.
    It gives me a 'Type
    Library
    > not compatible>for>ActiveX Automation'. Why is this so and how would I be
    > able to work>with>the vendor to be able to have these controls available
    > to me?

  • Active X , accessing subclasses of Mach3

    I am having  trouble with calling subclasses  of an ActiveX Call.  Given an application called: Mach3 a CNC program. Link: http://www.machsupport.com/downloads.php     Mach3 R3.043.066
    I was succesfull in interfacing it with LabVIEW via ActiveX and able to access the Main class. But , when I try to access the subclasses using the GetDispatch fuction in the Main class it doesnt do anything. 
    In my first VI(MyMach_Gcode), I was able to load a Gcode and read the x,y,z encoder positions. 
    I found a similar topics in NI forum but the questioner uses LabWindows/CVI.
    Link: http://forums.ni.com/t5/LabWindows-CVI/ActiveX-controller-methods-import-as-callbacks/td-p/1038846
    For example , in my 2nd VI (MyMach_DoOEM), when I call the the Function DoOEM with 133 as argument it is supposed to zero the x encoder but it does not. 
    The code runs without any errors but there is no changein the Encoder state. 
    Could you give me some help how to go on? Looking forward you kind reply!
    Attachments:
    MyMach_Gcode.vi ‏13 KB
    MyMach_DoOEM.vi ‏13 KB

    Hi,
    I couldnt find much info on all the classes .
    But, when I point VS to MAch3.exe which contains a tlbexp of Mach3 , I can see a library is called "Mach4" and contains a Mach4 interface and a MyScriptObject interface. Mach4 has some methods for controlling Mach's startup and shutdown, and MyScriptObject contains many methods for controlling Mach, examples of which are on the document I have provided earlier .  Looking  in the Object Browser of Visual Studio 2008 shows all of these things, and reveals many events that Mach supposedly can fire.
    if you refer to this lnk (http://www.machsupport.com/forum/index.php?topic=20240.0 ) he seems to talk reagrding a simialr problem I am facing.
    There is also an another discussion regarding simialr issue on NI forum here (http://forums.ni.com/t5/LabWindows-CVI/ActiveX-controller-methods-import-as-callbacks/td-p/1038846)
    I am new to both Visual Studio and ActiveX. So this is all I could figure out. If you could point me in the right direction I would be able to gather more data.  
    Thanks. 

  • Evaluation dialog box - how to get rid of it

    Hi,
    Is there a way how to get rid of following dialog box when it appears?
    Please note user is not allowed to click on any button. I need to do this purely by program. Ideally some registry entry.
    Thank you, Michal.

    Hi Roberto,
    Yes! I noticed "Do not show this dialogue again" checkbox but I cannot use it due to several reasons. Let me explain.
    I am using LabWindows/CVI ActiveX Controller to control the project creation/building process. This is running on different machines where I cannot really rely on whether this checkox was hit by anyone before or not. So this was a critical requirement to handle any such event without user intervention. Here starts the story where I was looking into automatic solution for how to handle this.
    About your second question, the last one should be correct. The CEAL would have to be down for whole my evaulation period in order that CVI would stop working. But when CEAL is available again this 30-day evaluation period should be restarted and with another CEAL outage this window shown again. This is where I am like 90% certain. So please don't take this as an absolute truth if not confirmed by any NI staff.
    Anyways as I said before I am not into this solution anymore but if anyone would have any idea how to simply handle this without any user intervention I would store this into my knowledge database . I already mentioned Windows function above which should work. Also there is a freeware SW called AutoIt which basically does the same.
    Thank you, Michal.

  • How to use a 64-bit Matlab ActiveX in a 32-bit CVI?

    I have a CVI 9.0 and 64-bit MatLab R2012a installed on my PC together with 64-bit Windows 7.When I try to use "Create ActiveX Controller" wizard to use the Matlab ActiveX,a message went out says"The Type Library is not intended for use on Win32".Seems like it's because my CVI is 32-bit but my Matlab is 64-bit.So I wonder is there any way for me to use the MatLab ActiveX Controller?
    PS.I have been checked on this topic:http://forums.ni.com/t5/LabWindows-CVI/How-to-create-ActiveX-Control-in-LabWindows-CVI-2010/td-p/183...
    But it's not workong for me due to different CVI version.
    Thank you guys.

    Thank you for your reply.
    Does this means that it is still not possible to use the PDF ActiveX control in a x64 WinForms application?

  • Printing labels from CVI using ActiveX and WORD

    I'd like to print labels from CVI. I managed to create the label type I need
    in WORD. Now I want to use that in CVI. The following macro describes exactly
    what I want. Maybe someone can translate this to CVI, please ???
    Sub Macro2()
    ' Macro2 Macro
    ' Macro recorded 17-02-00 by IT-Systems
    Documents.Add Template:= _
    "C:\Program Files\Microsoft Office\Templates\Normal.dot", NewTemplate:=
    False
    Application.MailingLabel.DefaultPrintBarCode = False
    Application.MailingLabel.CreateNewDocument Name:="10.63230", Address:=""
    , AutoText:="ToolsCreateLabels1", ExtractAddress:=False
    End Sub

    We do not have an example that will do *exactly* what you need, but you should
    find an ActiveX example program, either in the CVI samples folder or on the
    Example Programs Database, that illustrates how to print a document in Word.
    The function you will need to call that actually invokes the print method
    is Word_DocumentPrintOutOld. It's defined in word2000.h; the prototype,
    in case you were curious is:
    HRESULT CVIFUNC Word_DocumentPrintOutOld (CAObjHandle objectHandle,
    ERRORINFO *errorInfo,
    VARIANT background, VARIANT append,
    VARIANT range, VARIANT outputFileName,
    VARIANT from, VARIANT to, VARIANT
    item
    VARIANT copies, VARIANT pages,
    VARIANT pageType, VARIANT printToFile,
    VARIANT collate,
    VARIANT activePrinterMacGX,
    VARIANT manualDuplexPrint);
    "Han Stehmann" wrote:
    >>I'd like to print labels from CVI. I managed to create the label type I
    need>in WORD. Now I want to use that in CVI. The following macro describes
    exactly>what I want. Maybe someone can translate this to CVI, please ???>>>Sub
    Macro2()>'>' Macro2 Macro>' Macro recorded 17-02-00 by IT-Systems>'> Documents.Add
    Template:= _> "C:\Program Files\Microsoft Office\Templates\Normal.dot",
    NewTemplate:=>_> False> Application.MailingLabel.DefaultPrintBarCode
    = False> Application.MailingLabel.CreateNewDocument Name:="10.63230",
    Address:="">_> , AutoText:="ToolsCreateLab
    els1", ExtractAddress:=False>End
    Sub>

  • How to create ActiveX Control in LabWindows/CVI 2010

    I have LabWindows/CVI 2010 Full Development System (Debug Only) installed on a stand alone PC with Windows 7 (64bit).  Also I have Matlab (R2011a) (also 64bit) installed on this PC.  I tried to use "Create ActiveX Controller" under ""Tools".  I can locate the "Matlab Application (version 7.12) Type Library" in the ActiveX Controller Wizard. After click "next", I got a message "The Type Library is not intended for use on Win32".  My questions are:
    1) Is my LabWindows/CVI 32bit or 64bit?
    2) How to create my Matlab ActiveX Control?
    Thank you.

    Hi JGS,
    It means that you cannot use 64 bit libraries in CVI ti create Activex controls since CVI is a 32 bit application. You can however create 64 bit dlls, executables and static libraries. Here is a link to some information:
    http://zone.ni.com/reference/en-XX/help/370051T-01/cvi/programmerref/creating32bitappsversus64bitapp...
    Regards,
    Perry S.
    Applications Engineer
    National Instruments

  • Can Teststand terminate the running teststep, programmed in CVI, via activeX ??

    When I press Terminate in TestStand while a Testprogram written in CVI is running the CVI routine should stop immediately. Is it possible to tell the CVI routine out of TestStand to stop?

    Hi,
    it's not really sensible to simply "kill" a program module this way because you could leave ActiveX objects flowting around memory, or initialised equipment at dangerous settings. What is quite simple to implement is a check from your module's side of things, so that if TestStand is trying to shut down (terminate, abort etc) then your module can close off appropriately.
    Have a look at the Execution.InitTerminationMonitor, and Execution.GetTerminationMonitorStatus methods described in the TestStand Programmers help file.
    Another option is to call Execution.GetStates, which will tell you if the operator (from TestStand's side of things) has requested a pause, or abort, etc. Again, information can be found in the TestStand Programmers help file.
    Hope that helps
    S.
    // it takes almost no time to rate an answer

Maybe you are looking for

  • Macbook Pro 13' or 15' for high school?

    I'm 16 and I'm planing on buying a Macbook Pro, I often do video and photo editing (Adobe CS6), the main purpose of the computer would be for me carry it around school and use it as my main computer both at home and classes. No matter what Macbook Pr

  • Trying to sort by rating for whole project

    I am a photographer working on several different series, and I am just setting up Aperture. I have one project that has up to 30 different albums contained within it. I plan to keep adding to this project (is that not a good idea?) as I do more shoot

  • Import fails for movies on Intel Macbook

    Importing with iPhoto on my MacBook fails on the first movie it encounters every time. The movies are 30 second AVI files from a Canon Ixus v3 connected via USB. The import will show no progress for about 5 minutes and then apparently time out. It re

  • Server going deaf...

    Not sure if this is really a networking issue or a mail server issue. Last week, our server box started going deaf. I first noticed it when my Apple Mail indicated that my mail accounts were offline. Then my customers started calling saying they were

  • Multiple Leave Request iviews in 1 portal instance

    Hi Guys, We are working on EP 7.0, I have 2 questions: 1st question: current our portal is shared by 3 agencies (A, B,C), which maps with 3 clients (100, 200, 300) in R/3, and the three ESS Leave Request should looks different.e.g: for agent A, he wa