11-25-2020 08:47 PM
I am trying to link to an external dll from Robotis--the dll is part of the dynamixel_sdk. I went through the import procedure, and the functions show up in the function pallet, but I cannot get the functions to work. I get the error shown below, which I understand is not uncommon, but even after configuring the Call LIbrary Function node, I still get the error.
I'm new to LabView, so I'm struggling a bit with this. Any advice or help would be welcomed. Please keep the response simple. 🙂
Thanks so much!
11-26-2020 07:26 PM
I do not have the exact answer for that, but I would recommend to "Run it in any thread" and also check the bit compability of the dll, by that I mean if you have a 64bitsdll running it on LV32bits that would make errors or visce-versa.
11-27-2020 07:23 AM - edited 11-27-2020 07:26 AM
@ederzer wrote:
I do not have the exact answer for that, but I would recommend to "Run it in any thread" and also check the bit compability of the dll, by that I mean if you have a 64bitsdll running it on LV32bits that would make errors or visce-versa.
If the bitness doesn't match LabVIEW can not even load the DLL, so a runtime error would be out of question. The function that is shown is also trivial enough and the calling convention seems to be correct too in respect to the GITHUB source I can see for that DLL. So I'm a bit lost at what could be the problem if it is for the setBaudrate() function as shown by the OP. The only thing I could imagine is that you first have to call an initialize function of some sorts before you are allowed to call other functions in the DLL.
11-27-2020 08:44 AM - edited 11-27-2020 08:46 AM
In fact it seems you need to call portHandler() first with the correct port name before trying to access any other function. The return value of the portHandler() function needs to be used as port num parameter to all other functions. Without calling portHandler() first or passing any number as port num not returned by a portHandler() call, all those functions will without any protection directly attempt to access illegal memory which fully explains the 1097 error,
11-30-2020 08:05 AM
Rolf,
Thank you for these good hints. Now that the holiday is over, I will be back working on this project. I appreciate all you replies.
Regards,