I have an existing C++ project in Visual Studio 2022 and we are trying to replace an existing device with Tic 249 stepper motor controller. I am trying to get a dll to include in our project to control the Tic motor, but I am struggling to build the code from source and the instructions in BUILDING.md file does not have instructions to build in Visual Studio. Any help to get this integrated to my existing C++ project will be greatly appreciated.
The easiest way to to integrate the Tic into your project would be to simply install the pre-compiled Pololu Tic software we provide for Windows and then invoke
ticcmd from your program, the same way you would invoke any other command-line utility. Is there are particular reason that would not work for you?
If you want to use Tic’s C or C++ API directly from Visual Studio, I would suggest copying all the relevant source and header files from the Tic software and libusbp into your project and then compiling them. If you encounter errors, I recommend solving them one at a time, starting with the first one. If you encounter an error that you’re not sure how to solve, you could post the full error message here and I could probably help you figure it out.
Another idea would be to compile the Tic software in MSYS2 by following BUILDING.md and copy the relevant DLLs and headers into your project, but then you would have binaries from two different toolchains (GCC and MSVC) in your project and there might be some compatibility issues.
Thanks for the swift reply. We are looking at the option of invoking command-line utility. I’ll get back to you if I face any issues with this option. Thanks again.
I am trying to set the command timeout from the command prompt ticcmd, but not able to find the command for that in the command reference page. I can only see reset-command-timeout, but no command to set the timeout to say 60 seconds. Is there a command for that please?
The command timeout is a setting stored in the Tic’s non-volatile memory. You can set it (along with all the other settings) by providing a settings file to ticcmd’s
--settings option. However, it is probably simpler to just configure the Tic’s settings ahead of time using the Tic Control Center software.