LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use preprocessor directives (#define) in C++ header file with LabVIEW 8.2

BCho - Not sure what you mean about sending an integer to my DLL.  I just wanted to implement some constants in LabVIEW using the .h file from my DLL source code.  I have a list of error codes and some other symbolic constants that make for a better design (easier to understand and maintain).  I have now implemented  the constants with a separate VI and it works, but it's not real elegant.  Since I'm building this to be used by our customers to write their own applications to communicate with our hardware, they can implement the constants any way they like (as long as they use the values in the .h file), though I would like to provide them something nice that works.  I'll be creating the DLL and some example VIs as part of a SDK for our customers. 
0 Kudos
Message 11 of 15
(1,079 Views)

Hey garya505,

 

I guess I am still unsure what you are referring to when you are saying you are looking to when you say you are looking to implement some constants in LabVIEW; so that makes it a little difficult to suggest a more elegant solution than the one you already have.

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 12 of 15
(1,049 Views)
What about about a ring control as suggested earlier in this thread doesn't work??
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 13 of 15
(1,036 Views)

BCho wrote:

Hey garya505,

 

I guess I am still unsure what you are referring to when you are saying you are looking to when you say you are looking to implement some constants in LabVIEW; so that makes it a little difficult to suggest a more elegant solution than the one you already have.


 

I would like to implement something that I can provide to my customers that will make it easier for them in developing their applications for our hardware.  Some of the functions in my wrapper DLL have parameters that use these constants.  For example, a parameter such as "mode" might be RCV or XMIT, or a parameter such as "flow" might be ON or OFF, or "buffer" might be BUFFER1 or BUFFER2.  In the .h file, these might be:

#define RCV 0

#define XMIT 1

#define OFF 0

#define ON 1

#define BUFFER1 0x00001000

#define BUFFER2 0x01001000

 

 

 

0 Kudos
Message 14 of 15
(1,019 Views)

rolfk wrote:
What about about a ring control as suggested earlier in this thread doesn't work??

 

Thanks, I'll check into the ring control.
0 Kudos
Message 15 of 15
(1,018 Views)