Bernd F Posted January 22, 2010 Report Share Posted January 22, 2010 Hy 2 @ll. I created some code with typedefs. These typedefs i created manualy from #defines and typedefs of a headerfile. Like: #define LENGTH_FW_REVISION 8 /* including terminator */ typedef struct FwRevision { u_16 result; c_8 string[LENGTH_FW_REVISION]; } FwRevision; typedef struct RspGetFwRevision { FTRspMsgHead common; FwRevision revision; } structRspGetFwRevision; Every time the header-file changes i had to modify the typedefs manualy. Had someone the same problem and did some concept-VIs ? or Is there somewhere a Demo-VI, i didn't found? How to create a Cluster with scripting? Hints or links will be fantastic, too. Thanks a lot. Bernd Quote Link to comment
vugie Posted January 22, 2010 Report Share Posted January 22, 2010 (edited) I'm just playing with SWIG, whuch is able to parse C/C++ headers and create XML with description of all types and functions. From such XML it should be possible to programatically create typedefs and even wrapper VIs using scripting. I have no usable results yet, but it is promising - I want to use it to automatically create C wrappers for C++ DLLs. Edited January 22, 2010 by vugie Quote Link to comment
mzu Posted January 22, 2010 Report Share Posted January 22, 2010 I'm just playing with SWIG The other option would be to use Microsoft (VS) Automation, which is able to parse C and C++ on the source code level. I used it with some degree of success in my CIN wizard for VS.2003 some time ago. Since LabVIEW is becoming more and more Microsoft-centric ... Quote Link to comment
ShaunR Posted January 23, 2010 Report Share Posted January 23, 2010 I've been using a parser for quite some time to create typedefs. It doesn't pars C/C++ header files since it was designed to pars excel created text files for high channel count digital and analogue IO. The short answer is yes you can automagically create typedefs (they must not be in memory when you update them) and you don't need to use scripting. Here is a snippet that shows updating of the typdef. Quote Link to comment
Ton Plomp Posted January 24, 2010 Report Share Posted January 24, 2010 Hy 2 @ll. I created some code with typedefs. These typedefs i created manualy from #defines and typedefs of a headerfile. Thanks a lot. Bernd I am working on an extension of my "Variant To Control" to convert a typedef struct or enum to a LabVIEW control. Here's a beta version of the code: ArrayToEnum.llb. Use the 'Struct to Control' VI. The actual code is in the 'Struct to Variant'. Modify to your needs. Ton Quote Link to comment
Bernd F Posted January 27, 2010 Author Report Share Posted January 27, 2010 I am working on an extension of my "Variant To Control" to convert a typedef struct or enum to a LabVIEW control. Here's a beta version of the code: ArrayToEnum.llb. Use the 'Struct to Control' VI. The actual code is in the 'Struct to Variant'. Modify to your needs. Ton There is a pw on the "GetContorl From Type Descriptor_A2E.vi ... Quote Link to comment
Bernd F Posted January 27, 2010 Author Report Share Posted January 27, 2010 I got it. Thanks for all hints. It looks a little bit confusing, but it works fine. Hope it helps others, too. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.