Motor_Control_Labview_TestStand.zip (1.7 MB)
I created a library of VI’s and packed library that can be used as-is within LabView 2018 and called from TestStand to drive various features of the motor controller. It was only tested with the T249 but was built using the CS_ClassLibrary_TicDotNet.dll I created. I included the original TicDotNet files created by jigarciacortazar (or maybe Daniel Castelli for PyTic) but with a small change to make the Tic class public plus I added Forward/Reverse/Homing enums as boolean variables. Otherwise the TicDotNet.dll isn’t able to be used directly in LabView without being a public class.
I created this in order to test product that uses stepper motors where we might run up to 10k a year. The product doesn’t include a controller as it’s only a sub-assembly (the brains are added later as a higher level assembly) so the T249 was a quick solution to include in my test system. However we need to read back important info and also include safety features to avoid over-driving the different assemblies and/or operator safety. So Kill Switch and Limit Switches were important outputs we wanted to monitor.
The VI’s call the CS_ClassLibrary_TicDotNet.dll and you can select public methods like Energize, Get Step Mode, etc. It relies on the LibUsbDotNet.LibUsbDotNet.dll which the project includes when building a packed library.
In the Pololu_T249_Test.vi the Open and Close calls are included and the middle sub-vi can be any of the Public VI’s I created so far. For example, if you’d like to see all controller variables you could call Get_Status. Or if you’d like to drive the motor until it reaches a Forward or Reverse limit you could use Pololu_T249_Motor_Drive_to_Limit.vi. This assumes you have configured the DIO pins of your controller of course :). The velocity is set with an RPM instead and auto-calculated based on step-mode, steps-per-rev (motor dependent) and accel/decel profile (default is just the velocity divided by 10 but can be adjusted as needed).
I’ll be adding more features as I continue debugging and designing test systems with this controller so I’m providing what I have as-is for anyone’s use. For the most part, it’s as complete as it needs to be. If you have any suggestions or want any features added let me know and I’ll see what I can do with the time I have available.