Jump to content

Fred chen

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by Fred chen

  1. 2 hours ago, Rolf Kalbermatter said:

    From the look of it I would guess a bug in your zlgcan_wrap.dll or one of the myriads of other DLLs it depends directly or indirectly. Nothing in the LabVIEW diagram looks suspicious from the little information (none) we got from you about this DLL interface!

    So what is the C declaration of this function and its datatypes and subtypes?

    Thank you for your reply. The attachment is the header file.  It should be noted that when the acceptance rate is low, the program can run normally.

    zlgcan.h

  2. Trying to call the function below:

    typedef struct tagZCAN_CHANNEL_INIT_CONFIG {
        UINT can_type; //0:can  1:canfd
        union
        {
            struct
            {
                UINT  acc_code;
                UINT  acc_mask;
                UINT  reserved;
                BYTE  filter;
                BYTE  timing0;
                BYTE  timing1;
                BYTE  mode;
            }can;
            struct
            {
                UINT   acc_code;
                UINT   acc_mask;
                UINT   abit_timing;
                UINT   dbit_timing;
                UINT   brp;
                BYTE   filter;
                BYTE   mode;
                USHORT pad;
                UINT   reserved;
            }canfd;
        };
    }ZCAN_CHANNEL_INIT_CONFIG;

    CHANNEL_HANDLE ZCAN_InitCAN(DEVICE_HANDLE device_handle, UINT can_index, ZCAN_CHANNEL_INIT_CONFIG* pInitConfig);

     

    Can anyone give me some tips on how to pass this structure with union into DLL?

     

    Thanks for any help you can provide!:)

  3. Hi

     

    When I call the DLL, there is a structure:

    struct Signal
    {
    uint32 nStartBit; 
    uint32 nLen;
    double nFactor; 
    double nOffset;
    double nMin; 
    double nMax;
    double nValue;
    uint64 nRawValue;
    bool is_signed; 
    char unit[11];
    char strName[66];
    char strComment[201]; 
    };

     

     

    There is another  Message structure to the above Signal:

     

    struct Message
    {
    uint32 nSignalCount; 
    uint32 nID;
    uint8 nExtend; 
    uint32 nSize; 
    Signal vSignals[513]; 
    char strName[66];
    char strComment[201]; 
    }

     

      The point is  Signal vSignals[513];

     

    I've tried to solve it like this,but the program will crash.

     

    How to create struct Message ,any good suggestions?  Thanks a lot.

     

    qq.png

    message.vi

×
×
  • Create New...

Important Information

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