Jump to content

Search the Community

Showing results for tags 'struct'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Software & Hardware Discussions
    • LabVIEW General
    • LabVIEW (By Category)
    • Hardware
  • Resources
    • LabVIEW Getting Started
    • OpenG
    • Code Repository (Certified)
    • LAVA Code on LabVIEW Tools Network
    • Code In-Development
  • Community
    • LAVA Lounge
    • LabVIEW Feedback for NI
    • LabVIEW Ecosystem
  • LAVA Site Related
    • Site Feedback & Support
    • Wiki Help

Categories

  • *Uncertified*
  • LabVIEW Tools Network Certified
  • LabVIEW API
    • VI Scripting
    • JKI Right-Click Framework Plugins
    • Quick Drop Plugins
    • XNodes
  • General
  • User Interface
    • X-Controls
  • LabVIEW IDE
    • Custom Probes
  • LabVIEW OOP
  • Database & File IO
  • Machine Vision & Imaging
  • Remote Control, Monitoring and the Internet
  • Hardware

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Personal Website


Company Website


Twitter Name


LinkedIn Profile


Facebook Page


Location


Interests

Found 2 results

  1. I recently posted this example code to ni.com - https://decibel.ni.com/content/docs/DOC-40315 Essentially I tried to create a completely universal (or close thereto) Cluster to Struct and Back Again set of functions. These consider packing/padding, data alignment, endian-ness, etc. I included some examples that have arrays and strings in the cluster as well as data pointers. I see this topic being fairly active here on LAVA and to a slightly lesser degree at NI.com Anyway, I don't know if the code will help anyone but I would be helped by any feedback or suggestions if anyone does try it! Cheers, -Jolt
  2. Hello, I am trying to call a function from a dll with a pointer to a complex struct. I have tried multiple ways to represent the string in the struct (see attached typedefs), but the output clusters from the dll call always has the same values as input (i.e the dll isn't updating the output values). The ref ptr is based on an example from this link and I have attached a screenshot of my code for this case: https://decibel.ni.com/content/docs/DOC-9079 Here is how the vendor defines the struct: typedef struct { dword passkey; //password dword request; //0=readprop, 1=writeprop, 2=writerelinquish dword deviceid; //device instance dword objectid; //objectid dword propid; //property id dword arrindex; //array index dword datatype; //see simpletypes dword value; dword errorclass; dword errorcode; dword priority; //1..16 union { char sval[1500]; wchar_t wval[1500/2]; byte bval[1500]; BACnetDate dval; BACnetTime tval; datetime dtval; directaddr da; HWND listbox; bufptr buf; Range rg; bdrCOV cov; pxfer *px; }aux; } bdrbag; Here is how the vendor defines the struct in their vb example: Type bdrbag passkey As Long 'password request As Long '0=readprop, 1=writeprop, 2=writeproprelinquish deviceid As Long 'device instance ObjectID As Long 'objectid propid As Long 'property id arrindex As Long 'array index datatype As Long 'see simpletypes value As Single errorclass As Long errorcode As Long priority As Long '1..16 sval(0 To 127) As Byte 'string value End Type Thanks, Russell TYPEDEF_BACNET_bdrbag_byte_cluster.ctl TYPEDEF_BACNET_bdrbag.ctl TYPEDEF_BACNET_bdrbag_ref_ptr.ctl
×
×
  • Create New...

Important Information

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