08-22-2008 01:21 PM
I am accessing DLL functions using Call Library Function Nodes, and I have a function that takes a struct (LabVIEW Cluster) to set a trigger. There are a number of unsigned 16-bit words to define the trigger but the final element is a pointer to another (same type) struct so that a series of triggers can be configured. The syntax is:
typedef struct MTTRIGGER
{
U16BIT wCmdWrd1; /* CmdWrd1 value */
U16BIT wCmdMsk1; /*CmdWrd1 mask */
U16BIT wCmdWrd2; /* CmdWrd2 value */
U16BIT wCmdMsk2; /* CmdWrd2 mask */
U16BIT wNextFlags; /* Next flags for complex triggering */
struct MTTRIGGER *pNextTrg; /* indicates next condition to trigger on*/
} MTTRIGGER;
I have handled a pointer to another function by using a wrapper DLL but not sure that would even work here
(Rolf, are you still out there?)
08-23-2008 09:27 AM
08-25-2008 03:34 PM
Hi imd2,
Let us know if the former reply was what you were looking for.
Otherwise, you'll have to be more specific. I see no question in your posting.
Kevin S.
Applications Engineer
National Instruments
08-25-2008 05:02 PM
it looks like a good tip generally, but not sure it helps in this situation, he is feeding a LabVIEW cluster into the CIN to generate the c-code
this assumes you are using LV datatypes, but my clients function takes a struct that contains a pointer to another instance of itself. I don't believe that any data type emmulating a pointer to another instance of a cluster (reentrant) exists.
I'm thinking that it may be possible to write a wrapper DLL that will take an array of the cluster without the pointer; and then within the wrapper in a FOR loop assign the *pointer to each successive array element.
My C is nowhere near the level of my G programming so I need to play with this.
If you know of a cleaner way I would really appreciate it.
thanx
lmd2
08-25-2008 05:26 PM
08-25-2008 06:51 PM
thanx, figured I was on the right track,
should be okay now