Nican.dll call python questions

Hi all

I have a feeling that this issue will be left without an answer, but I'll ask anyway.

For a project, I need to use Python2.7 to receive frames from a bus.  What I have to do is monitor CAN all traffic on the bus, I have to send frames.  I searched (and searched and searched) for some sort of solution to this, but have found none.  Here's the code I have so far:

Test #CAN using Python

types import *.
import table *.

#Load DLL
CANdll = cdll. LoadLibrary ("NICAN.dll")

canName = c_char_p ("CAN0")
canNumAttr = c_ulong (8)

# Define constants
NC_TRUE = c_ulong (1)
NC_TRUE = c_ulong (0)
NC_CAN_MASK_STD_DONTCARE = c_ulong (0x00000000)
NC_CAN_MASK_XTD_DONTCARE = c_ulong (0x00000000)

# The values taken from nican.h
#NC_ATTR_BAUD_RATE = c_ulong (0 x 80000007)
#NC_ATTR_START_ON_OPEN = c_ulong (0 x 80000006)
#NC_ATTR_READ_Q_LEN = c_ulong (0 x 80000013)
#NC_ATTR_WRITE_Q_LEN = c_ulong (0 x 80000014)
#NC_ATTR_CAN_COMP_STD = c_ulong (0 x 80010001)
#NC_ATTR_CAN_MASK_STD = c_ulong (0 x 80010002)
#NC_ATTR_CAN_COMP_XTD = c_ulong (0 x 80010003)
#NC_ATTR_CAN_MASK_XTD = c_ulong (0 x 80010004)

# instantiate the table a
canAttrIdList = (c_ulong * 8))

# Fill the values in the table
canAttrIdList [0] = c_ulong (0 x 80000007)
canAttrIdList [1] = c_ulong (0 x 80000006)
canAttrIdList [2] = c_ulong (0 x 80000013)
canAttrIdList [3] = c_ulong (0 x 80000014)
canAttrIdList [4] = c_ulong (0 x 80010001)
canAttrIdList [5] = c_ulong (0 x 80010002)
canAttrIdList [6] = c_ulong (0 x 80010003)
canAttrIdList [7] = c_ulong (0 x 80010004)

#NC_ATTR_BAUD_RATE = 500000
#NC_ATTR_START_ON_OPEN = NC_TRUE
#NC_ATTR_READ_Q_LEN = 100
#NC_ATTR_WRITE_Q_LEN = 0
#NC_ATTR_CAN_COMP_STD = 0
#NC_ATTR_CAN_MASK_STD = NC_CAN_MASK_STD_DONTCARE
#NC_ATTR_CAN_COMP_XTD = 0
#NC_ATTR_CAN_MASK_XTD = NC_CAN_MASK_XTD_DONTCARE

# instantiate table a
canAttrValueList = (c_ulong * 8)

# Fill the values in the table
canAttrValueList [0] = 500000
canAttrValueList [1] = NC_TRUE
canAttrValueList [2] = 100
canAttrValueList [3] = 0
canAttrValueList [4] = 0
canAttrValueList [5] = NC_CAN_MASK_STD_DONTCARE
canAttrValueList [6] = 0
canAttrValueList [7] = NC_CAN_MASK_XTD_DONTCARE

returnValue = CANdll.ncConfig (canNumAttr, canAttrIdList, canName, canAttrValueList)

CODE ##END

Which causes this error:

Traceback (most recent call changed):
File "C:\Users\Chadwick\Dropbox\Senior Project\CAN\NI-CAN\ITB CAN\test.py", line 63, in
returnValue = CANdll.ncConfig (canNumAttr, canAttrIdList, canName, canAttrValueList)
ValueError: Procedure called with not enough arguments (missing 16 bytes) or bad calling convention

It seems that I am not calling the function correctly.

Yes, I understand that nor is not supported by the Python.  However, any help with this is appreciated.

Thank you

He is the labour code.  I question the material for how many images of waiting there, then read them individually as I'm having no luck using ncReadMult.  If someone needs to do this, here's a starting point.

/thread

types import *.
import table *.
import sys
import of struct
time of import

#Load DLL
CANdll = windll. LoadLibrary ("NICAN.dll")

NC_ST_READ_AVAIL = c_ulong (0x00000001)
NC_ATTR_READ_PENDING = c_ulong (0 x 80000011)

# HEADER INFORMATION RELEVANT C
# typedef NCTYPE_INT32 NCTYPE_STATUS;
# typedef NCTYPE_UINT32 NCTYPE_OBJH;

##typedef struct {}
# NCTYPE_ABS_TIME Timestamp;
# NCTYPE_CAN_ARBID ArbitrationId;
# FrameType NCTYPE_UINT8;
# NCTYPE_UINT8 DataLength;
# NCTYPE_UINT8 data [8];
#} NCTYPE_CAN_STRUCT;

class CAN_STRUCT (Structure):
_fields_ = [("Timestamp", c_ulonglong),
("ArbitrationId", c_ulong);
("Frames", c_ubyte);
('DataLength', c_ubyte);
(«Données», c_ubyte * 8)]

CAN_receive_buffer = (CAN_STRUCT * 1000))

Status = c_long (0)
CAN_HANDLE = c_ulong (0)
#CAN_data_size = c_ulong (sys.getsizeof (CAN_receive_buffer))
CAN_data_size = c_ulong (17600)

CAN_received_size = c_ulong (1)
CAN_NAME = c_char_p ("CAN0")
canNumAttr = c_ulong (8)

# Define constants
NC_TRUE = c_ulong (1)
NC_FALSE = c_ulong (0)
NC_CAN_MASK_STD_DONTCARE = c_ulong (0x00000000)
NC_CAN_MASK_XTD_DONTCARE = c_ulong (0x00000000)

# The values taken from nican.h
#NC_ATTR_BAUD_RATE = c_ulong (0 x 80000007)
#NC_ATTR_START_ON_OPEN = c_ulong (0 x 80000006)
#NC_ATTR_READ_Q_LEN = c_ulong (0 x 80000013)
#NC_ATTR_WRITE_Q_LEN = c_ulong (0 x 80000014)
#NC_ATTR_CAN_COMP_STD = c_ulong (0 x 80010001)
#NC_ATTR_CAN_MASK_STD = c_ulong (0 x 80010002)
#NC_ATTR_CAN_COMP_XTD = c_ulong (0 x 80010003)
#NC_ATTR_CAN_MASK_XTD = c_ulong (0 x 80010004)
#NC_ATTR_LISTEN_ONLY 0 X 80010010

# instantiate the table a
canAttrIdList = (c_ulong * 9))

# Fill the values in the table
canAttrIdList [0] = c_ulong (0 x 80000007)
canAttrIdList [1] = c_ulong (0 x 80000006)
canAttrIdList [2] = c_ulong (0 x 80000013)
canAttrIdList [3] = c_ulong (0 x 80000014)
canAttrIdList [4] = c_ulong (0 x 80010001)
canAttrIdList [5] = c_ulong (0 x 80010002)
canAttrIdList [6] = c_ulong (0 x 80010003)
canAttrIdList [7] = c_ulong (0 x 80010004)
canAttrIdList [8] = c_ulong (0 x 80010010)

#NC_ATTR_BAUD_RATE = 500000
#NC_ATTR_LISTEN_ONLY = NC_TRUE
#NC_ATTR_READ_Q_LEN = 100
#NC_ATTR_WRITE_Q_LEN = 0
#NC_ATTR_CAN_COMP_STD = 0
#NC_ATTR_CAN_MASK_STD = NC_CAN_MASK_STD_DONTCARE
#NC_ATTR_CAN_COMP_XTD = 0
#NC_ATTR_CAN_MASK_XTD = NC_CAN_MASK_XTD_DONTCARE

# instantiate table a
canAttrValueList = (c_ulong * 9)

# Fill the values in the table
canAttrValueList [0] = 500000
canAttrValueList [1] = NC_TRUE
canAttrValueList [2] = 100
canAttrValueList [3] = 0
canAttrValueList [4] = 0
canAttrValueList [5] = NC_CAN_MASK_STD_DONTCARE
canAttrValueList [6] = 0
canAttrValueList [7] = NC_CAN_MASK_XTD_DONTCARE
canAttrValueList [8] = NC_FALSE

# Configure the equipment CAN
Status = CANdll.ncConfig (canNumAttr, canAttrIdList, CAN_NAME, canAttrValueList)
If Status! = 0 :
"Printing on"ncConfig"error
Status of printing

Status = CANdll.ncOpenObject (CAN_NAME, byref (CAN_HANDLE))
If Status! = 0 :
"Printing on"ncOpenObject"error
Status of printing
impression CAN_HANDLE.value

Time.Sleep (1)

Try:
Status = CANdll.ncAction (CAN_HANDLE, c_ulong(0x80000001), 0)
If Status! = 0 :
"Printing on"ncAction:start"error
Status of printing
impression CAN_HANDLE.value

I have = 0
##string = "" data: "".
String = «»

pending_CAN_frames = c_ulong (0)
while I<>
Status = CANdll.ncGetAttribute (CAN_HANDLE, NC_ATTR_READ_PENDING,
32, byref (pending_CAN_frames))
Print "waiting for frames: %d" % pending_CAN_frames.value
If Status! = 0 :
"Printing on"ncGetAttribute"error
Status of printing
for n in range (0, pending_CAN_frames.value):
Status = CANdll.ncRead (CAN_HANDLE, CAN_data_size,
ByRef (CAN_receive_buffer [n]))
for n in range(0,pending_CAN_frames.value):
for j in range (0, CAN_receive_buffer [n]. DataLength):
String = string + '%x' % (CAN_receive_buffer [n]. Data [j])
print '% X\t%d\t%s' % (CAN_receive_buffer [n]. ArbitrationId, CAN_receive_buffer [n]. DataLength, string)
String = ' ' #reset chain
         
I += 1

# ALWAYS CALL LAST
Finally:
Status = CANdll.ncCloseObject (CAN_HANDLE)
If Status! = 0 :
"Printing on"ncCloseObject"error
Status of printing

/thread

I hope this helps someone in the future.

Tags: NI Products

Similar Questions

  • The DLL call fails when DLL uses a wide range

    I call a C++ dll in LabVIEW 32-bit on Windows 7. I kept getting error 1097 and finally understood it is because the dll uses two large paintings of 5 MB each. The tables are initialized in the constructor of an object, malloc is not used, or whatever it is. If I do the smaller berries, then everything works fine.

    The problem is not difficult to work around, now that I know what is the cause, but can someone tell me why a dll using a lot of memory would be a problem? I feel that 10 MB is really a lot of memory to use on modern computers.

    OK, you can test the appeal of the DLL in a Visual Studio test harness?

    In addition, in case you haven't seen another 'DLL error 1097' son type, here are a few. The cause of 1097 in your case can be illuminated by a multitude of courses of troubleshooting:

    Call dll error 1097

    Error code coming 1097 in DLL call

    error 1097 after the call dll function that allocates memory inside

    1097 error in the transition from table from C++ DLL for LabView (seems very relevant, although long)

    I know there are a lot of reading, but there is a good chance that the magic trick is in one of these threads already. We will ride on the shoulders of their work.

  • Cannot find the shared library nilvaiu.dll and nican.dll.

    I'm using Labview 8.5.1 on windows XP 32-bit systems. Recently, I installed labview on a 64-bit XP system.  I feel what I think, problems of drivers on the 64-bit system, now. When executable files are run files are not: nilvaiu.dll and nican.dll.  Someone at - he lived these errors and now where to find the latest 64-bit drivers?

    Well, the list of drivers that are supported for XP 64-bit is quite short. And although NI-VISA, DAQmx and NI-CAN are not on this list, unfortunately.

  • Under .dll call of Mobile 6 PDA

    Hello

    I wish I could call a .dll in a SW developed on LabVIEW PDA and I have a problem with regard to the opening of This that me is provided by United Nations levels.

    FYI, I know that it is possible to make such an action (what we already inside of this application) but I want to know it is the necessary details about building the DLL.

    Indeed, should activate parameters specific to the level of the compiler (or other)?

    Pour info: the dll that does not work is generated Microsoft Visual C++ 4.0 integrated on an ARMv4 target (the PDA is ARMv5 TE normally backwards compatible)

    PS: question subsidiary-online is it possible under LabVIEW PDA call an EXE? (IE like what you can do in windows via the call to the command line).

    Thank you.

    Hello

    Calling external code (.exe or .dll) since a VI LabVIEW PDA is not as simple as for a classic VI.

    The two following privileges (and privileges which are mentioned) should be helpful to you:

    Launch an external program of LabVIEW Mobile or Application of Module Touch Panel
    http://digital.NI.com/public.nsf/allkb/8F811FFA7BACEC2486256FC5006DB821?OpenDocument

    Calling external Code in LabVIEW PDA and touch screen
    http://digital.NI.com/public.nsf/allkb/517300B49212795986256DDD00623FEE

    Kind regards

  • Error code coming 1097 in DLL call

    Hello

    I get the error code 1097 in the DLL function call. Please find the DLL by calling the function for more information.

    Function: GetControllerListTest (Controller * ptrControllertest, char * max_controller);

     

    Parameter Controllertest details:

    set NO_OF_CONTROLLER 100
    #ifndef CONTROLLER_STRUCT
    typedef struct
    {
    CString name;
    status of tank;
    CString blocked_by;
    Char group;
    } controller;

     

    Data type for the parameter Controllertest is structure. In LabVIEW, I configured the parameter as a cluster.

    name: line control

    status: complete control U8

    blocked_by: control string

    Group: entire control U8

    Could you please confirm it, did I set up the type of data in a correct way?

    I'm getting output empty table and the error Code of the DLL 1097. Can you please tell me where I am missing?

    Thank you

    Sivaramkumar.V

    What type "CString" defined?

    If it's a C++ type, as defined here, then you can not call this function directly from LabVIEW because LabVIEW can not pass of C++ types.  In this case, you will need to write a wrapper (in Visual Studio or another C++ programming environment) which takes a string (character array) standard C as an input, creates a CString from her and calls GetControllerListTest.

    If CString is defined as a fixed-length character array, then you need to replace the strings of LabVIEW with clusters of U8 containing a number of elements equal to the string length (LabVIEW does not support arrays of fixed length).

    If CString is defined as a pointer to a character array, you can pass the data to LabVIEW, but you must call the memory manager of LabVIEW functions to allocate memory for the string data and copy it.

  • In the c# dll call problem

    Hello

    I am new to c#, but I have to write DLLs to LabVIEW that reads the information on windows processes. I prepared the code (work as a Win32 application), it built as a dll and call the library function to call it. I tried another code in C language before and it worked fine. But when I do the same with c#, I have an error in LabVIEW:

    "The name of the function specified for this node is not found in the library. Click the node to call a library function and select Configure, and then choose the name of the correct function. »

    The function I created (I've pasted below this post) a functioning but LabVIEW does not see. Do you have any idea how to solve this problem? I couldn't find a tutorial for c# and LabVIEW, I saw some for c# and I it should work.

    Best regards

    Piotr

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Diagnostics;
    using System.Threading;
    using System.Xml.Linq;

    namespace GetProcessDataLib
    {
    public class ProcessData
    {

    public static String GetProcessDataFunction (out string result)
    {
    String xmlOutput = "";
    Try
    {
    code example
    }
    catch (Exception ex)
    {
    Console.WriteLine (example) Message + "\r\n" + ex. StackTrace + "\r\n" + ex. Source);

    xmlOutput = "";

    }
    result = xmlOutput;
    GetProcessDataFunction (without result);

    return xmlOutput;

    }

    }
    }

    Piotr.Zawistowski wrote:

    Hi Nathan,

    Thanks for the reply. I'm new to c#... I don't know I tried to:

    1 / create DLLs with Visual Studio Command Prompt (32 and 64). I used this command:

    csc/target: library / out: GetProcessDataLib64.DLL GetProcessData.cs

    2 / create DLLs to be taken automatically during construction.

    CSC is the compiler C Sharp and will create a default .net assembly, not a Windows DLL function. If you need to use the .net features in LabVIEW to access. And in any case this source code you can not create a Windows DLL function directly since there is no exportable function in there, but only the .net objects.

    And Nathan, C(++/#) compilers do not create header for the dll files. These header files must be created by the programmer creates the source code of the DLL.

  • problems in C++ dll call

    Hi, I compiled a dll in C++ to write data in a shared data segment, and it works well in Labview. Then I try to call the Dll in C++, it can be built successfully, but will break in the end. I have this problem since almost a whole day and could not find the solution.

    Here are the source files for my Dll and the program calling dynamically.

    DLL:

    Calling program.

    Problem solved.  The work for Labview and C++ dll must be like that. The shared data segment must also be declared as funtion and with 'extern 'C' ' coming. In addition, Labview can read only pointers from dll.

  • dll call problem

    I would use .dll files that have been developed for another application.

    I use TS 4.0 which is recognizing the function of the dll, but when try to run it it does not work.

    I thought that it is not so simple, I've attached to specify a part of module.

    Any help would be appreciated.

    Thank you

    Dear all,

    Thank you for your efforts in trying to help me to get out and find a solution.

    In the meantime, the problem has been resolved.

    The csAudio.dll is an interface between the original application and a DLL that has the function complete as an executable file.

    I saw this for the first time, I could see only csAudio.dll.

    The other DLL (an audiotester) has a function that uses the settings. One of them is a pointer to a string of zero completed (CString).

    The other two:

    -ReceiveBuffer is a variable passed that will be filled by the DLL and contains the results of
    the DLL.

    -ReceiveBufferLen is an integer variable that contains the length of the string buffer.
    The result of the DLL should be zero.

    The only problem still exist it is that if I call this DLL to stop TestStand freezes.

    So I skipped this step and it seems that TS closes and unload the DLL function when finished sequence.

    Best regards

    kopisti

  • The VISA almost a DLL call

    Well, I need to do some tasks finishing with LabVIEW objects inside my DLL. One of these objects is VISA serial port session. In LabVIEW, I can just call VISA VI close and everything goes OK. But in the DLL, it's complicated things because I can't see codes sources (or schema) near visa. I found some information that could use the visa32.dll viClose function in the LabVIEW folder or system32 directory. But when I try to use it with a simple casting to INT32 and passing to int32_t viClose(int32_t objectHandle); It goes to the error on the next launch of the program. Then look at this diagram:

    First the program works allright. Second time, it throws the following error:

    The program works fine with standard close VI of VISA. But it is impossible to use it inside my C++ library. Then I started thinking, appellant viClose simple is not enough for a proper clean-up of resource VISA. I tried viTerminate before viClose, but the problem remains the same.

    So, how can I log VISA properly in the DLL? Perhaps, it is better not to close it at all? There may be memory leaks that...

    Hi Dadreamer,

    I looked this error and we might be able to fix it by closing the VISA sessions automatically. See this knowledge base article for instructions of the environment of LV:http://digital.ni.com/public.nsf/allkb/A2561CDE98B66DD4862566510078264F?OpenDocument. The corresponding section:

    "

    • "In LabVIEW 8.x, select Tools ' Options to display the Options dialog box and select environmentfrom the category list page. "To disable the option, remove the check mark from the check box close automatically to the sessions of VISA and click on the OK button.

    Let me know if it works.

  • Using nilibddc dll with Python types

    I try to use this 'DiaDEM connectivity library' with Python to read files produced by our acquisition of data in the format *.tdms system, but examples of dll are all for C and Matlab. Has anyone else done that could give me advice? I made some progress (see below) by trial and error, but it is slow and I have to get it up and running quickly. I'm trying to reproduce the functions of the C example for reading a file (no need to write again).

    I'm using Python 2.6 on a Windows XP computer.

    Here's what I have so far:

    ------------------------------------
    # Module to manage a *.tdm and a *.tdms National Instruments TDM
    files in the format #.
    #
    types import *.

    #Define of the short names for the required dll functions
    DDCOpen = windll.nilibddc.DDC_OpenFile
    DDCNumGroups = windll.nilibddc.DDC_GetNumChannelGroups
    DDCReadGroups = windll.nilibddc.DDC_GetChannelGroups
    DDCGroupStrPropLen = windll.nilibddc.DDC_GetChannelGroupStringPropertyLength
    DDCGroupProperty = windll.nilibddc.DDC_GetChannelGroupProperty

    # File handles are pointers to 32-bit integer
    Czero = c_int (0)
    File descriptor = point (czero)

    # Retrieve a handle to the file
    DDCErrCode = DDCOpen (' Test_0919.tdms, 'PDM' file descriptor,)
    Print (DDCErrCode) # must be zero
    MyFile = real FileHandle.contents #The file handle

    # Find several groups
    grpnum = c_int (0)
    numPtr = point (grpnum)
    DDCErrCode = DDCNumGroups (myFile, numptr)
    Print (DDCErrCode)
    # Si DDCErrCode == 0: print (numptr.contents, grpnum)

    # Read groups [UNTESTED]
    groups = c_int (0) * grpnum
    grpptr = point (groups) # must be a pointer to the memory to organize grpnum
    Number of fields DDCChannelGrouphandle
    DDCErrCode = DDCReadGroups (myFile, groups, grpnum)
    Print (DDCErrCode)
    If DDCErrCode == 0: Print (groups)

    # Length of name of the Group [UNTESTED]
    namelen = c_int (0)
    nlenptr = point (name)
    DDCErrCode = DDCGroupStrPropLen (groups [0], 'name', namelen)
    Print (DDCErrCode)
    If DDCErrCode == 0: Print (namelen)

    #Make a buffer to hold the name, then get it back [UNTESTED]
    grpname = create_string_buffer(namelen+1)
    nameptr = point (grpname)
    DDCErrCode = DDCGroupProperty (groups [0], 'name', nameptr, namelen + 1)
    Print (DDCErrCode)
    If DDCErrCode == 0: Print (grpname.value)

    # Read the Group channels and get the names [UNTESTED]

    # Read the string # data values [UNTESTED]

    # Read the string of data values [UNTESTED]

    # Process the data values [UNTESTED]

    # Write data processed in a file in a different format [UNTESTED]
    ------------------------------------

    The "TESTED" sections are more or less pseudo-code representing things I have to do for now. The others work. These will be finally in a module.

    Cross-posted on some forums of Python.  Thanks in advance for any help.

    Kind regards
    Allen

    Can find out:

    http://Pypi.Python.org/Pypi/cTDMS/0.9

    or alternative link

    http://code.Google.com/p/ctdms/

    They seem to be exactly what you're looking for... (two years later)

  • Driver dll call

    I am writing a LabView program to control a card scanner. The manufacturer provided a DLL and some examples of C/C++ code for this.  My problem is to find a way to pass the handle from driver in LabView.  C code to call this dll looks like this:

    # define drv_handle void * / / this is the header

    drv_handle hDrv; Returns the handle to the open pilot or NULL in case of error
    hDrv = spcm_hOpen ("/ dev/spcm0"); string the driver to open

    I can get the card to initialize correctly. I can't understand how to move the vacuum * through LabView in other functions.  Any suggestions or places to watch?

    That would have to be a "pointer size whole." signed or unsigned any really, but you should definitely maintain coherent and personally, not signed.

  • From two hexagonal numbers as a variable byte in dll calls

    I imported a DLL, which works well when it was called by C++ codes.  However, a few screws converted did not work properly.  The original functions were supposed to write a set of two hexadecimal numbers (one byte in size) to an address specified in the form of two characters.  Somehow after these functions have been converted to screw, they wrote the first hexagonal number and ignore the rest.  My speculation is that, given that this variable is declared as a type byte, the VIs may only take the first hexadecimal digit as a character (also a byte in size) and ignored the following hexadecimal number.  Has anyone ran into similar problems?

    Configure the setting in COLD LAKE to be a U8 integer instead of a string.

  • LabVIEW DLL called from C

    I would like to create a DLL in LabVIEW which can be called from a C program.

    The purpose of the DLL is to display a dialog box along side a C program user interface and view a picture is updated continuously in the program.

    The LabVIEW DLL would be

    1 would be considered to be a dialog box that opens up along the side of the user interface of the C program.

    2. the DLL would regularly be called with the parameters passed by the C program.

    3. the dialog box would contains a picture that is updated by the parameters of the permanence of program C.

    Is this feasible?  I assume that the DLL has to work like a demon, because the DLL is a dialog that must cover along the side of the user interface of C.  To run a DLL written in LabVIEW, is the needs of PC - the runtime?

    Everything was OK until 5. For 6, you do not get a reference to something C. You simply call the exported function that is the VI 'set params.

    I have included a sample project to give you an idea. The code LabVIEW is written in LV 8.2 and the project with a version of a DLL specification. I used c# for this example, but you can easily translate it c If you wish.

  • DLL calling convention set-match?

    I'm convering an application in a DLL and everything seems to work except when I call it from a stub application I get a Non-fatal runtime error "CVI has detected and the inconsistency of the execution stack" Debugger dialog box when the DLL function returns.

    My heel is using the following to load the function:

    prototypes:

    HINSTANCE hInstSAE;
    typedef int(* x_calcSAE) (int, int * short *, char *, CXP_PARAM *);
    x_calcSAECG calcSAE = NULL;

    then in main():

    hInstSAE = LoadLibrary ("SAE.dll");
    If (hInstSAE)
    calcSAE = (x_calcSAE) GetProcAddress (hInstSAECG, "CAS");

    My DLL export function is declared:

    int DLLEXPORT sae DLLSTDCALL (int N, int * r, short * data, char * ID, CXP_PARAM * Param);

    How can I delete the error?  It does not appear to be a problem, because if I click on continue and calling other than bad going on nothing other than the popup of debugger on each return.  How can I get a stack dump to see what Setup before the call and the return?

    Hey wally.

    My guess is that you need to change your typedef to the following:

    typedef int (* DLLSTDCALL x_calcSAE) (int, int * short *, char *, CXP_PARAM *);

    Generally, the default value used by convention to call CVI is __cdecl, which does not match your function prototype __stdcall calling convention.  This means that if you do not specify a calling convention for your function pointer, the __cdecl calling convention will be used.  You must update the function pointer type to match the declared function prototype.

    NickB

    National Instruments

  • LabVIEW dll call struct complex

    Hello

    I'm just creating a LabVIEW library for a Dll driver. The Dll contains complex structures. I just want to know if I can get around creating a wrapper Dll for these calls.

    It is an example of a function call:

    Error AA_querySlaveInfo (handle hSlave, SlaveInfo * pSlaveInfo,)

    int flags);

    typedef struct {}
    vendorId int;
    int productId;
    review of int;
    int series;
    const char * group;
    const char * image;
    const char * order;
    const char * name;
    int objCount;
    DataObjInfo * objs [1];
    } SlaveInfo;

    typedef struct {}
    the type of object int;
    const char * name;
    int bitLength;
    } DataObjInfo;

    Aid is quite aprechiated.

    Thank you

    Hi Keppi,

    This is not possible, sorry. Without the last entry in the struct that it would work, but this pointer to the another struct... you'll need a wrapper for it!

    I hope this helps,

    RMathews

Maybe you are looking for

  • Airpod risk

    so when I hear that the Airpod will have an infrared signal to connect both speakers at the same time, how can I be sure that will damage not cancer or have an impact on your overtime of health with the use of these? I'm not really wanting to have so

  • This file is past store safari in addition to login.keychain?

    I've been everywhere on the web for this. I reinstalled Mavericks and cannot find my passwords for all the websites in my TM backup. I tried login.keychain on my keychain username library file, but this file contains only connections to access my rou

  • 6 s iPhone and IOS 9.2 Bluetooth issues - help

    After updating IOS 9.2 that Siri does more work in my BMW or any other Bluetooth connected device.  There is a band of purple on the top of the phone when it is connected and no sounds are picked up by the microphone the phone or vehicle.  I restarte

  • Example: computer hp mini 110: administrator password lost account.

    Lost my administrator Mot_de_passe_du_compte and iam. How to fix? Thnk you

  • Windows xp works on VESA PC Thin Client eBox-2300

    I need to know if its possible will work windows xp on VESA PC Thin Client eBox-2300Here are the specsprocessor == Vortex86 SoC (System on Chip)main memory is 128 MB of SDRAMIt uses a card compact flash for a hard drive thinking about upgrading to 2