Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

"flex_initialize_controller" function

I'm trying to initialize my motion controller (PCI 7334) using the "flex_initialize_controller" function and settings saved in "UTM" with the MAX version 3.1. Problem is the input parameter "settingsName" of the function. What datatype should it be?? According to the help it's a array of bytes [i8], according to the MAX it's a string.
With LabView 7.1 everything works well when I enter "UTM" as string on the "Initialize Controller" vi.
Does someone have an example of this function used in VB???
0 Kudos
Message 1 of 3
(3,943 Views)
this problem will be solved with NI-Motion 7

for now you can do the following:

Basically the fix involves changing the 'string' entries in FLEXMOTN.BAS from charArray% to ByVal charArray As String. Note that the name of the varible isn't always charArray. You can replace the function prototypes in the file with the ones below:

- Declare Function flex_initialize_controller Lib "FlexMotion32.dll" (ByVal boardID%, ByVal settingsName As String) As Long
- Declare Function flex_get_error_description Lib "FlexMotion32.dll" (ByVal descriptionType%, ByVal errorCode&, ByVal commandID%, ByVal resourceID%, ByVal charArray As String, sizeOfArray&) As Long
- Declare Function flex_get_motion_board_name Lib "FlexMotion32.dll" (ByVal boardID%, ByVal charArray As Strin
g, sizeOfArray&) As Long
- Declare Function flex_load_description Lib "FlexMotion32.dll" (ByVal boardID%, ByVal object%, ByVal description As String) As Long
- Declare Function flex_read_description_rtn Lib "FlexMotion32.dll" (ByVal boardID%, ByVal object%, ByVal description As String) As Long

Regards,
Bjorn
Message 2 of 3
(3,943 Views)
Thanks Bjorn, it works.
0 Kudos
Message 3 of 3
(3,943 Views)