Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: mcardoso on April 24, 2019, 09:20:58 AM
-
I have 30 or so custom functions that I wrote to interface over serial with some servo drives. Each one reads or writes a unique piece of data such as servoGetPositon(). These are taking up a lot of space in my screen load script and I would like to move them somewhere else to maintain readability without changing the functionality.
I am not a programmer so the phrasing I'm going to use is probably wrong, but is there a way to save all these functions in a "library file" and "include" this at the top of the screen load script? something like #include "servoScript.h" from C++? Does Mach/LUA support this?
Thanks!
-
Hi,
I think a module is what is required.
https://www.machsupport.com/forum/index.php?topic=35007.0 (https://www.machsupport.com/forum/index.php?topic=35007.0)
Craig
-
Thanks!
I'm going to have to watch that about 10 times to get it, but that looks perfect!
-
Converted all my custom functions to modules. Took a little effort but well worth it. Functionality has not changed (that's what I wanted)