Jump to content

derhalt

Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Posts posted by derhalt

  1. C#

    // CAN message

    [StructLayout(LayoutKind.Sequential, Pack = 1)]

    public struct TPCANMsg

    {

    public uint ID; // 11/29 bit identifier

    public byte MSGTYPE; // Bits from MSGTYPE_*

    public byte LEN; // Data Length Code of the Msg (0..8)

    [ MarshalAs( UnmanagedType.ByValArray, SizeConst = 8 )]

    public byte[] DATA ; //Data 0 .. 7

    }

    So In labView....

    So I've created a Cluster with a U16(ID), U8 (MSGTYPE),U8(LEND) and an Array of 8 U8s (DATA),

    It is not possible to create an equivalent to your C# structure in Labview.

    What Labview creates will be something like this:

    (C++-Syntax)

    struct TPCANMsg{

    unsigned int ID;

    char MSGTYPE;

    char LEN;

    LVArray** Data;

    }

    struct LVArray{

    int Length;

    char Data[1];

    }

    You also have to check that your dll uses 1byte struct member alignment. This is what LabView expects.

×
×
  • Create New...

Important Information

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