I figured it out. I am saving my Spindle rannge and alsso teh commandded speed on screen unload, and restoring them on screen load.
I put this in my unload script:
local inst = mc.mcGetInstance()
local cRange = mc.mcSpindleGetCurrentRange(inst)
--What Pulley range is currently active 0-19
cRange = tostring(cRange)
mc.mcProfileWriteString(inst, "SpindleStuff", "CurrentRange", cRange)
local inst = mc.mcGetInstance()
local cSpeed = mc.mcSpindleGetCommandRPM(inst)
--What Spindle Speed is currently commanded
cSpeed = tostring(cSpeed)
mc.mcProfileWriteString(inst, "SpindleStuff", "CurrentSpeed", cSpeed)
and I put this in my Load script:
local inst = mc.mcGetInstance()
local cRange = mc.mcProfileGetString(inst, "SpindleStuff", "CurrentRange", "0")
--Get saved Range Value from Profile (0-19)
cRange = (tonumber(cRange))
mc.mcSpindleSetRange(inst, cRange)
--Set Current Range to saved value
local inst = mc.mcGetInstance()
local cSpeed = mc.mcProfileGetString(inst, "SpindleStuff", "CurrentSpeed", "0")
--Get saved Speed Value from Profile
cSpeed = (tonumber(cSpeed))
mc.mcSpindleSetCommandRPM(inst, cSpeed)
--Set Current Range to saved value
and it works!
Not sure if this is the best way to do it, but...it works!