Use of Call Function Node vi, with char type pointer

I want to be able to use a certain function from C++ DLL, and I followed the TOOLS>>IMPORT>>SHARED LIBRARY(.dll) wizard.  Where I located my header file and the dll file.
However i am getting an error (1097).  This is the function with the paramaters:
void Function_Name(unsigned char *L, unsigned char *H, unsigned in Len, unsigned char Adr);
I don't think, that I configured my Call Function Node, correctly.  How should i set the paramaters settings of the first 2?  I have tried Numeric, unsigned (and signed) Int (32, 16), pass pointer value.  to accomodate the first two varaibles. 
Please someone help, what should I do to accomodate the unsigned char pointers, so that I can used the function in labVIEW?

Hi Safe,
The error you're encountering has the following description (I'm sure you've already looked this up-posting here for clarity for other readers):
LabVIEW:  An exception occurred within the external code called by a Call Library Function Node. This might have corrupted LabVIEW's memory. Save any work to a new location and restart LabVIEW.
Typically, this happens for one of just a few reasons:
Memory was overwritten (e.g. you passed a buffer of N bytes, but N+X bytes were modified, and an exception was thrown.
A bad pointer was passed. (This is probably not the case.)
Arguments were not passed to the function properly. (Calling conventions)
Function wasn't called from the proper thread.
Some other reason (only can be determined by inspecting in a debugger).
I've attached some pictures of how I'd configure the dialog, but there are two critical things you have to know: calling conventions and thread safety. Those are things defined by the DLL. In Windows, C vs. 'Standard' (a.k.a. Pascal) calling conventions MUST be correct, as they affect how arguments are passed on the stack. If this is wrong, then, for example, where arg1 is expected to be an unsigned char *, you may actually only pass an unsigned char. Dereferencing that number as a pointer will at best crash, at worst appear to be a valid address and silently corrupt memory.
I suggest double-checking the calling conventions. 'stdcall' is still quite common, but not the default setting in the Call Library Function dialog.
Best regards,
intvstefve
intvsteve
LabVIEW R&D
Attachments:
dllconfig11.JPG ‏40 KB
dllconfig21.JPG ‏41 KB

Similar Messages

  • Using the Library function node?

    I am using a Library Function Node to call a DLL function.  It works perfectly on one computer and Labview 8 but on another computer with Labview 7.1 it does not work.
    It crashes everytime it hits this node call.
    The problem is that, even after I define the node call to a specific function in a DLL, when the VI is running it defaults to an old DLL and function that is no longer in the syetem.  Why does it default to this old call and how can I break the default so it calls the proper function that is define in the node setup defintion.

    Hi irfocus,
    I am not sure why the the Call Library Function Node is defaulting to what you had created before, but one suggestion I have that may fix this problem is deleting the one that is already in place and creating a new one from scratch that references the DLL you actually want. This should keep the new configuration.
    Eli S.
    National Instruments
    Applications Engineer

  • Measuring Point during IK01 not allowing characteristics with CHAR type

    Hi Experts,
    Measuring Point during IK01 not allowing characteristics with CHAR type Only allows NUM,
    could you anyone suggest on this.
    Regards
    Nitin

    May i know the reason of such implementation?
    You can use group code and valuation code for assigning predefined values to measuring documents.
    Moreover text field can be used for assigning short text to it.

  • Latest operating system that I can use on a Power Mac G5 with CPU type Power PC 970 (2.2)

    What is the latest operating system that I can use on a Power Mac G5 with CPU type Power PC 970 (2.2).  This is not an intel chip.  Thank you.

    10.5.8 without Classic, or 10.4.11 with Classic.

  • Issue using DLL / library function node

    Hi All
    I am using labview 8.2 / 8.0
    I am writing a wrapper DLL to convert compex data types of a DLL to simpler ones for labview intefacing.
    I have read the forums on all related items and could not find a solution.
    I have cut my code back to basics and I am still getting error 1097 with 8.2 and a crash with 8.0
    The error occurs as follows:
    1) Start labview, open the vi.
    2) Run vi - everything works (so far the wrapper DLL I am writing call just does a simple open handle and close handle on a driver dll).
    The handle is passed back to the vi, and everything is good.
    I can re-run the application numerous times and it always works
    3) IF I close the vi, but not labview and re-open I get the following:
    Labview 8.0 crashes on closing the vi
    Labview 8.2 does not crash, but I get error 1097 if I re-open and run the vi.
    So it seems like it's almost working but the issue comes on the release of the dll from one invocation of the vi to another.
    I don't know what the error is, but I've tried everything I can think of! Any suggestions would be appreciated!
    Note: I am not passing any arrays at the moment, but I am passing one unsigned 32 bit int pointer. I declare a constant for this in the call, so there is something for the pointer to use, and it seems to return the data ok.

    Hi Kaem,
    Thanks for your reply.
    I have written C++ standalone programs that link to the DLL and these work fine. I have even called my wrapper DLL from a C++ program and that too works fine (just to check if the wrapper would cause issues there). I have a hunch that it is actually the DLL that my wrapper is 'wrapping' that is causing the issue, but I guess I don't know for sure.
    The difference (IMHO) is that these C++ programs all run through once and then exit, so everything works fine. However if they load the DLL and unload it and try to load it again, maybe there would be an issue. I think labview is doing this.
    The reason I think labview does something funny with the DLL after you exit a VI (but not labview) is because labview crashes in 8.0 when the VI is closed (8.2 is ok, but the next DLL invocation fails when the VI is reopened), so something must be happening at this point - and I think it's an ungraceful unload of the DLL.
    Also, I've noticed that I cannot overwrite my wrapper DLL with a new version until I exit a VI - so labview is definitely doing something on VI close - it's releasing some lock on the DLL.
    I don't use any consts in my code  - sorry if I indicated that. What I have is a U32 constant in labview, and I connect that to the input of  the library function node, and pass it as a pointer. And the DLL writes into this then. Are you saying that a labview constant cannot be used as an input to a function and passed as a pointer ? What should I use instead, a control?
    Note: while writing - I just tried that - same error -  so I don't think this is it.
    I'm willing to take any and all suggestions!!
    Cheers
    John

  • Whats the use of PARTNER FUNCTIONS node in NACE transaction

    hello
    i would like to know when a output type is selected as medium EDI or ALE what needs to be entered in the PARTNER FUNCTIONS node and what is the main purpose of this node. Pls help
    ~Suresh

    Hi Suresh,
    Partner Functions Uses
    You use partner functions in transactions, in all areas of partner processing and in some areas of business partner master data.
    ·        For example, you have a real estate business and define the function tenant to refer to your customers.
    ·        Tenant is then displayed in the header and Partner tab page in transactions, and on the Buying Center tab page, when relevant.
    ·        It appears in the Customizing settings for access sequences, partner determination procedures and partner teams
    ·        It appears in business partner master data when you assign partners to partner functions as part of maintaining sales area-specific data, and when you enter excluded partner functions.
    Nace Transaction
    The Tcode NACE is used to link the Standard SAP forms (SCRIPTFORM or SMARTFORM) or the customized form or the new form to its respective print programs. Also the output types, Form entry are linked with their forms and print programs. In short term, i can tell u that configuration or customization of forms to print programs, assigning output types, form entry to the forms are done using this Tcode.
    NACE is used to create output type while creating the output type you will mention forms, and driver program.
    that will be maintained in the table TNAPR.if you create the output type using NACE then it will be automatically visible in table NAST and TNAPR.
    so check in NAST, TNAPR table
    Reward if useful.
    Thankyou,
    Regards.

  • Call function node exception AI SingleScan

     Hi all,
     I am running a Labview 6.1 application on Windows 2000.
     When I run the circuit to measure waveform curve on 1 input it works fine.
     But I had to introduce a measurement of 2 more inputs and now get the following exception (this happens sporadically - mainly when you have important measurements):
     "An exception occured within the external code called by a call library node......VI was stopped at Call library function node 0x239C of subVI "AI SingleScan (single-point waveform).vi".
     The call function library calls this routine out of lvdaq.dll with calling convention 'C' (otherwise the program crashed instantly).
     I hope that someone can help me solve it.
     Thnx xris.

    Hi Xris,
    I would like you to check if the information given in the following thread will solve you problem.
    http://forums.ni.com/ni/board/message?board.id=170&message.id=88345&requireLogin=False
    If the problem keeps existing please post again in this threas.
    Thanks in advance.
    Bets regards,
    Carsten Sprung
    Application Engineer
    National Instruments Germany

  • What is the use of CALL FUNCTION MODULE - AT BACKGROUND TASK?

    Hi experts,
    I found Call functional module in background task will make the FM run at the next commit work as some people said. So I have some questions:
    1 if we use COMMIT WORK commend, the pending FM will be called? If there are several FMs called at background task, what is the sequence of them? How many conditions will trigger the running of these FMs?
    2 Where can I find the log of this pending FMs? In SAP library, it says there are 2 tables. But I checked these tables and can only find the FM name and user of it. And I can not understand content of these tables. It seems one is for the main information of FM, and the other is for the data of the FM, maybe the parameters.
    3 If I call a FM in this way, Can I canncel it before the next commit work in some way?
    Finally, thanks for reading and help.

    HI,
    When the COMMIT WORK statement is executed, the function modules registered for the current SAP-LUW are started in the order in which they were registered. ROLLBACK WORK deletes all previous registrations for the current SAP-LUW.
    If the specified destination is not available when COMMIT WORK is executed, an executable program called RSARFCSE is started in background processing. By default, this tries to start the function modules registered for a SAP-LUW in their destination every 15 minutes and up to 30 times. These parameters can be changed in the transaction SM59. If the destination does not become available within the defined time, it is recorded in the database table ARFCSDATA as the entry "CPICERR". The entry in the database table ARFCSSTATE is deleted after a standard period of eight days

  • Use of CALL FUNCTION - STARTING NEW TASK parameter_list.

    SELECT strt_code
                 city_code
                 commu_code
                 regiogroup
          INTO TABLE gt_adrstreet1
          FROM adrstreet
          FOR ALL ENTRIES IN gt_street_district
          WHERE strt_code EQ gt_street_district-strt_code.
    To optimize the performance of teh above query I am planning to use call function CALL FUNCTION - STARTING NEW TASK .....
    by spliting the above internal table gt_street_district into two internal tables and use the value of each internal table into two different queries and these queries will be put in call function - start new task ....so that these queries are run in different workprocess and thus improve the performance of the program.
    Can you please let me know if this would be a good option and also how to implement the same.
    Thanks.....

    >To optimize the performance of teh above query I am planning to use call function CALL FUNCTION - STARTING NEW TASK .....
    nonsense! You should not try parallel processing for a non-optimized SELECT statement.
    Better add the first key field of the WHERE condition as said above and check
    + whether the driver table is empfty
    + and whether there are duplicated entries
    ... And it is also a good idea to really use the SINGLE RECORD BUFFER, therefore you must write
    field-symbol:  <fs>  type ...
    LOOP AT gt_street_district ASSIGNING <fs>
       SELECT *
                    INTO TABLE gt_adrstreet1
                    FROM adrstreet
                    WHERE counrty =
                     AND       strt_code = <fs>-strt_code.
    ENDLOOP.
    Then it will be extremely fast!

  • Direct approach for - Message class used in Call Function - possible?

    Hi All
    This is I guess a very simple question, but I could not find the solution.
    If i use the function: POPUP_TO_CONFIRM, I can hand over to the export some text symbols directly from the text elements.
    Example:
        CALL FUNCTION 'POPUP_TO_CONFIRM'
          EXPORTING
            titlebar              = text-011
            text_question         = text-030
            text_button_1         = text-024
            icon_button_1         = 'icon_checked '
            text_button_2         = text-026
            icon_button_2         = 'icon_incomplete'
            default_button        = '2'
            display_cancel_button = ''
            start_column          = 25
            start_row             = 6
          IMPORTING
            answer                = answer.
    But I'm using a message class in this progamm.
    <b>So my question is, how can I use directly a message from the message class within the function?</b>
    I'm not asking for a 2-step approach (copy into text1 and set text1 to function). I would like to know how to use the text from the class directly into the function.
    Thanks
    Petra

    Hi
    May be this way.
       data : v_text1(72) type c,
              v_text2(72) type c,
           v_text3(72) type c,
              v_text4(72) type c.
        message i175(YVV) into v_text1.
        message i176(YVV) into v_text2.
        message i177(YVV) into v_text3.
        message i178(YVV) into v_text4.
        CALL FUNCTION 'POPUP_TO_CONFIRM'
          EXPORTING
            titlebar              = v_text1
            text_question         = v_text2
            text_button_1         = v_text3
            icon_button_1         = 'icon_checked '
            text_button_2         = v_text4
            icon_button_2         = 'icon_incomplete'
            default_button        = '2'
            display_cancel_button = ''
            start_column          = 25
            start_row             = 6
          IMPORTING
            answer                = answer.
    aRs

  • Forms: Oracle AS 10g R2 - parameter with "char" type only limit to 4k

    Hi,
    i have one forms with parameter ":parameter.whole_rights" (Datatype=Char, Length=32767) over design time.
    when i compiled and execute it in old server (Oracle AS 10g R1), it work perfectly but when compiled and execute it over the 10gr2, it always show ora-06502: pl/sql: numeric or value error.
    after some troubleshooting, i found out that the maximum length for "char" type parameter is only 4k. if i assign any string larger than 4k characters, it will show the error as per mentioned but it work on old server...
    anyone have this problem and how to resolve it???
    additional information:
    server is on unix environment.
    Edited by: cy82 on Jun 15, 2010 3:35 AM

    Hi there,
    the application does not use up all the 32k characters, the maximum length it use currently is around 6k.
    the parameter is used to store all the available access right (forms name, button/object name, read, write etc which is very customized & application specific design). every related access right in that parameter will be passed seperately into related form when the form is called to control the view, transaction nature etc.
    as the design involve other system who passed the data in, i not really plan to change it as it involve interface between 2 systems instead try other possible ways (simple and less impact).
    i think i should not say it use up all 32k, i just curious why the application declare the length as 32k over the forms design time but the actual length was only limited to 4k during forms execution time on Oracle AS r2.
    thanks for suggesting me to try the copy build in and i will try it & post the result tomorrow. i think it should work because i saw your quote for the documentation here:
    In Oracle Forms 10g, all parameters of datatype CHAR are limited to 4000 bytes when set or referenced using PL/SQL bind variable notation; for other usages no limit is imposed.
    as the "copy" build in does not use the parameter as PL/SQL bind variable, quite large posibilities it works...will try and update the result tomorrow....
    another question: where did you get the documentation for oracle forms?? i'm searching around and still cant find the quote that you copy from documentation. hopefully you can give me the link for my future reference.
    Edited by: cy82 on Jun 16, 2010 9:58 PM

  • [perl] How call function/procedure that returns SYS_REFCURSOR type?

    I've got some simple procedure which returns record(s):
    CREATE OR REPLACE PROCEDURE "GET_SYS_DATE"
    RESULTSET IN OUT SYS_REFCURSOR
    IS
    BEGIN
         OPEN RESULTSET FOR
              SELECT SYSDATE FROM DUAL;
    END;
    In perl i invoke it with somthing like this:
    my $ret;
    my $s= "BEGIN GET_SYS_DATE(:1); END;";
    my $sth = $dbh->prepare($s);
    $sth->bind_param_inout(1, \$ret, 0 { TYPE => XXX}); # tried to use many DBD::SQL_* types (SQL_ROW, SQL_REF, etc.)
    $sth->execute(); #... but without luck
    I always get:
    DBD::ODBC::st execute failed: [Oracle][ODBC][Ora]ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'GET_SYS_DATE'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    Of course if i use other datatype in SP (e.g. VARCHAR2) and bind it as SQL_VARCHAR it works well... Moreover, if i use DBD::Oracle and bind it as ORA_RSET type it also works.
    Is it possible that ODBC doesn't know SYS_REFCURSOR type? Then, is there any way to call SP and retrieve cursor from perl without using DBD::Oracle?
    Or, if it is possible, then how to retrieve that cursor and data stored within it? Any help?

    Hi,
    I have not one eensy teensy bit of knowledge about PERL, other than how to spell it.
    I do however, know about ref cursors, and ODBC, so maybe this will help.
    ODBC has nothing for REF CURSOR built in. ODBC is made to the lowest common denoninator of databases, and a refcur is an Oracle thing. So, what that means is that you can't BIND anythign to the ref cursor, as there is no appropriate ODBC type to bind.
    Does that mean you can't call a refcur via ODBC? No, it doesnt.
    What happens is that Oracle's ODBC driver kinda "magically" goes out behind the scenes and describes the procedure or pacakge to determine if any of the parameters are ref cursors, and if so automatically sets up the bind for them.
    Here's a complete working example using VB and ADO rather than PERL, but maybe you can port it over and get it working. Note that the proc takes two params, but we only bind one (for the IN number)
    Hope it helps,
    Greg
    'create or replace package testrefcur as
    '  type mycur is ref cursor;
    ' procedure getemps(dno in number, ecur out mycur);
    ' end;
    'create or replace package body testrefcur as
    'procedure getemps(dno in number, ecur out mycur) is
    '  begin
    '     open ecur for select * from emp where deptno = dno;
    '  end;
    'end;
    Private Sub Command1_Click()
    Dim con As New ADODB.Connection
    Dim cmd As New ADODB.Command
    Dim rst As New ADODB.Recordset
    strcnn = "dsn=orcl;uid=scott;pwd=tiger"
    con.Open strcnn
    cmd.CommandText = "{call testrefcur.getemps(?)}"
    Set cmd.ActiveConnection = con
    Set param1 = cmd.CreateParameter("param1", adNumeric, adParamInput, 4)
    param1.Value = 10
    param1.Precision = 4
    cmd.Parameters.Append param1
    Set rst = cmd.Execute  
    While Not rst.EOF
    strrslt = strrslt & rst.Fields("ename").Value & " "
    rst.MoveNext
    Wend
    MsgBox strrslt
    End Sub

  • I have a application build in labview 8.5 for Windows XP using NI Visa functions to interact with hardware , how to make is work in Windows 7 32 bit and Win 7 64 bit

    I have a application build in Labview 8.5 which wroks fine with Windows XP , this program uses basic read /write functions of NI Visa to communicate with Hardware . This application doesnt work with Windows 7 32 bit/64 and Vista . What changes i need to do to make it work for the said operating system

    srinivas wrote:
    Sorry for confusion ,
    My question is what changes i need to do in code or while making the installer to make the existing program work with other Windows operating system
    You need to make sure the machine have the corresponding NI-VISA installed. Check in the NI software pages for the right version.
    Also make sure that the com port's can be selected when you first start the application. Eg. if you refer to VISA "COM1" on the XP machine It might be "COM2" on the Win7 machine.
    Br,
    /Roger

  • Using conference call dial in numbers with iPhone

    On my old Blackberry I used to be able to call a conference call dial in number and it was set up so that it would dial both the 1-800 number and then the participant code for the conference call. Anyone know if it's possible to do the same with the iPhone? Of course, with my Blackberry I was dialing in through clicking on the number in the actual meeting invite whereas with the iPhone I am dialing into a number in my contacts list since the iPhone is not yet compatible with Lotus Notes. Speaking of which, I've heard rumors before that the iPhone will one day be compatible with Lotus Notes. Anyone know when that might be? I've ditched the Blackberry but not having my email/calendar/contacts synced with my work system is a big pain.
    Back to the conference call question, I tried seeing if I could add a pause after dialing the 1-800 number so that it would dial the meeting password after connecting but that didn't work, even when I added like 10 pauses.

    CUCM does not have this capability, if you forcefully need users to enter a pwd you'd need to look into MP or do some UCCX/UCCE scripting for this.
    You can use Unity/CUC as a middle man so you can use a supervised transfer and then Unity will let you choose if you want to let someone in or send them to VM, but it won't ask for any passcode.
    HTH
    java
    if this helps, please rate
    www.cisco.com/go/pdihelpdesk

  • Call function HTTP_POST fails with error...

    <b>NiHostToAddr proxy error: NIEHOST_UNKNOWN</b>
    I could not figure out what's going on. Could not find any informatin about this error.
    Help please.
    Thanks,
    Andrei

    which site you are calling, is it on intranet or internet?
    if its internet do you use proxy if so did you pass the proxy details?
    for sample programs you can check out the programs starting with
    RSHTTP*
    Regards
    Raja

Maybe you are looking for

  • DUMP: replace all occurrences of space in string1 with string2.

    Why does this statement results in a dump: replace all occurrences of space in string1 with string2. same with replace all occurrences of ' ' in string1 with string2. string2 is a string without spaces! Is there any drawback on using this statements

  • RE: CGI Error

    Hi All, Can any one tell me What is these CGI Errors means 1. cgi_init reports: HTTP4047: could not initialize CGI subsystem (Cgistub path ../private/Cgistub), err Cgistub is marked as set user ID on execute and its directory is accessible by other u

  • Crystal Reports 2013 freezes after 22 seconds of running report

    I'm running a report that includes 5 linked subreports.  I have parameters for start and end dates for the the data I'm running, and if the report takes longer than 22 seconds to run, the program locks up and I have to manually kill the crw.32 proces

  • Ibooks 3 update doesn't work on iOS 5

    Hello, the Ibooks 3 update on my 1st gen Ipad doesn't work ! It always crashes. I'm on ios 5. Please help !!! Frédéric

  • Opening old iworks documents???

    I've just purchased new Apple w/Leopard OS. I cannot open Appleworks documents I created w/my old Apple, running OS 9.2 and Apple Works 5.0.4. I have installed iworks 08 on my new computer but still cannot open. Does anyone know what I need to do to