LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I have a data type issue regarding calling. net assemblies

Solved!
Go to solution

thanks!

0 Kudos
Message 11 of 37
(888 Views)
I just tried and returned an error code. I have a dongle, and the normal return value should be 0. If there is no dongle, I will return 105
0 Kudos
Message 12 of 37
(882 Views)

I modified my program as you said. After opening the communication connection, I tried to open the servo control and received the connection error code: 36864.

0 Kudos
Message 13 of 37
(869 Views)
Solution
Accepted by topic author Freddy.

Well, you need to learn a bit more about C syntax.

 

Compare these three prototypes:

 

LONG STDCALL ESOpen(long controllerType, char *ipAddress, HANDLE *handle);
LONG STDCALL ESServo(HANDLE handle, long onOff);
LONG STDCALL ESClose(HANDLE handle);

 

Do you see any difference about the handle parameter?

Yes indeed there is an asterisk in front of the variable name in the ESOpen() function. This is because this parameter needs to be passed by reference, in order for the function to be able to return a value in it.

 

This asterisk is missing by the other two functions and that means that this parameter should not be configured to be passed as Pointer to Value but as Value instead.

 

Also, please check the parameter order for your ESServo() function. You got that wrong.

 

Last but not least, you SHOULD wire values to the inputs of the MotomES Open.vi function. The default for the controller type is not going to work as is. The default for the ipAddress might work for your current network setup but I doubt that is the default setting for your device when delivered from the factory.

Rolf Kalbermatter
My Blog
0 Kudos
Message 14 of 37
(847 Views)

I just modified the program again, and the IP address is the real device address because I can control it using C # routines. But I got the same error code as using the. net assembly: connection timeout.

Download All
0 Kudos
Message 15 of 37
(834 Views)

I have reviewed the code and found some errors. Now, there is another issue: how to pass in parameters to the DLL structure

0 Kudos
Message 16 of 37
(827 Views)

I tried to match to the type and entered the cluster type for LV, but returned a parameter error code

0 Kudos
Message 17 of 37
(820 Views)

Hello, I seem to have encountered a more serious problem: when I called this library function, labview crashed

0 Kudos
Message 18 of 37
(800 Views)

I have found a solution by changing the nested arrays in the structure to array elements

0 Kudos
Message 19 of 37
(793 Views)

Hello, I have encountered more complex structural parameters, and applying the above settings will no longer work.

0 Kudos
Message 20 of 37
(779 Views)