How to call a dll with special parameters in Labview?

Hi,
I have a dll file (compiled in C++) and I would like to call the individual functions from this dll file.
I do not know however, how I must correctly define the initial parameters in LabView.
That is the function, which I would like to call:
DWORD OpenDiagDriver ( char* port,
LPCSTR path,
CANObjects CANObj[],
WORD BitTiming = 0x4167);
CANObjects CANObj[] is a pointer to array with CAN configuration data
typedef struct
DWORD Ident;
BYTE Config;
}CANObjects;
CANObj[0].Ident= 0x18DA0000;
CANObj[0].Config= 0x8C;
CANObj[1].Ident= 0x18DA0000;
CANObj[1].Config= 0x84;
WORD BitTiming= 0x4167;
I made a vi, but it doesn’t work.
Attachments:
example.vi ‏29 KB

Hard to say without the full C source. Are you building the DLL according to the CIN rules (see Using External Code in LabVIEW)? Mapping clusters to C code in DLLs is not a simply process and we generally recommend to create wrappers. However, since your structures are fairly straightforward, you could use the "Adapt to Type" as you are trying to do.
I recommend checking out the mentioned manual and also the examples in \examples\dll\data passing\Call Native Code.llb and the associated C files.
Brian Tyler
http://detritus.blogs.com/lycangeek

Similar Messages

  • How to call stored procedure with multiple parameters in an HTML expression

    Hi, Guys:
    Can you show me an example to call stored procedure with multiple parameters in an HTML expression? I need to rewrite a procedure to display multiple pictures of one person stored in database by clicking button.
    The orginal HTML expression is :
    <img src="#OWNER#.dl_sor_image?p_offender_id=#OFFENDER_ID#" width="75" height="75">which calls a procedure as:
    procedure dl_sor_image (p_offender_id IN NUMBER)now I rewrite it as:
    PROCEDURE Sor_Display_Current_Image(p_n_Offender_id IN NUMBER, p_n_image_Count in number)could anyone tell me the format for the html expression to pass multiple parameters?
    Thanks a lot.
    Sam

    Hi:
    Thanks for your help! Your question is what I am trying hard now. Current procedure can only display one picture per person, however, I am supposed to write a new procedure which displays multiple pictures for one person. When user click a button on report, APEX should call this procedure and returns next picture of the same person. The table is SOR_image. However, I rewrite the HTML expression as follows to test to display the second image.
    <img src="#OWNER#.Sor_Display_Current_Image?p_n_Offender_id=#OFFENDER_ID#&p_n_image_Count=2" width="75" height="75"> The procedure code is complied OK as follows:
    create or replace
    PROCEDURE Sor_Display_Current_Image(p_n_Offender_id IN NUMBER, p_n_image_Count in number) AS
        v_mime_type VARCHAR2(48);
        v_length NUMBER;
        v_name VARCHAR2(2000);
        v_image BLOB;
        v_counter number:=0;
        cursor cur_All_Images_of_Offender is
          SELECT 'IMAGE/JPEG' mime_type, dbms_lob.getlength(image) as image_length, image
          FROM sor_image
          WHERE offender_id = p_n_Offender_id;
        rec_Image_of_Offender cur_All_Images_of_Offender%ROWTYPE;
    BEGIN
        open cur_All_Images_of_Offender;
        loop
          fetch cur_All_Images_of_Offender into rec_Image_of_Offender;
          v_counter:=v_counter+1;
          if (v_counter=p_n_image_Count) then
            owa_util.mime_header(nvl(rec_Image_of_Offender.mime_type, 'application/octet'), FALSE);
            htp.p('Content-length: '||rec_Image_of_Offender.image_length);
            owa_util.http_header_close;
            wpg_docload.download_file (rec_Image_of_Offender.image);
          end if;
          exit when ((cur_All_Images_of_Offender%NOTFOUND) or (v_counter>=p_n_image_Count));
        end loop;
        close cur_All_Images_of_Offender;
    END Sor_Display_Current_Image; The procedure just open a cursor to fetch the images belong to the same person, and use wpg_docload.download_file function to display the image specified. But it never works. It is strange because even I use exactly same code as before but change procedure name, Oracle APEX cannot display an image. Is this due to anything such as make file configuration in APEX?
    Thanks
    Sam

  • How to call a DLL with a char or a uint8_t

    Good afternoon,
    I need to pass an array (image) to my dll.
    I was able to successfully do this using 
    imageProcess(int **a, ... ){;}
    function declaration and using a signed or unsigned 32 bit integer as data type in labview DLL call
    However, when I changed my function to either
    imageProcess(char **a, ... ){;}     or       
    imageProcess(uint8_t **a, ... ){;}
    And when  I set the Labview Dll Call data type to    unsigned 8 bit integer
    I get a Broken Arrow
    With error: The function name specified for this node cannot be found in the library. Right-click the Call Library Function node and select Configure, then choose the correct function name.
    I am also using IMAQ ImageToArray to obtain my array and using the ImagePixels(U8) output
    Thank you,

    Another possibility to make functions be unmangled is declaring them as extern "C" like this:
    for a single function.
    #define LibFunction __declspec(dllexport)
    extern "C" MgErr LibFunction MyFunction(uInt8 *);
    or:
    #define LibFunction __declspec(dllexport)
    #if defined(__cplusplus) || defined(__cplusplus__)
      extern "C" {
    #endif
    LibFunction MgErr MyFunction1(void);
    LibFunction MgErr MyFunction2(uInt32);
    #if defined(__cplusplus) || defined(__cplusplus__)
    #endif
    for multiple function prototypes.
    This will tell the compiler to not mangle the names if it is invoked on a cpp file. And the LibFunction declaration is to declare the function as exported to the compiler, saving you to have to provide a DEF file for that purpuse. Remember that other compilers and platforms might and often do use a different syntax for the export declaration.
    And alternative could be:
    #define LibFunction(retval) extern "C" retval __declspec(dllexport)
    LibFunction(MgErr) MyFunction(uInt8 *);
    Also before claiming that there is a huge bug in LabVIEW that needs fixing you should make sure that you understand all in and outs of your C compiler toolchain. Something I wouldn't dare to claim to do!
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to call PDF Report with parameters in jdeveloper 10.1.3

    Hi all,
    how to call PDF Report with parameters in jdeveloper 10.1.3
    for example I have Report name is repdept.pdf with parameter as deptno
    and I want call this Report from JSP page ?
    thanks
    frank

    Hi all,
    how to call PDF Report with parameters in jdeveloper 10.1.3
    for example I have Report name is repdept.pdf with parameter as deptno
    and I want call this Report from JSP page ?
    thanks
    frank

  • How to call standard report with in zprogram?

    Hi Sap experts,
    How to call standard report with in zprogram.
    For example if country is 'US' then call Zprogram(zprog_US).Inside zprogram call standard report(rhecm_change_proc_status).If country is 'CA' then call zprogram.Inside zprogram call standard report.For same othercountres like 'PR','GB','ES'.Actually HR_ECM_READ_FEATURE_CARGP will having the input as employee id and will return the CAREA(County like 'US','PR'......).Kindly help me what is the procedure?
    Regards,
    Sujan

    >
    sujan T wrote:
    > Thanks for your reply.
    >
    >    What is the logic to call the standard report from zprogram?Inside the zpogram how to call standard report?
    >
    > Regards,
    > Sujan
    no special logic is required
    If u want to use
    RPUAUDOO IN THE ZREPORT.
    Put the submit button where ever required
    ex: In zreport after certain process reacedu want to call then use
    submit rpuaudoo and return.
    Regards
    Sas

  • How to call the DLL writing in Vb6.0 from testsatnd?

    Hi,
    I want to call a dll writting in VB6.0 from teststand. But as i see from the "Step Setting" in teststand, only the C/C++ Dll can be selected in the "adapter" type. I try to use this one as my adapter to call my VB6.0 dll, in result, there is no function can be seen in the "function" tab in teststand.Anyone know how to call the DLL writing in Vb6.0?
    Solved!
    Go to Solution.

    Hi Ivan,
    Just to be sure that your DLL is not wrong
    you have check if all functions are well and present.
    There is  tool called "Dependency Walker"   You can download it at http://dependencywalker.com/ .
    With it you can look "inside" your dll
    If you will see your functions there, you will see them (in my case !!always!!) in TestStand, too.
    Hope this helps 
    Greetings
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

  • Call a dll with an activeX component gives error

    Hello all,
    My program consist of:
    - Main program
    - DLL's
    How it works:
    The main program is the interface for the user, this main program call's several dll's
    The problem:
    The main program runs withought problems, but when it call's a dll, which also call's an activeX component, I get an error.
    I then made a executable from the dll which then works ok, no problem.
    When I click the retry it runs ok, but when I call it again I get the message again.
    The message does allways accur, but still very often
    Conclusion:
    The error message only comes when I call it as a dll, when the dll is standalone executable no problems occur.
    Below you can see how I call the dll:
    Can someone please help me with this problem?
    greetz,
    Bart

    Hello Bas,
    I have included the vi which calls de dll(executedll.vi) en the dll in VI form(plugin.vi & plugin.lvproj).
    As you can see the dll calls the canconfigurator activex component.
    And closes the activex component when done.
    This plugin will be called several times in the test enviroment.
    gr,
    Message Edited by darkxceed on 02-12-2010 04:33 AM
    Message Edited by darkxceed on 02-12-2010 04:33 AM
    Attachments:
    ExecuteDLL.vi ‏12 KB
    plugin.lvproj ‏8 KB
    plugin.vi ‏31 KB

  • How to call a package with ADO?

    I have designed a package which include a procedure. And I have a program coded in ASP.
    How to call this package with ADO. Please give a sample.

    Hi,
    I persume that you are facing this problem when u try to code in VB. If that is the case here comes the code.........
    OraDatabase.Parameters.Add "A_NBR_NEWSID", A_NBR_NEWSID, ORAPARM_INPUT, 2
    OraDatabase.Parameters.Add "A_NBR_TOPICID", A_NBR_TOPICID, ORAPARM_INPUT, 2
    OraDatabase.Parameters.Add "A_NBR_USERID", A_NBR_USERID, ORAPARM_INPUT, 2
    OraDatabase.Parameters.Add "result", 0, ORAPARM_OUTPUT
    OraDatabase.Parameters("result").serverType = 2
    OraDatabase.ExecuteSQL ("declare result Number; Begin :result := PKG_CONTENT_MANAGEMENT.FUN_GET_NEWS_PERM_BY_USERID(:A_NBR_NEWSID, :A_NBR_TOPICID, :A_NBR_USERID); end;")
    OraDatabase.Parameters.Remove "A_NBR_NEWSID"
    OraDatabase.Parameters.Remove "A_NBR_TOPICID"
    OraDatabase.Parameters.Remove "A_NBR_USERID"
    FUN_GET_NEWS_PERM_BY_USERID = OraDatabase.Parameters("result").Value
    OraDatabase.Parameters.Remove "result"
    Hope this clear your doubt..
    Raj

  • How to call a transaction with a variant

    Hi all
    I created a bdc program after updating it should call another transaction with predefined variant that that transaction program is of type module pool.
    can anyone tell me the syntax how to call a transaction with a variant.

    Hi
    goto Tcode SHD0
    enter the Tcode for which Tran Variant has to be created(dialog Tcode)
    enter Trans variant to be created
    press create button
    it will go through all the screens of that Tcode and save
    and modify the fields as per requirement
    we can create Transaction Variants Using SHD0 Transaction.
    Transaction Variants and Screen Variants
    Transaction variants can simplify transaction runs as they allow you to:
    Preassign values to fields
    Hide and change the 'ready for input' status of fields
    Hide and change table control column attributes
    Hide menu functions
    Hide entire screens
    In particular, hiding fields in connection with screen compression, and hiding screens, can result in greater clarity and simplicity.
    Transaction variants are made up of a sequence of screen variants. The field values and field attributes for the individual screens found in transaction variants are stored in screen variants. Each of these variants is assigned to a specific transaction, can, however, also contain values for screens in other transactions if this is required by transaction flow. The transaction that the variant is assigned to serves as initial transaction when the variant is called.
    There are both client-specific and cross-client transaction variants. All screen variants are cross-client, but may be assigned to a client-specific transaction variant.
    A namespace exists for cross-client transaction variants and screen variants and both are automatically attached to the Transport Organizer. Client-specific transaction variants must be transported manually.
    In principle, transaction and screen variants can be created for all dialog and reporting transactions. There are, however, certain Restrictions that apply to certain transactions, depending on their internal structure.
    No transaction variants are possible with transactions already containing preset parameters (parameter transactions and variant transactions).
    Regards
    Anji

  • Call OAF page with post parameters

    Hi,
    From a custom OAF payment screen, on button click, I'm opening a third party website in the same window.
    Once payment is done, third party will send me conf num back as the background process (user is still in third party website).
    For this post back purpose, I have created a simple OAF page and given the OAF url to third party.
    https://xxx-dev:85/OA_HTML/OA.jsp?page=/xxx/oracle/apps/xx/webui/PostbackPG&confNum=
    However, third party refused to use this url as it is a html get. They send return values (conf num) only by html post as security measure.
    Is it possible to use OAF page to get post requests? If yes, please let me know how to call OAF page with a post and how to get values in PR of CO.
    Thanks
    Prabhu

    Any ideas please!

  • How to call a form with dabble clicking on a record with one time where

    Hi All,
    How to call a form with dabble clicking on a record with one time where clause. I mean when i dabble click on the current record i want to call another form with details of the
    record with onetime where clause. Can anyone help me in this regard.
    Now i am calling a form with parameter with onetime where but this should avoid.
    Thanks in advance
    Arif

    Hello,
    I mistakenly mark it as solved. There is a problem remain. when i placed the code below it do not execute with the where condition. I mean the condition to execute is not work.
    All records executes. Please correct my code--
    Here the WHEN-BUTTON-PRESSED-trigger on the Edit-Button:
    :GLOBAL.MODE:='EDIT';
    :GLOBAL.REQ_ID:=:PROBLEM_REQUEST.REQ_ID;
    CALL_FORM('REQUEST_ID_PARAM',NO_HIDE,DO_REPLACE,NO_QUERY_ONLY);And also, WHEN-NEW-FORM-INSTANCE-trigger of REQUEST_ID_PARAM:
    DEFAULT_VALUE(NULL, 'GLOBAL.MODE');
    DEFAULT_VALUE(NULL, 'GLOBAL.REQ_ID');
    IF :GLOBAL.MODE='EDIT' THEN
    GO_BLOCK('PROBLEM_REQUEST');
    EXECUTE_QUERY;
    SET_BLOCK_PROPERTY('PROBLEM_REQUEST', INSERT_ALLOWED, PROPERTY_FALSE);
    END IF;Arif

  • How to call html page with in the flash

    I am new to action script, can some one guide me how to call html page with in the flash. lets say i have movie clip having instance name as "news_feed", I need to disply the html page in this news_feed. kindly help me, thanks alot

    some one tell me, weather it is possible or not ??

  • How to call a dll which has one VISA name as input

    Hi there,
    The Labview application builder can generate a dll file from a vi which is a simple serial comunication program using VISA name as one control.
    The problem is how to call the dll file in Labview which has a VISA name as INPUT?
    Thanks!
    George

    I would suggest modifying the LabVIEW VI so that the input is a string control instead of a visa control. The LabVIEW application will work the same and there is no need for any casting. All visa VIs can take a string as an input. Then when you recreate the dll make the input a string. Then you can easily pass a string to the dll from any API.
    -Josh

  • How to call java function with parameter from javascript in adf mobile?

    how to call java function with parameter from javascript in adf mobile?

    The ADF Mobile Container Utilities API may be used from JavaScript or Java.
    Application Container APIs - 11g Release 2 (11.1.2.4.0)

  • How to call a function with parameters in ScriptStart function

    i am trying to call ScriptStart function from SUD dialog. This is how iam calling Call ScriptStart(path & "test.vbs","abc") abc is function which is written test.vbs. It is working. But when i want to pass some parameters to the abc function of test.vbs. It is not working why. can anybody suggest where i went wrong. I am calling the same function as Call ScriptStart(path & "test.vbs","abc(" & text1.Text & ")"). It is not working why ? Is the ScriptStart function only point to functions. it does not take any parameters or waht ?

    Hi abc421,
    Another option in addition to UserCommands would be to use ScriptInclude(path). If you execute a ScriptInclude(path) command at the beginning of your VBScript, then all the functions and Subs in the VBscript located at "path" are now available to you-- including passing parameters and receiving return values from functions. If you are calling a VBscript that uses only VBScript variables, then this is the preferred method.
    If instead you are calling a VBScript that uses global DIAdem variables declared in a VAS file (their variable names all end with the "_" character), then those parameters are already available at the subroutine called with ScriptStart(path, routine).
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

Maybe you are looking for

  • Two variables in the name of a table in the FROM clause.

    Hello, I ve got a problem making this work: SELECT * FROM tablename_YY_MM (This is part of the script I need to use YY and MM in various tables) I need to find a way so the script will ask me every time about the YY and MM For example the current tab

  • Apple ID not working in itunes to purchase or update apps

    My Apple ID works in terms of logging into it to manage my account but not to update apps or purchase music in itunes.  Any ideas???

  • Contacting skype

    Is there anyway I can contact skype by phone or email?  I need them to contact me otherwise.  I signed in for Premium, got an email saying that my billing had gone wrong, I went through the payment again, and suddently I received emails with the conf

  • Which R3 table contains the field WRSHB (Amount in FC)?

    In InfoSource 0FI_AP_4, the InfoObject 0DEB_CRE_DC is mapped with R3 field WRSHB (Amount in FC).  We try to find which R3 table contains this field, but fail to find it.   We've tried BKPF, BSEG, and PAYR, not successful.  We tried RSO2 and find that

  • DLU and local "Administrator" account

    I have another network admin that has given me some information of the subject heading that I don't quite understand... They are using ZEN 3.2 with DLU on a Citrix server. This way, when a student logs in via Citrix and gets logged in, ZEN policies r