Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble creating Variant format for ActiveX Function (MintMT Controller)

Hello!
 
I am creating a VI to control 2-axis motion using the MintMT activeX library and have run into a problem.  I was able to easily call and execute functions from Labview until I ran into one (VectorA) that requires an array of variant input.  I cannot format my input correctly and have exhausted myself trying different combinations of building this array and converting to variant type (To Variant). I also have wired Labview arrays directly (with no luck). The arrays are very small (only 2 elements). Finally I tried the OpenG library (Cluster to Varray and Array to Array of Vdata) without success.  The error code is: LabVIEW:  (Hex 0x80070057) One or more arguments are invalid.
 
Any advice?
 
Attached is the documentation for the function:
 
VectorA
 
Prototype:
 
VB      VectorA(nNumberOfAxes As Integer, nAxesArray As Variant,
                fPosArray As Variant)
Delphi  VectorA : (nNumberOfAxes: Smallint; nAxesArray: OleVariant;
                   fPosArray: OleVariant)
C++     void VectorA(short nNumberOfAxes, VARIANT nAxesArray, VARIANT fPosArray);
C       void VectorA(__int16 nNumberOfAxes, __int16 *nAxesArray, float *fPosArray);
0 Kudos
Message 1 of 5
(4,366 Views)
Hi Mr. NiceGuy,
 
Can you post the section of the vi that has this problem? Have you tried creating a constant input to verify what the input is expecting?
Regards,

Hillary E
National Instruments
0 Kudos
Message 2 of 5
(4,340 Views)
Hello Hillary_C_E,
 
Thank you for your prompt response. Unfortunately I was struck with the flu this past week so please excuse my delay in response. Attached is a section of the VI using the problem function. I've shown it with arrays wired directly, however, I get the same error regardless of array, cluster, or constant input
in native or variant format. In the example below I've requested a vector movement on 2 axes, (0,1) to an absolute position of (5,5).
 
 
 
 
0 Kudos
Message 3 of 5
(4,315 Views)

Hi Again,

I've been in touch with the manufacturer and they kindly provided a sample code.  This is the correct input format to run the function. Thank you for your assistance.

Mr.NiceGuy

0 Kudos
Message 4 of 5
(4,295 Views)

Hi Mr. NiceGuy,

The code from the manufacturer has a To Variant converter between the arrays and the Property Node. I'd recommend converting the arrays to variants in your code. You can find that To Variant VI on the Functions Palette » Programming » Cluster, Class, & Variant »Variant. Let us know if that works. Smiley Happy

Hillary

Regards,

Hillary E
National Instruments
0 Kudos
Message 5 of 5
(4,293 Views)