LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to pass dynamically updating c structure value in cvi 2010t to the labview 2013

I am trying to use a DLL that I created DLL in labwindow cvi 2010.  The DLL should output single.  I've attached my source code, header, generated dll, and the LabView code I use.  I  get Error 1097 "LabVIEW:  An exception occurred within the external code called by a Call Library Function Node. The exception may have corrupted LabVIEW's memory.

The DLL is will work  properly when passing static values to the structure without  error.If we passing  dynamically updating structure value to local structure.It gives error code1097.

Download All
0 Kudos
Message 1 of 2
(2,861 Views)

I don't really understand what you mean with static values and dynamic in this code. Is the C code you show the one that works or is it the one that crashes? For one, I think it is probably a good idea to change the declaration of the global variable

LVUserEventRef* lvUserEventRef = NULL;

to 

LVUserEventRef lvUserEventRef = kNotAMagicCookie;

That way you provide storage for the refnum itself rather than for a reference to the refnum that will be invalidated as soon as your SetUserEventRef() function returns to the LabVIEW diagram.

 

 In addition, I would test in SendEvent() for this variable to be not eaqual to kNotAmagicCookie before trying to even send anything to LabVIEW.

 

 

 

 

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 2
(2,814 Views)