ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sharing memory between the IDL ActiveX control an LabVIEW

Has anyone had any experience using the Research Systems IDL ActiveX control (IDLDrawX3, comes with IDl 5.5) with LabVIEW?

I get a strange memory error when I try to call the SetNamedArray method in some circumstances. The error reads:
"Memory is locked. in my.vi"
From the IDL manual:
"SetNamedArray. This method creates a named IDL array with the specified data. The data pointer is shared with IDL and the EDE application. Thus, changes in either IDL or the EDE will be reflected in both."
Arguments:
StrName (String),
vData (Variant),
bDestroyOnFree (Boolean)

If I make an event driven VI with a 2D array control, a load button, an activeX container containing an (IDL) IDLDrawX3 control, and a stop but
ton. Then on the value changed event for the load button call the SetNamedArray method - everything works fine.

However, if I create a data driven VI that just wires the SetNamedArray method in sequence with everything else then I get the memory locked error.

From a VB application one would declare a global 2D array and then pass this to SetNamedArray once at the start of the program. All changes to the array in VB are reflected within IDL since they are sharing the same block of memory.
=> I'm not sure how to do this in LabVIEW since the concept of variables is different. If the control containing the 2D array is modified I need to call SetNamedArray again to update the variable in IDL, which defeats the whole purpose of share memory.

Any thoughts?
I think the memory problem might be a generic ActiveX error...?

Novak.
0 Kudos
Message 1 of 2
(2,744 Views)
Novak,

I discussed this topic with some of our ActiveX developers here at NI. He suggested that the error lies in the ActiveX control. The control may expect a VB style memory model and so it is doing things very specific to VB. I would suggest contacting the developers of this control and suggest that they test their control with LabVIEW (they can always get the evaluation version).

Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 2 of 2
(2,744 Views)