Calling IVI/Visa drivers from TestStand

I want to call directly to IVI or Visa driver DLLs using the DLL Flexible Prototype Adapter (because not every instrument in the world is a power-supply, dmm, scope, function-generator or switch). So far, straightforward. But when an error happens, I want it to automatically call the XXXX_error_message() function, to set the Step.Result.Error.Msg string.
The Flexible Prototype Adapter won't do that by itself. I was thinking of adding that functionality to it (making what I would call an "IVI/Visa Driver Adapter"), but I can't find the source code for the adapter. Is it not included with TestStand? I've been amazed by how much source code is included, maybe I'm just missing this one. Is it even possible to write user-defined
step adapters?
- Ron

I had a brainwave, a fairly elegant solution to my problem that doesn't involve modifying the DLL Flexible Prototype Adapter.
I knew Post Expressions wouldn't cut it, but it just occurred to me to use a Post substep. It works well. So, now I just need to create a custom step type for each instrument driver I'll use, and add a Post substep that calls a bit of code like this:
void __declspec(dllexport) TX_TEST Handle_age1962_error(ViStatus error_code, char error_message[] )
if( error_code != 0 ) {
age1962_error_message( VI_NULL, error_code, error_message );
Just make the Post substep call that using the DLL Flexible Prototype Adapter:
Handle_age1962_error( Step.Result.Error.Code, Step.Result.Error.Msg )
Now the run-time
errors returned by the age1962 driver will have nice human-readable message strings associated with them. And it's a whole lot easier than writing a wrapper and step-type for every single instrument function.
- Ron

Similar Messages

  • I am using the NI application note "Calling IVI-COM drivers from LabVIEW" I created an Automation Open and an Invoke Node, after wiring

    the 2, the AN asked to right click the Invoke Node(this is step9) and choose initialize. However there is no intialize option on the pop up menu. Anything am I doing wrong? I am using Labview6 and I did add the "enableCustomInterface=True" in the INI-fileThank you for your help.
    T Tall

    the 2, the AN asked to right click the Invoke Node(this is step9) and choose initialize. However there is no intialize option on the pop up menu. Anything am I doing wrong? I am using Labview6 and I did add the "enableCustomInterface=True" in the INI-fileT Tall,
    What's the number of the application note "Calling IVI-COM drivers from LabVIEW"? I'm unable to find what you're looking at.
    Thanks,
    --Bankim

  • I want to call the DMM- SFP from Teststand using IVI

    Hi I have a Teststand 3.0 system with a NI-PXI 4070, and I want to call the DMM-SFP from Teststand using the IVI driver architecture. Unfortunatley I cannot figure out how to link the DMM-SFP to the Logical name.

    ADL,
    If you are using the TestStand IVI step types, after you have added the logical name in MAX, you can insert an IVI DMM step type. Then right-click on the step and choose "Edit IVI Dmm". You should be able to choose from the Logical Name Ring Control the logical name you created in MAX.
    If you haven't added the logical name into MAX, depending on what version of MAX you have, you can refer to Using Measurement & Automation Explorer 2.x to Configure Your IVI System or look in the IVI help that comes built into MAX 3.0.
    If you checked there already or have another question, please let us know!
    Regards,
    Shannon R.
    Applications Engineer
    Nati
    onal Instruments

  • Some errors when calling LabVIEW VIs Interactively from DIAdem

    Hi! I'm having some trouble using the "Calling LabVIEW VIs Interactively from DIAdem" found on:
    http://zone.ni.com/devzone/conceptd.nsf/webmain/1A98AB48E35D913086256E23004E6A22
    Following the troubleshooting section didn't resolve the issue. I
    recompiled and built the exe (DIAdemLabVIEW.exe) for version 7.1.1,
    which I am developing on. But still I got the same error message, after
    a waiting for about a minute, on a diadem popup window:
    Error in <MenuAdd...ctDo.vbs (row:1, column: 1)
    Error in <addmenuentry.vbs (row:14, column: 3)
    ActiveX component can't create object.: 'DIAdemLabWIEV.Application'
    Using the llb's and exe's that was included with the installer worked
    flawless, with the exception that LV 7.1.1 vi's didn't appear on the
    popup window(DIAdemLabWiev.vi). So I tried to recompile and build for
    the 7.1.1, with this result.
    I'd be very grateful for fixes or solutions for this problem!
    Regards
    Roger Isaksson

    Brad, thanks for the reply! Below is my (correct?) modification of your script. Have I got it right?
    Dim lvapp, vi, viPath, paramName(1), paramVal(1)
    Set lvapp = CreateObject("LabVIEW.Application")
    viPath = "C:\TEMP\Test.exe"
    Set vi = lvapp.GetVIReference(viPath)
    vi.FPWinOpen = True
    paramName(0) = "In Name"
    paramVal(0)  = "In Value"
    paramName(1) = "Ut Name"
    Call vi.Call(paramName, paramVal)
    Call lvapp.Quit()
    MsgBox "Parameter1 Value = " & paramVal(1)
    I am not sure about the format of the <paramName(0) = "In Name">.
    The control name is "In" and is a I32, the name for the indicator is
    "Ut" and has the same storage type as the control.
    Running the script gives an error in line 4, that is the <Set vi =
    lvapp.GetVIReference(viPath)>. I'll attach the exe and the error
    message.
    I have another question regarding the relatively large amount of RAM
    that diadem uses for export from my labview application to diadem. More
    than 10 times the size of the data is required for exporting to diadem.
    Since our application use relatively large files, actually up to
    several GB's, this soon becomes problematic. See the attached picture
    of the memory usage after exporting a 10MB segment (contains 42
    channels of measurement data). Your help in these matters would be
    appreciated!
    Regards
    Roger Isaksson, Damill AB
    Message Edited by Roger Isaksson on 09-09-2005 10:22 AM
    Message Edited by Roger Isaksson on 09-09-2005 10:22 AM
    Attachments:
    VBError.JPG ‏181 KB
    Test1.vi ‏9 KB

  • When I call VI on Linux from Teststand on Windows using TCP/IP I get "file not found error".any sugeestions?

    I am trying to execute a VI running on Linux from Teststand running on windows 2000 prof ,both running on two different machines.I used TCP/IP for the interface using the following steps on Labview VI:tools>options>VIserver>TCP/IP and gave the ip address of both the machines.When I gave the file path as c:\home\test.vi in Edit labview Vi call window(the Vi in linux is stored in /home/test.vi)and also in remote vi path:/home/test.vi,I get a file not found error.The teststand version is 3.0 and labview is 7.0.Any idea why this is happening and any solutions?

    priya guru,
    Here is a knowledge base that addresses your question: �How do I call test VIs that reside on a non-Windows platform from TestStand?�
    You also need to set TCP/IP Access found in Tools->Options->'VI Server: TCP/IP Access'. Make sure that you list the IP address in the Access List to allow TCP/IP access to that machine. Finally you need to specify which VIs are accessible to remote applications. Open up Tools->Options->'VI Server: Exported VIs' and provide paths to the VIs you wish to be remotely accessible.
    I have attached an example VI that demonstrates VI Server in action. Please post back if you are still having problems. Good luck!
    Cr
    aig H.
    National Instruments
    Attachments:
    Remote_Run_--_VI_Server.zip ‏88 KB

  • Problem calling a LabVIEW VI from TestStand

    I'm am currently migrating my companies test scripts from TestStand 3.0 to TestStand 4.1.1 and VI's from LabVIEW 7.0 to LabVIEW 8.6.  I have re-saved all of the sequence files to the new version as well as performed the 'Mass Compile' operation on all of our custom VI's.  During the execution of one of the sequence files a call is made to a VI (through a LabVIEW library).  If I run this sequence file on a machine with the development software and have the Adapter for LabVIEW set to use the development system the VI executes as expected.  If I have the adapter set to use the Run-time engine (in this case 8.6, the same as the development version) I get an error:
    "LabVIEW:  The VI is not executable. Most likely the VI is broken or one of its subVIs cannot be located.  Open the VI in LabVIEW using File>>Open and verify that it is runnable."
    I noticed that in the library file there are sub VI's that are called from  "C:\Program Files\National Instruments\LabVIEW 7.0\vi.lib"   This directory only exists on machines that have the development system installed.  Perhaps this is why the VI does not execute using the runtime engine

    Ray is right. Development environments are backwards compatible (you can run VIs compiled in LabVIEW 7.1 or 8.5 in LabVIEW 8.6). That's why you can run your sequence just fine on the development system, but on the target machines you are using the LabVIEW Run-Time engine, which is not backwards compatible. With the Run-Time engine, ALL VIs need to be in the same version as the Run-Time engine (including VIs in vi.lib, tools.lib, instr.lib, etc.).
    The first thing I would check is make sure everything has been mass compiled to 8.6, including vi.lib. If you are still getting the error you should be able to tell at what point the error occurs so you can look at that specific VI. Open it and confirm there isn't a broken run arrow and check to see what subVIs that VI is using and confirm they all have been compiled in version 8.6 too.
    This should get you going, but if not just let us know.
    Message Edited by CorbinH on 05-07-2009 08:24 AM

  • How to use/call IVI-C drivers in Visual Studio 2012

    Hello,
    i downloaded some IVI-drivers and saw that they all contain IVI-COM and IVI-C drivers.
    I am trying now to call the IVI-C drivers in my Visual Studio 2012 but i cannot find any examples how to do this.
    Can someone provide a simply example project to demonstrate how this would be done?
    At the end this should become also a DLL.
    Thanks a lot for help
    BR

    Hello nyc,
    thank you for the PDF link that describes how to do this in C# and VB.Net.
    I also found a PDF on the same site that shows how to do it in C++.
    But the example is only how to create a console application.
    But i need to to create a DLL.
    Thanks
    BR

  • How to call a CString array from TestStand

    I have a C++ DLL that uses a CString array, CString myString[ ],  that I need to pass back to TestStand 4.0 for inclusion in my results database.
    In the TestStand module definition the parameter argument Description comes up as a CStriing pointer (CString*) instead of a CStringArray.
    When I put my array of strings into the Value Expression I get an error: Expected String, found Array of Strings.
    I have no trouble passing just a string pointer but that's not working either.
    Can someone help?
    Thanks,
    Steve S

    Hi Steve,
    I don't think that you can pass a CString Array from C++ DLL to TestStand 4.0 directly.
    But you can do it another way: concatenate all Strings by a delimit in your CString Array to build a new String,  then pass it to TestStand. In TestStand you can separate those Strings by the delimit, and rebuild a String Array.
    For example:
    // If this is your CString Array.
    CString myString[] = {"AAA", "BBB", "CCC"};
    // Build a  new String in your C++, and pass it to TestStand.
    char  *myNewString = "AAA~BBB~CCC";
    // Separate myNewString and build an Array in TestStand...
    Hope that can help you!
    Message Edited by My NI on 11-29-2007 11:34 AM
    Regards
    MY

  • Agilent's IVI-COM Drivers

    Can TestStand call Agilent's IVI-COM Drivers and how to configurate them with NI MAX?
    "Only a life lived in the service to others is worth living..." - Albert Einstein

    Estonia,
    At the very least, Agilent probably provides a dll interface to calling their driver. You could call those dll functions from TestStand using the C/C++ DLL adapter (or the Flexible DLL Adapter if you are using TestStand 2.0.1 or below). If they provide an ActiveX or COM interface (which sounds highly likely considering the name of IVI-COM) then you can use the TestStand ActiveX/COM adapter to call into these drivers.
    NI MAX is the NI Measurement and Automation explorer. Because these drivers are not National Instrument's drivers there will not be an interface for them to be used within NI MAX.
    Let us know if you have any other questions.
    Regards,
    Shannon R.
    Applications Engineer
    National Instruments

  • NI IVI Soft front panel compatibility with IVI-COM drivers

    Does IVI soft front panels support IVI-COM instruments drivers ?
    For example, I would like to use IVI-COM driver for Tektronix TDS5000 with TestStand...
    Jean-Louis SCHRICKE
    ├ CTA - Certified TestStand Architect (2008 & 2010 & 2014)
    ├ CTD - Certified TestStand Developer (2004 & 2007)
    └ CLD - Certified LabVIEW Developer (2003 & 2005)

    The IVI soft front panels that ship with the NI IVI Driver Toolset do not support calling IVI-COM drivers. The soft front panels support IVI-C drivers. On Instrument Driver Network there are IVI-C drivers for other Tektronix scopes.

  • Agilent 34980A simulation using IVI-drivers in Teststand?

    Hello! I am unable to simulate 34980A in TestStand and here are some results based on testing:
    Agilent 34980A is linked to logical name SampleDmm. Simulate With: Specific Driver.
    IviStepTypes.seq used with only DMM and Switch steps.
    Using IviDMM IVI-C causes runtime-error in Ivi DMM Configure Single Point: Component Works IVI Control Error: The IVI Configure operation failed for logical name 'SampleDmm'. Details: Extension capability not supported by instrument driver.  (Base)
    Using IviDMM IVI-COM causes runtime-error in Ivi DMM Read Single Point: Component Works IVI Control Error: The IVI Read operation failed for logical name 'SampleDmm'. Details: Attribute ID not recognized. [IVI Error Code:  BFFA000C] Source: TSIviStepTypes
    Skipping Ivi DMM SFP -step removes that error but next one waits in Ivi DMM Configure Multi Point: Component Works IVI Control Error: The IVI Configure operation failed for logical name 'SampleDmm'. Details: Attribute or property not supported. [IVI Error Code:  BFFA0012] Source: TSIviStepTypes
    Skipping multi point steps helps until Ivi Switch Connect where another error hits: Component Works IVI Control Error: The Connect operation failed for logical name 'SampleDmm'. Details: No path was found between the two channels. [IVI Error Code:  BFFA2011] Source: TSIviStepTypes
    I find some similarities in forum post that involves HP 34401A and IVI .
    According to IVI-C Class Driver Support for IVI-COM Specific Drivers the fault might be in 64 bit system (the note in the end). Is this the case? I can't use IVI-COM-drivers in 64bit system?
    Example's default DMM Hewlett-Packard 34401A Digital Multimeter simulation works perfectly in unmodified example(it has IVI-C). It even shows simulated numbers in the SFP which is zero all the time with Agilent.
    Has anyone succeeded to simulate 34980A properly in TestStand? Any knowledge about how to solve this thing? Any help is welcome. Thank you.
    Setup:
    -Teststand 5.1
    -Windows 7 64bit
    -IVI shared components 2.2.1
    -Visa shared components 1.5 64bit
    -Agilent IO libraries suite 16.3 Update 1
    -Agilent 34980A IVI Driver 1.5.3
    -MAX/Agilent 34980A published APIs:
        -IviDmm 4.1 IVI-COM (IVI-C tried with less success)
        -IviSwtch 4.0 IVI-C & IVI-COM

    Some IVI drivers are designed to work in simulation mode, that is, the virtual instrument can be defined in MAX but no physical instrument is necessary to use the "instrument". If you turn off the simulate checkbox on the validate dialog box, TestStand will create the instrument session without simulation and the driver will attempt to talk to a physical instrument. If no physical instrument definition is available or if the address defined for that virtual instrument is incorrect, the above error can occur.
    Scott Richardson (NI)
    Scott Richardson
    National Instruments

  • IVI specific drivers usage in Teststand

    Hi,
    I am using Teststand 2.0.1 and i want to use some of the IVI specific drivers in my application. Can somebody guide me how to do that. Another clarification, if we use the IVI drivers which fall into any of the classes how do we achieve the interchangeability? Is it only through MAX that we achieve it.
    Regards,
    Siddu

    Siddu 140,
    I am not one of our TestStand supporters so I may not understand your core question exactly...but I'll give it a shot! We can keep track of our IVI drivers and IVI sessions in MAX as Aaron alluded to. You will have an IVI Drivers tab in your Configuration window in MAX where you can perform a variety of actions. From what I understand, once you have correctly configured your IVI Driver in MAX you can see it in TestStand. I have attached a ZIP file containing a text file of instructions and screenshots pertaining to the instructions that discuss how one configures IVI Drivers in MAX. Also the help window on the right-hand side of MAX when you select the IVI Drivers tab is a great resource (see also: National Instruments' IVI for more information).
    With regards to the CAN driver there really isn't the concept of a CAN IVI driver. National Instruments provides a CAN driver for our CAN product line. More information on National Instruments CAN products can be found here: National Instruments' CAN.
    I hope this information helps out and if you have any other questions please post back!
    Craig H.
    Attachments:
    IVI Screenshots.zip ‏627 KB

  • Make IVI drivers from LAB VIEW drivers

    Hello,
    I have some questions about IVI drivers and Teststand.
    how can I make the interface between teststand and the IVI drivers. Or
    how can I import the IVI drivers in teststand, so that I can use them
    kind regards
    samuel

    Hi,
    You can use the LabVIEW adapter to call the instrument driver VI's direct. Use the Action Step Type to perform the configuring and one of the Test Step Types (Pass/Fail, Numeric Limit Step Types) when acquiring a reading.
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • How to call a python script from a TestStand sequence?

    Please tell me how is it possible to call a python script from a TestStand sequence.
    Thank for your help in advance.
    Imre

    Here you can find some information about Python and LabVIEW:
    http://forums.ni.com/ni/board/message?board.id=170​&message.id=124424&query.id=149647#M124424
    If you have LabVIEW, you could use LabVIEW steps to call your Phyton Scipts.
    Another solution would be, to do, what is decriibed in the thread directly in TestStand:
    You can call a dll or .NET assemblies directly from teststand, or use the "Call Executable" TestStep.

  • Problem calling more than one instance of a dll from TestStand

    Hi,
    I've posted this message in the LabWindows forum a few days ago and haven't gotten any answer. I have made a DLL with the evaluation version of LabWindows 7.1 to connect to a Telnet server and perform various commands. This DLL is used with TestStand 3.1 . In TestStand, I have to connect simultaneously to the same Telnet server twice to start an application with both of those connection, with different parameters. I use Threads in TestStand to call the DLL and everything seems to be fine on that side. I enter the DLL at the same time for both threads but it seems that the 1st thread waits until the 2nd thread is at the end of the function before he executes the InetTelnetOpen command to start the Telnet session. Is it normal that we can only have one Telnet connection at a time?
    To see that I've placed some time stamps in a log. For the first Thread, almost a minute passes by between the first 2 time stamps but in the 2nd thread it take less than a second.
    Yet, they both wait for eachother to exit the DLL as the time stamp at the end of the execution is the same.
    I really need some enlightenment here ;-)
    Louis
    Attachments:
    TelnetTest.txt ‏3 KB

    Tiwi,
    The blocking that InetTelnetRunScript does is probably there for a reason. That method is probably not safe for multiple threads to call into at the same time. There is likely another way to do what you are trying to do that can be done in parallel. Perhaps with lower-level telnet function calls. I recommend you post to the CVI forum asking if there is another way to do what you are trying to do from multiple threads in parallel. This does not sound like a teststand issue. If you are calling into your dll from multiple testand threads, then the code in your dll function is being executed in parallel. The cvi function you are calling however, might not be reentrant (reentrant means able to be called by multiple threads in parallel) so it is making one of your threads block until the other completes. I suspect there is a different way to do what you are trying to do that will not have this problem, but I think the changes that you will need to make will be in the dll and not on the teststand side. I recommend you post to the CVI group and explain what you are trying to accomplish and see if they have a solution for you.
    Hope this helps,
    -Doug
    P.S. Each process on the Windows operating system (of which teststand is one) can only load one copy of any particular dll at a time. Also, loading multiple copies is not something that would be likely to solve the problem you are running into. One possibility is to use the call executable step type and create an executable that does what your dll function does, but that is probably not the best solution and might still end up blocking at the same location. The best solution is probably to use an alternate method of accomplishing whatever you are trying to do with the telnet function you are calling that does not have the limitations of that function.

Maybe you are looking for

  • Unable to load project after delete some path with files but not used at all

    Im using the demo of Premiere Pro CC last demo download today. All the fuc**ng day editing some videos, and saved, then I deleted som efolder containing some video files (almost not used) then when I try to open premiere the project I were working, p

  • New Empty Rows in Planning Layout

    Hi All I am having a bit of a rough time with 2004S and planning layouts. In order to test that I am not doing something stupid (which is fairly likely) I have created a simplified model (IC, Aggr Level etc etc) with which to prototype. I have an Inf

  • How to implement Inline Views in ODI?

    Hi, How to implement the following query (inline view) in ODI? Query: SELECT * FROM Table_one t1, (SELECT * FROM Table_two (includes some where conditions) t2 WHERE conditions; How to set the conditions at the table level (not at the interface level)

  • AppleTV screensaver in Leopard?

    The AppleTV has a great (Core Animation) screensaver which has photos floating in a layered, 3D way, spinning and moving vertically. Is this available under Leopard or anyone know where I can get it for my macbook? Thanks!

  • Installing Proto DW extension fails

    When attempting to install the Dreamweaver Proto extension, I get an error message stating "The extension "Adobe Proto Dreamweaver Extension" does not contain valid signature. The extension will not be installed." Is there a fix for this?