Jump to content

Joshuatronics

Members
  • Posts

    6
  • Joined

  • Last visited

Posts posted by Joshuatronics

  1. Hi,

    I want to ask if anyone can check if what i am doing is correct. I'm calling an external dll and i have doubts about the data type in the function.

    DWORD HiCOCANWrite( BYTE Can, psPCCanMsg msg, DWORD Timeout )

    • Can: Number of the node which is to transmit the message.
    • Msg: Pointer to message data
    • Timeout: Specifies the time HiCOCANWrite is waiting for a free entry in the transmit queue when the transmit queue is full.

    the problem in the functionis the psPCCanMsg, that is a structure defined as,

    typedef struct

    {

    BYTE ff; /* frame format: 0 = basic CAN, 1 = extended CAN */

    BYTE rtr; /* 0 = normal frame, 1 = remote frame */

    BYTE dlc; /* data length 0..8 */

    DWORD id; /* telegram ID */

    BYTE data[8]; /* data */

    sTS timestamp; /* time stamp*/

    }sPCCanMsg, *psPCCanMsg;

    and the structure sTs is defined as,

    typedef struct

    {

    WORD day;

    BYTE hour;

    BYTE min;

    BYTE sec;

    WORD ms;

    WORD us; /* micro seconds; max. resolution 10μs */

    }sTS, *psTS;

    I used clusters for structures. i attach images of my labview code and the configuration in call libray.

    The point is that the code is not working or does nothing. I'm using LabVIEW 7.1.

    Please if anyone can help me I would appreciate it.

    Thanks

  2. QUOTE (rolfk @ Feb 27 2009, 05:06 AM)

    There is no obvious reason for this to crash. According to the doc the 100 character input buffer for the error string should be enough.

    - Maybe try to make that buffer 1000 for a trial.

    - Maybe the error VI is supposed to only be called when not NULL.

    - WINAPI calling convention if not right would certainly crash this VI every single time.

    - Are you sure it is the error function and not one of the other VIs that crashes? There are enough other functions that get called. While WINAPI convention would badly crash if the number of parameters was not right it might be the actual value passed to the Open or Start function.

    Rolf Kalbermatter

    Thanks to both, suddenly it stops crashing. I didn't do anything. Let's hope it continue.

    I'm sorry for not including the other library i have it.

  3. Hi, I want to link a DLL from of a driver of a CAN BOARD, and I need to use the functions in the DLL.

    I´m using LABVIEW 7.1 and I tried using the Call Library Function Node but somtimes it crushes specially when i copy and paste some code after i've executed the program.

    The function that causes the error is defined in C as:

    DWORD HiCOCANGetErrorString (DWORD ErrorCode, TCHAR *Puffer)

    Where,

    DWORD = unsigned long

    TCHAR = char

    *Puffer = Pointer to the beginning of a buffer with a size of 100 characters, where the error code is to be entered.

    i attached two VIs, the first one makes crushed labview after executing the program.

    the i read in a post that inicializing an array and casting it it solved the problem, it worked at the beginning but when a try to copy-paste some code, labview crushes anyway.

    is the anysolution??

    THANKS

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.