From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-01-2011 04:09 PM
I have some problems getting my DLL to work using 2 cluster inputs.
I create a simple DLL (MS C++ Express 2010) with 1 cluster and 1 struct Input and everything works.
If I add a second cluster/struct, Labview bombs and disappears, Even if it's the same structure definition and initialization inputs.
I'm making sure I have the struct Boundries set to 1 byte.
Any ideas?
Solved! Go to Solution.
08-01-2011 04:21 PM
In the Call Library Function Node, try enabling maximum debugging and see if you get a helpful error message, or at least stop crashing.
Also, can you post your code, both LabVIEW and the relevant C++ parts?
When you say "I'm making sure I have the struct boundaries set to 1 byte" - you're using #pragma pack(1)?
08-01-2011 04:38 PM
Not using the #pragma pack, just setting the option for structure boundry properties in VC.
It's been on maximum debugging but it's still crashing.
Attached vi is nothing fancy, just trying to get 2 inputs to work.
Hopefully something simple I'm not doing correctly. Thanks.
08-01-2011 04:50 PM - edited 08-01-2011 04:51 PM
Check your calling convention. The C++ code says it's STDCALL but in the Call Library Function Node you have it configured for C. Also, your functions should be prefaced with 'extern "C"' to get a normal-looking name in the call library function node.
EDIT: by the way, you might find NI's "Building a DLL with Visual C++" helpful.
08-01-2011 05:00 PM
Thanks! That's exactly what was going on.
08-01-2011 11:09 PM
Then you should mark Nathan's post as the solution to your problem rather than your own thank you message. Go to the options menu to the upper right of your message to first unmark your message as the solution.