LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mitsubishi MX components and labview

Hello

 

I have a problem using the Mitsubishi Active X controls.

I know the Active X works OK I have used it with a VB app and it worked as described in the manual.

I wish to intergrate a LabView VI with a PLC the problem I have is as follows

 

All methods work i.e. they run, give a result and do not generate an error

Methods that return single values work exactly as they should, but some methods are meant to return an array of values, but only return a single integer.

I believe this is due to Labview incorrectly using the method.

 

Is there a way to fix this, i.e. change the properties of the method to output the correct data type.

 

0 Kudos
Message 1 of 4
(5,250 Views)

Carples,

 

I found this on the forums:

 

"LabView and Visual Basic for Applications (VBA) only support the VARIANT data type for arrays. Visual Basic, however, supports more descriptive array parameter specifications in IDL. In other words, there are numerous valid ways to declare array parameters in IDL, however, some tools only support a subset. LV only supports VARIANTs. So in the previous IDL example:

[id(3), helpstring("method NSEnumDevice")] HRESULT NSEnumDevice([in] int devIndex, [in] SAFEARRAY(int) *ports);

becomes -

[id(3), helpstring("method NSEnumDevice")] HRESULT NSEnumDevice([in] int devIndex, [in] VARIANT ports, [out, retval] VARIANT *devObj);

Where devObj is an ActiveX wrapped object. VARIANT "ports" is an array of integer values. To specify returning an array of values, you still just use "
[out, retval] VARIANT *array"."

Rob K
Measurements Mechanical Engineer (C-Series, USB X-Series)
National Instruments
CompactRIO Developers Guide
CompactRIO Out of the Box Video
0 Kudos
Message 2 of 4
(5,223 Views)

Thank you for the link.

 

Unfortunatly I dont understand the solution.

 

What do I do to the active X controls to change to output to a variant array.

 

 

0 Kudos
Message 3 of 4
(5,200 Views)

Hey ! Robbob

You didn't answer Carples' question. He cannot have a choice to change the MX Component code.  I have the same problem as him. There are many controls in the MX Components. The one that  cause such problem is the ActEasyIF control which apparently doesn't use variant data. It return only the first element as the output data (supposed to be 1-D array). Another Control, ActMLEasyIF, use the variant data type, but if return nothing as the output (in LabView).

I neither have the solution. 

0 Kudos
Message 4 of 4
(4,987 Views)