LabVIEW call Win32 API DLL function from third party

Hi everyone,
I'm trying to build a LabVIEW 2010 interface on 32-bit Window XP system to configurate and communicate to an Anglient laser head through its USB expansion box. I contacted the vendor and they shared a win32 API with some dll files. I started with a function called "A55292Find", but the CLF node always pop up error 1097.I checked the MSDN to get the corresponding LabVIEW data type for CLF.
My question is: Do I need to initialize those arguments? (How can I know the values of them if initialization is needed?)
Could anyone help me figure out what's the problem?
Here is what I have from API documents about this function:
The A55292Find function returns lists of handles and board types for all the 55292 USB
Expansion Modules connected to the system.
A55292RC __cdecl A55292Find(
HANDLE hBoxes[], // List of handles for the boxes found. (as Unsigned 32-bit integer numeric)
BOARDTYPE PortABrdType[], // List of board types for slot A boards (as Unsigned 16-bit integer numeric)
BOARDTYPE PortBBrdType[], // List of board types for slot B boards (as Unsigned 16-bit integer numeric)
WORD *spMaxBoxes); // dimension for all of the passed arrays. (as Unsigned 16-bit integer array data pointer)
// (function return type as Unsigned 32-bit integer numeric)
Parameters
HBoxes[] Array that will receive the list of HANDLES for all the 55292 boxes connected.
PortABrdType[] An array that will receive Slot ‘A’ board type information for each 55292 box.
PortBBrdType[] An array that will receive Slot ‘B’ board type information for each 55292 box.
spMxBoxes Passes the maximum number of values that can be held in hBoxes, PortABrdType, and PortBBoardType arrays to the A55292Find routine and returns the actual number of boxes found
The return value will be one of the following A55292RC return codes:
Value Meaning
A55292_NO_ERROR No error
A55292_TIMEOUT Timeout accessing a shared memory
Remarks
This routine must be called to obtain handles and board type information used in calling all the other routines. If there are significantly more array elements than boxes, the routine will take longer to complete.
These are the definitions: 
typedef DWORD A55292RC; enum{A55292_NO_ERROR, A55292_HANDLE_ERROR,...}
typeder WORD BOARDTYPE; enum{A55292_PCAL_BOARD, A55292_NO_BOARD, ...}
Thanks a lot,
Kang
Solved!
Go to Solution.
Attachments:
call A55292Find.vi ‏10 KB

nkang11 wrote:
Hi Mr. Kalbermatter,
As you told me, I should try to use the defined enumeration words as control and indicator.
For the previous CLF node, it successfully returned the hardware configuration (I have only connected a board at slot A):
But I really want to see a string return as "A55292_PCAL_BOARD" which is defined by "typedef WORD BOARDTYPE; enumeration {...}; Does that mean I need to change the data type or do something like "converter"? Or initialize the array first, then convert it to string type?
Right now, I'm trying to open the laser card by using "A55292PcalOpen(HANDLE hDev, SLOTSELECT SlotSelector);" function which requires to use the enumeration constants from " typedef WORD SLOTSELECT; enum {A55292_PORT_A, A55292_PORT_B};" but I'm confused to shot an constant control to a new CLF node.
Since almost all of the arguments in dll function are typedefined as WORD, short and struct et al, I hope you could give me some hints on it.
Thank you very much sincerely!
Kang
Depending on the actual C implementation you can simply create a LabVIEW enum with the according item names or use a ring control instead. Teh enum requires the numeric values of the items to be in consecutive order without any gaps in between. This is a given if the C definition never assigns a specific number to the item. If the C enum is not consecutive you need to go with a ring control instead.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions

Similar Messages

  • Calling Window's Dll Functions from Java

    Hello Audience,
    Is there a way to call Win32/64 based Dynamic-Link-Library functions from Java?
    Thanks,
    GenKabuki

    Yes.
    In general, if you are trying to call functions in an existing dll, you will have to write a "wrapper" dll that meets the java jni interface requires. There are tools around wich purport to generate these for you. Do a google serach; among other tools, you should turn up JACE.

  • Win32 API & DLL calls

    Is possible to call in java directly the Win32 API or using a DLL?

    I dont believe you can do it directly but I think you can call a VBSCRIPT that can call WIN32 API directly

  • Calling win32 api's from java

    Can someone tell's me how to call win32 api's from jdk1.4 ...
    Like in Delphi for example how to open cd-rom door...

    See this
    http://forum.java.sun.com/thread.jsp?forum=52&thread=94146

  • Call DLL function from JAVA

    HI!
    What's the best way (and simple) to call DLL function from JAVA.
    DLL function (developed in C) has two input parameters (string) and return an integer.
    Could you help with an example?
    Thanks a lot.

    Do a google search for 'JNI tutorial' and it will turn up hundreds of examples.

  • Calling an external C function from a C file in JNI

    Hello,
    I am trying to call an external C function, from a C file which is being called by a Java file. I am getting an unresolved symbol error. I have tried many things like, making the external C function in the format of JNI, etc, etc. It is still not working. I think it has something to do with linking the two C files. If anyone can please answer this, it would greatly help me. here is the code:
    HelloWorld.c:
    #include <jni.h>
    #include <stdio.h>
    #include "MyOldHello.h"
    #include "HelloWorld.h"
    JNIEXPORT void JNICALL
    Java_HelloWorld_print(JNIEnv *env, jobject obj)
         helloPrint();
         return;
    HelloWorld.java:
    class HelloWorld
         private native void print();
         public static void main(String[] args)
              new HelloWorld().print();
         static
              System.loadLibrary("HelloWorld");
              System.loadLibrary("MyOldHello");
    MyOldHello.c:
    #include <jni.h>
    #include <stdio.h>
    #include "MyOldHello.h"
    void helloPrint()
         printf("\nHello World!\n");
    MyOldHello.h:
    void helloPrint();
    Now i use the Visual C++ command prompt to compile this by saying:
    javac HelloWorld.java
    javah -jni HelloWorld
    cl -Ic:\Java\jdk1.6.0_20\include -Ic:\Java\jdk1.6.0_20\include\win32 -MD -LD HelloWorld.c -FeHelloWorld.dll
    and now it gives me the error saying that there is an unresolved external symbol, which is the call to helloPrint in the file HelloWorld.
    If anyone knows how to solve this, or how to call external C functions from a C file that is being called from a Java file using JNI, please respond.
    Thanks
    Nick

    Hi,
    In your post on velocity review, you did not compile MyOldHello.c. You compiled a C file that included the header file for it and called a method defined in the header. The linker is never going to be able to find the code for this if you do not include the object file for this.
    Try this. You will also have to add in any JNI libraries you need to link against but I am sure you could work that out.
    cl /c MyOldHello.c
    cl /c -Ic:\Java\jdk1.6.0_20\include -Ic:\Java\jdk1.6.0_20\include\win32 -MD HelloWorld.c
    cl /LD MyOldHello.obj HelloWorld.obj /FeHelloWorld.dll
    [http://msdn.microsoft.com/en-us/library/f35ctcxw(VS.80).aspx]
    Cheers,
    Shane

  • Calling a pure C function from JNI method

    Is it posible to call a pure C function from a JNI method.?
    I am communicating with an external device whose API is written in C language.
    Would it work this way
    If I declare empty native methods in Java and those methods in C call pure C methods?
    Thank You...

    Hello,
    I have a similar problem and I posted it here http://www.velocityreviews.com/forums/t724826-jni-calling-an-outside-function-in-the-c-file-which-is-being-called-by-the-java-file.html. If you can answer the question, it would greatly help me.
    Thanks
    Nick

  • Is it possible to call the Print Quote functionality from Custom ADF page

    Hi,
    We are researching if it is possible to call the Print Quote functionality from the Custom ADF application.
    Goal is to pop up the PDF report upon clicking the Print Quote button on the custom page. Is it possible ?
    Atleast advice on the direction to go forward is appreciated.
    Thanks
    Sai

    Hi ,
    Please check following thread on forum -
    Re: ADF: Calling OAF Page from ADF page
    Check this may also be useful-
    https://blogs.oracle.com/shay/entry/to_adf_or_oaf_or
    I have not tried yet but Steven Chan (Sr. Director OATG) suggest following methodolgy for this-
    https://blogs.oracle.com/stevenChan/entry/appsdatasource_jaas_ebs
    Thanks,
    Ashish

  • Without calling stored procedure or functions from database

    Hi,
    I am using Jdeveloper 11.1.1.5.0.
    =>How to do PL/SQL procedures and functions in ADF without calling stored procedure or function from DB?

    S, PL/SQL procedures and functions are done in Application Module class or in managed bean..By calling the stored procedures or functions from DB.
    But I am asking how to do if DB doesn't have any procedures,triggers and functions.

  • Calling a PL/SQL function from java

    I would like to call a pl/sql function from java. My pl/sql function is taking arrays of records as parameters. How do i proceed? Which specific oracle packages do I have to import?
    Please send an example.
    TIA,
    Darko Guberina

    Documentation here: http://download-uk.oracle.com/docs/cd/B14117_01/java.101/b10983/datamap.htm#sthref185
    says JPublisher can publish records too.
    But when I change the example given at http://download-uk.oracle.com/docs/cd/B14117_01/java.101/b10983/datamap.htm#sthref190 as following:
    PACKAGE "COMPANY" AS
    type emp_rec is record (empno number, ename varchar2(10));
    type emp_list is varray(5) of emp_rec;
    type factory is record (
    name varchar(10),
    emps emp_list
    function get_factory(p_name varchar) return factory;
    END;
    then I see <unknown type or type not found> at sql or java files generated. Any ideas?

  • Sender RFC from Third Party System

    I have a vendor who is actually communicating through RFC from third party Application to SAP R/3. Now we are trying have XI in between. Where as with minimal impact on both sides.
    Solution.
    1. Have the RFC made as ZRFC in XI. Let the vendor call the RFC in XI ABAP and internally make an RFC call through XI Interface to R/3 as Sync Interface. Because we need to report the information back to the system where the request initiated.
    2. Have RFC INI file copied as SAP Suggests under one of the folders. Develop the regular RFC to RFC Interface via XI.
    Is there any other alternatives other than the above mentioned solutions? Or out of those 2, which one will provide the best performance
    Appreciate any feedback. Please advice

    That's exactly what we are trying to achieve here. By Eliminating direct connection R/3, we are placing XI in between. But with the budget/timeline constraints from the Partner side, we are trying to have minimal change on the partner side. They might not change something to web service etc...
    Here is the text about INI file
    You can configure the non-SAP RFC client to connect to the sender communication channel in the following ways:
    ■       By defining the parameters PROGID, gateway-host, and gateway-service within the saprfc.ini-file using RFC-SDK.
    ■       By using appropriate parameters in the function RfcOpenEx.
    If you use the saprfc.ini-file, the respective RFC destination has to be of type R.
    All the parameter values used within the saprfc.ini-file or with the function RfcOpenEx should match the entries maintained within the corresponding sender communication channel.
    Example for the saprfc.ini-file is as follows:
    DEST=RFCCLIENTEXT
    TYPE=R
    PROGID=P106646.HKExternalClient
    GWHOST=pwdf2153
    GWSERV=sapgw40
    Please check the following link, for the same  text on RFC Sender
    [Help.SAP|http://help.sap.com/saphelp_nw04/helpdata/en/67/6d0540ba5ee569e10000000a155106/content.htm]
    Using the same Sender RFC for non-SAP System, please share any ideas

  • DMS document migration from Third Party DMS server(Omnidocs)

    HI guys,
    I would like to migrate document from Third party DMS server to  sap DMS server.
    What is the apporach.
    1. The thir party dms server is protected with login name and password.
    How i can extract data from the software.
    Please spread your thoughts on this.
    what is the function module to  download the contents of the server. by passing the url.
    with regards
    Giri

    use ALE scenario to send the documents

  • Incoming invoice from third party system

    Hi All,
    Could you please help in choosing functional module or bapi or badi's for incoming invoices that are receiving from third party system. I have no ideal about that but the SAP has to be loaded using idocs. what is the reason to choose the above ones
    Thanks in advance for response.

    Why not starting with docu?
    The general process  is explained well in help.sap.com
    As a service, put this into your Google: vendor invoice edi site:help.sap.com

  • Accessing BW Query from Third Party System

    Hi,
    We have a requirement by which user can do the following through the third party system.
    1. User will enter the Parameters in the third party system.
    2. User will then call the BW Query with the above parameters from the third party system.
    3. BW query should get execute based on the parameters (variables) and output to be displayed.
    3. After displaying the output, the same should get passed into the db tables or the flat file to the third party system.
    Ideal steps will be :
    1. Enter the parameters in the third party system
    2. Calling the query from third party system with the
    parameters
    3. Executing the BW query
    4  Displaying the output and
    5. Sending the output back to the third party system
    Kindly advise how can we handle this scenario.
    Regards
    Ramesh Ganji

    hi,
    you can use third party etl tools. I used XtractIS for microsoft analysis services.
    http://www.theobald-software.com/cms/en/xtract-is/xtract-is-plugnplay-mit-sap-und-den-ssis.html

  • Item master synchronisation from third party system to SAP

    Hello ,
    I would like to understand how we can desgin flow of data in case of changes in Catalog from third party system to SAP.
    We have implemented Catalog functionality.  Catalog maintained in third party system is accessed from SAP for procurement through catalog button.
    Now we want to update SAP contracts when ever there is change in prices in third party system. In this we are also validating currency,UOM, delivery time etc.
    How does we can make this synchronisation? What are the possible solution for this?
    You valuable inputs will be highly appreciable.
    Regards,
    Prashant

    Hi Neetu
    you have to mainatin Item text and not for material PO text...
    Do these settings:
    SPRO->MM->Purchasing->PO->Texts for POs--->Define copying rule for item texts..
    then check you should have a entry for "Item Text" if not then
    Put a Consec no. and against it enter item text. then for this you have to maintain text linkage where u should have source object as Purchase requisition.
    please confirm if these settings are already there?
    regrds
    yogesh

Maybe you are looking for

  • If I go in store will I still get an extended warranty (without AppleCare) for my Macbook Pro as a student?

    I am buying the 15" Macbook Pro w/ Retina Display (2.3GHz Quad-Core Intel i7, 16GB, 512GB flash storage...) which is £2,199. I'm going to University and so therefore I am apparently entitled to a 15% discount which makes the price £1869.60.  I went i

  • Quicktime won't work in 64Bit mode

    Hi, i have following problem: The Quicktime-plugin does not show any Quicktime movies when i start Safari in 64Bit. It only does when i switch to 32Bit. I'm using Safari 5 - SnowLeopard 10.6.3 - latest Quicktimeplayer - Intel Core 2 Duo/MacBook Any i

  • Itunes has stopped working message

    Sorry to post this but I've been without itunes for 2 weeks now. I've tried the various fixes but none of them seem to work, the problem report I've got says~:- Problem Event Name: BEX Application Name: iTunes.exe Application Version: 10.2.1.1 Applic

  • If i install a new version of itunes, will it erase my current version and data?

    I am trying to set up my new iphone 5.  i always get msgs from icloud that i have too much data so i have to purchase more space, so i have to restore from itunes backup.  i just backed up my iphone 4 to itunes, and itunes says it's updated - there a

  • Transfer IDOC types to client server

    Hi Experts, I am creating IDOC types on our sandbox server for some integration testing with XI sandbox server. After successful testing we need to replicate all IDOC types/ messages and partner profile settings to the client server so that data can