Hi,
I am an novice at programming with lua but i have experience with c an c++
If you can program in C and C++ then Lua will be a walk in the park. You could write scripts in C but you would
have to compile, edit and debug outside of Mach. Don't waste your time.
Mach4's latest builds have migrated to Lua 5.3 which has a few subtle variations on 5.2:
https://www.lua.org/manual/5.2/I notice you are using an Io? I assume that the CSMIO plugin has registered the Io you are addressing?
You cannot register an Io object from a script, registering an Io object is done by a plugin and the object is 'owned'
by the plugin. I don't think that your string correctly addresses the object, assuming it exists.
May I suggest you use a regular output. Output #5 for instance.
function m(126)
local inst=mc.mcGetInstance()
local hsig=mc.mcSignalGetHandle(inst,mc.OSIG_OUTPUT5)
mc.mcSignalSetState(hsig,1)
end
Assign a pin of your controller to Mach's output in the controller plugin and your done. This is how I would address an output
of my ESS for instance.
Note the I chose Output5 with malice aforethought because there is an LED for it in the outputs section of the
Machine Diagnostics tab. Allows you to see what you are doing.
Craig