Can LabVIEW call a function from a .sys file or is LabVIEW limited to dll access?

My vendor has sent me a .sys file with functions accessing their hardware.  Can i call these function from labview directly or do I have to wrapper the .sys with a dll?

Well a sys file is a kernel device driver. LabVIEW does not have any direct way of accessing such a driver. The way kernel drivers are accessed is usually through a DLL which makes calls to WinAPI functions such as CreateFile(), ReadFile(), WriteFile(), CloseHandle() and DeviceIORequest(). Since these WinAPI calls are basically just DLL calls too, you could theoretically use the Call Library Node to call them and access the kernel device driver in such a way.
However for any kernel device driver with more than one or two device driver calls, it will certainly be easier in terms of development, debugging and maintenance of the code, to write actually a dedicated DLL in C/C++ for this device driver and access that DLL from LabVIEW, especially if you consider the LabVIEW datatype limitations when designing the DLL interface (Basically this same DLL can then be called from any other Windows development environment, be it Visual Basic (similar datatype limitation as LabVIEW), Delphi, (Visual) C, LabVIEW or also various scripting environments like Python and Lua.
Some of the necessary WindAPI calls are rather involved and pose quite a bit of trouble to get the parameter data right in LabVIEw.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions

Similar Messages

  • Can I call a function from a dll in LabVIEW that returns:double*string and int.?

    I have a function from a dll that return a double* string and an integer. How can I call this function from LabVIEW? There is a possibility to work in LabVIEW with a double* string?

    pcbv wrote:
    > Hello all,<br><br>The header of the function is:
    >
    > "HRESULT WRAPIEnumerateDevices(WRAPI_NDIS_DEVICE **ppDeviceList, long *plItems);"
    >
    > where WRAPI_NDIS_DEVICE have this form:
    >
    > typedef struct WRAPI_NDIS_DEVICE<br>{<br>
    > WCHAR *pDeviceName;<br>
    > WCHAR *pDeviceDescription;<br><br>}
    > WRAPI_NDIS_DEVICE;<br><br>
    >
    > The function is from WRAPI.dll, used for communication with wireless card.
    > For my application I need to call in LabVIEW this function.
    Two difficulties I can see with this.
    First the application seems to allocate the array of references
    internally and return a pointer to that array. In that case there must
    be another function which then deallocates that array again.
    Then you would need to setup the function call to have a pointer to an
    int32 number for the deviceList parameter and another pointer to int32
    one for the plItems parameter.
    Then create another function in your DLL similar to this:
    HRESULT WRAPIEnumExtractDevice(WRAPI_NDIS_DEVICE *lpDeviceList, long i,
    CHAR lpszDeviceName, LONG lenDeviceName,
    CHAR lpszDeviceDesc, LONG lenDeviceDesc)
    if (!lpDeviceList)
    return ERROR_INV_PARAMETER;
    if (lpDeviceList[i].pDeviceName)
    WideCharToMultiByte(CP_ACP, 0,
    pDeviceList[i].pDeviceName, -1,
    lpszDeviceName, lenDeviceName,
    NULL, NULL);
    if (lpDeviceList[i].pDeviceName)
    WideCharToMultiByte(CP_ACP, 0,
    pDeviceList[i].pDeviceDescription, -1,
    lpszDeviceDesc, lenDeviceDesc,
    NULL, NULL);
    return NO_ERROR;
    Pass the int32 you got from the first parameter of the previous call as
    a simple int32 passed by value to this function (and make sure you don't
    call this function with a higher index than (plItems - 1) returned from
    the first function.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Can Any one tell me what is the step in calling a function from a *.lib file in Labview application

    Hi, I am working on Labview 8.0.
    I am trying to  communicate to a thrid party HW using the driver file he has provided to me.
    The drive file is a *.lib file.
    I am unable to call the function from the lib file.
    I could get only from a DLL.
    Pls help .
    Regards
    -Patil

    patil wrote:
    When it is possible in Lab Windows, why calling a function from a static library is prohibited?
    I was trying to use Function node, but found that it is only for functions from a DLL file.
    Will CIN be useful.? 
    LabWindows is not the same as LabVIEW. LabVIEW cannot call .lib files. LIB files are intermediary products and you need to use a wrapper DLL that's compatible with the object format of the .lib file. It's as simple as that. LabWindows creates C application and from that perspective is no different than a regular C
    compiler. That's why you can call .lib files because that's how .lib
    files are used.
    A CIN, as pointed out, is something completely different and will not help you.  

  • How can I call a function from a procedure

    I have a function named: f_calc_value which return the variable v_result. This function is part of a package.
    How can I call this function from a new procedure I am creating?
    Thanks

    or refer this theread....calling function from procedure

  • How to call a function from a JAR file

    Hi ALL,
    I am trying to call a Public function from a JAR file from my JAVA
    file. Can you please provide an example or suggest a good resource?
    Basically my java file Test.Java should call a function called 'export_a_doc' from a JAR file Export.jar. How do I refer this in my Java file and call 'export_a_doc'?
    Thanx

    Hi,
    HERE IS MY JAVA FILE
    // We need this for Starting our Export Process
    import com.newexport.Myclass;
    public class MyTest {
         // Our function to Start Export
         protected static void test(String[] args) {
         System.out.println("Starting. \n---------------------");
         Myclass p = new Myclass();
         try {
    p.Start_Export(args);
    System.out.println("Finished. \n---------------------");
         } catch(Exception e) {
    e.printStackTrace();
         public static void main(String[] args) {
         test(args);
    HERE IS THE BATCH FILE TO BUILD AND RUN
    cd \JNI\Srcs
    echo "-------------"
    c:\JBuilder7\jdk1.3.1\bin\javac -classpath C:\JNI\Export.jar MyTest.java
    echo "-------------"
    \JBuilder7\jdk1.3.1\bin\java.exe -classpath c:\JNI\Export.jar MyTest
    The Export.jar uses other jar files
    Raj

  • HTML/javascript interaction with swf content - can I call swf functions from JS?

    Hi,
    I've created an AIR application where the
    intialWindow.content is a HTML page / JavaScript application. On
    this HTML page I want to include some SWF content as a plugin (a
    Flex 3 app), so I have an object tag.
    From my SWF I can call out to JavaScript using
    flash.external.ExternalInterface fine. I can also call methods
    within the AIR and Flex APIs via the window or runtime objects.
    However, if I try to call methods within my SWF from
    JavaScript, nothing happens. Further, I can pass a function
    reference from my SWF to JavaScript (via ExternalInterface), and
    while I can see a valid function reference in JavaScript, calling
    it doesn't call the function within the SWF.
    Is this not supported? Or is this something else, like an
    applicationDomain issue? My SWF object is loaded via the app:/ uri,
    so I didn't think it would be that.

    I hadn't tried that, and it does work. Thank you. Everyone
    should note though that the documentation here
    Flex
    3 - External Interface
    and
    Flash
    9 - ExternalInterface.html
    says:
    "Note: Adobe AIR currently does not support the
    ExternalInterface class."
    which by my reading means that none of this should work,
    although it clearly does.
    The page
    Example:
    Using the external API with a web page container was most
    helpful in finding the solution, since it mentions referencing the
    object id of the plugin (e.g.
    window['my-object-id'].functionToCall()) when referencing the
    callback function.
    This
    page has a more concise example.

  • How can we call actionscript functions from js

    hi
    how can we call Action script function from js file . i
    tried ExternalInterface. add Callback() .but it throws an error .is
    there any other chance to call action script method .thnx in
    advance

    angadala,
    some people have found it is good to include the full
    qualification path, ie
    if (flash.external.ExternalInterface.available)
    flash.external.ExternalInterface.addCallback("ext_method_name",int_method_name);
    } // if (flash.external.ExternalInterface.available)
    There are also browser differences which affect how you find
    the Flex application object which are documented at
    http://www.adobe.com/livedocs/flex/3/html/help.html?content=passingarguments_5.html
    Richard

  • Can I call a "function" from a servlet?

    A few of my servlets need to perform about the same computations (have large sections of identical code).
    It would save some disk space to be able to call a procedure from different servlets.
    Can this be done? How?
    Thank you all.

    A few of my servlets need to perform about the same
    computations (have large sections of identical code).
    It would save some disk space to be able to call a
    procedure from different servlets.
    Can this be done? How?This wouldn't be the way to do it.
    Since Java is an object oriented programming language, you should use it's concepts to implement a 'basic' class and than extend it. This means: Create a class that contains the basic procedures (you will never create an instance of this class) and then create all the serlvet classes by extending the 'mother' class. Like this you have the common code once in the 'mother' class and the specific code in the specific servlets.

  • ADF: Can i call javascript function from java clsss method in ADF?

    Hi,
    I want to call javascript function in Java class method, is it possible in ADF? , if yes then how?
    or I need to use Java 6 feature directely?
    Regards,
    Deepak

    private void writeJavaScriptToClient(String script)
    FacesContext fctx = FacesContext.getCurrentInstance();
    ExtendedRenderKitService erks = Service.getRenderKitService(fctx, ExtendedRenderKitService.class);
    erks.addScript(fctx, script);
    }usage
    StringBuilder script = new StringBuilder();
    script.append( "var popup = AdfPage.PAGE.findComponentByAbsoluteId('p1');");
    script.append("if(popup != null){"); script.append("popup.show();"); script.append("}");
    writeJavaScriptToClient(script.toString());Timo

  • How can i call my function from a procedure?

    My function is:
    create or replace FUNCTION test(pAttributeName IN NUMBER)
    RETURN VARCHAR2 IS
    ret VARCHAR2(100) := NULL;
    VAR n1 NUMBER
    BEGIN
    SELECT Klartext INTO ret FROM piclist WHERE ATTRIBUTNAME = 'voltage_level' and PICLIST_ID =pAttributeName;
    RETURN ret;
    Insert into BM_ATTRIB(ID_ERFASSUNG,ID_ATTRIBNAME,ATTRIB_CHA,BM_ATTRIB_ID) VALUES(1,1,ret,1);
    exception
    when no_data_found then
    ret := 'AAA'   ------- you can return any default value,if you like
    --return ret;
    return NULL;
    when others then
    dbms_output.put_line('Exception:'||sqlerrm);
    End;
    I want to call it from a procedure!
    Please help!
    Nicole

    if the function is in the same package as the procedure then merely specify the function name and parameters:
    retcode := functionname(param1..paramn);
    If in another package then:
    retcode := packagename.functionname(param1..paramn);
    If the function is in another schema then you need to grant execute rights to the package/function to the schema trying to run the function:
    grant execute on packagename/functionname to otherschema;
    you need to be the package/function schema owner to do the above grant.

  • Segmentation fault when calling gpctr function from matlab mex file

    I am trying to write a simple mex file for square wave generation using counter1 of PCI-6035E. I am using matlab's native compiler to compile and link with the nidaq32 library, ver.6.9.3, with no errors. When the mex function is called from a matlab script, however, the program crashes at the first call, to reset the counter. (I can generate a square wave with the test panel.)

    Sorry for the delay in responding. I got caught up in other stuff. I am attaching my little program as requested. As you can see, I have just wrapped a mexFunction call round the example code for square wave generation. After I posted this, I tracked down a copy of BorlandC++, installed it on my computer and recompiled using that compiler and *b.* libraries. And would you know it, the program works. The question remains, though, why it doesn't work with Matlab's native lcc compiler. Plus, I have limited disk space, so if I can do without BorlandC, I can use the extra room. The runtime error was a Segmentation fault that I traced to the first call to GPCTR_Control.
    Attachments:
    pulsegen.c ‏4 KB

  • How can i call a function of a swf-file which is embedded as a Resource in 3D-Annotation?

    Hi.
    I use a Flash-menu as an embedded *.swf in a 3D-Annotation. Now i want to trigger one of the ActionScript-Function out of the 3D-Annotation.
    How can i get access to that function?
    Cause of it is embedded, the callAS() Methods still not possible. But how else can i do that?
    Can u give me a simple example? How is the usability of Flashvariable in the Ressource-Tab of 3d-Annotation?
    Kind regards
    Florian

    It depends to some extent on how your SWF has been bound to the 3D scene. If you have bound it using a script, then you have a FlashMovie object that has a .call() method - but if you've attached it to something using the binding option on the Resources panel you will need to collect a reference first. If you know you are going to talk to the SWF it's best to bind it using JavaScript.
    Let us assume you have a SWF in the resources collection but it's not bound to anything. In the 3D scene there is an object called 'cube' on which the SWF must appear as a material, and the SWF has declared a function to the ExternalInterface engine that is called "myFunction", which expects a string as a variable. Here's what you would put in the script attached to the 3D scene:
    var fm = new FlashMovie("demo.swf");
    var matl = scene.meshes.getByName("cube").material;
    matl.useFlashMovie(fm);
    fm.call("myFunction","hello");
    The call() method is strictly typed - for example if your AS function expects a boolean and you sent it a string, it will not execute. There is also a limit on the possible returned variables - e.g. you cannot send back an Object.
    Note that commands sent in the other direction using ActionScript's ExternalInterface.call() method are targeted at  document-level by default, not at the 3D API - so if your AS is trying to call something it must exist as a document-level JavaScript function. It is possible to divert this traffic into the 3D API using the FlashEventHandler object, but it gets complicated as your code must implement XML encoding of the traffic - this is done automatically by the document-level script but not by the 3D API.
    To answer your second question, in the resources dialog you can define the FlashVars string which is passed to the SWF when it loads - this is the same URL-encoded set of variables that you would send to a SWF when embedding it in an HTML page. It's a static string; you cannot read or edit it with JavaScript but this means it will still work if the user disables the JavaScript engine.

  • Calling a function from a dll written by using visual studio c++

    Hi, how can i call a function from a dll which is written by visual studio c++ in test stand?  Although the functions in dll are exported and i've chosen c/c++ adapter, i saw no function in test stand. Is there a different step while i'm calling a function from a dll written by c++ than calling a function from a dll written by cvi?

    Hey Sadik,
    Selecting the C/C++ DLL Adapter Module should be sufficient for this. When you drag an action step for this onto the Main Step and navigate to the location of the DLL, the function list should populate and you should be able to select the function you want to use. If this is not the case, would you be able to post this DLL so that we can test this on our end?
    Regards,
    Jackie
    DAQ Product Marketing Engineer
    National Instruments

  • Calling JavaScript function from Servlet ?

    I have a Servlet that needs to call a general purpose JavaScript function to retrieve some data. The JavaScript function sits in a file on the web server called general.js.
    How can I call this function from my servlet to retrieve an integer result ?
    Sarah.

    http://developer.netscape.com/docs/manuals/js/client/jsguide/index.htm
    Look for Java to JavaScript communication.

  • Can I call a function with an arguement of %ROWTYPE directly from SQL?

    I have the following function in a 10g DB:
    CREATE OR REPLACE FUNCTION f_is_eligible2 (in_dm_row IN amplify_dm%ROWTYPE)
    RETURN NUMBER
    IS
    I know I can call that function from another pl/sql function but I'm wondering if I can call that function directly from a SQL statement, something like this:
    SELECT f_is_eligible2(dm.*)
    FROM amplify_dm dm
    or
    SELECT f_is_eligible2(dm%rowtype)
    FROM amplify_dm dm
    neither of those worked so I'm thinking it's not possible but I thought I'd ask anyway.
    Thanks in advance!

    Not possible as said - but - based on what I'm seeing - you could simply pass the parameter(s) that are key on that table and - accomplish the same thing by modifying the function.
    not sure why you'd need the whole row if I'm interpretting the code excerpt.

Maybe you are looking for

  • Issue in end system

    Hi all i am using proxy to proxy scenerio. sending data from bank system to Bank analyzer i am getting the below error in the end system bank analyzer <SAP:Error SOAP:mustUnderstand="" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://sc

  • Dashboard Help!! Cant get into dashboard to delete PowerPC Widget

    I recently downloaded a widget to my dashboard and now when I attempt to go into dashboard I receive an error message that boots me out of dashboard and onto my desktop. The error message reads "You can't open the application motion because PowerPC a

  • Error while Using TYPE ....

    Hi All ... I have create a TYPE as Follows :- CREATE OR REPLACE TYPE test_type AS OBJECT (     id number(12),      name varchar2(50) Then , In Package Specification used ..... type test_tab_type is table of test_type; Now , In Package Body I am using

  • Webprinting with Excel

    Hi, iv heard that there is an how to existing wich describes web printing with excel. Anyone knows where to find it? Regards, Memoli!

  • REGARDING CONTROL COMMAND

    hi guru, in my alv  report the output of one field is net value(GMNGA) 22.000 1.000 1.000 5.000 10.000 10.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 150.000 6.675 100.000 0.000 7.000 0.000 25.000 40.000 10.000 15.000 1.000 1.000 1.000 4,000.