PhattieM Posted June 13, 2008 Report Share Posted June 13, 2008 Hello Forum, My research team is working with a robotic arm that provided defunct datasheets and API information. It is our goal to communicate with this robot through LV by importing a .dll file. However, this option is proving difficult because the only information provided was header files and static libraries, no .dll, and no proper method for making one. We attempted to create a wrapper class that would include the .h files, link the static library, and call the functinos directly but we are not Visual Studio saavy enough to determine if this method will work. Does anyone have any input, or a possible methods by which to do this? Also, after performing the above method we came across some documentation that said the robotic arm could be controlled through Python. Does Labview provide a way to externally call Python code? If so it may be worth learning Python to get this thing working. Thanks in advance, Mark Quote Link to comment
Rolf Kalbermatter Posted June 19, 2008 Report Share Posted June 19, 2008 QUOTE (PhattieM @ Jun 12 2008, 11:02 AM) Hello Forum,My research team is working with a robotic arm that provided defunct datasheets and API information. It is our goal to communicate with this robot through LV by importing a .dll file. However, this option is proving difficult because the only information provided was header files and static libraries, no .dll, and no proper method for making one. We attempted to create a wrapper class that would include the .h files, link the static library, and call the functinos directly but we are not Visual Studio saavy enough to determine if this method will work. Does anyone have any input, or a possible methods by which to do this? Also, after performing the above method we came across some documentation that said the robotic arm could be controlled through Python. Does Labview provide a way to externally call Python code? If so it may be worth learning Python to get this thing working. This should be fairly simple. For every function in the object library that you want to be available in LabVIEW through a Call Library Node you would have to write a small wrapper. Something like this: Original function as exported from the lib: int MyFunction(int param1, int param2); Your new function: __declspec(dllexport) int LV_Myfunction(int param1, int param2) { return MyFunction(param1, param2); } Then compile it into a DLL, linking this with your object library. Possibly you could maybe suffice with a modified header file in a DLL project without any other source files where you add the __declspec(dllexport) in front of each function and simply link in the object library but I never tried that. If you want to persuade the Python solution you could look at LabPython. It is on sourceforge. Rolf Kalbermatter Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.