Does the #cmdSetup dialog need to be open before the func is defined? If so, how can I do that? If not that, what do you think is going on there?
I have not gone through your stuff yet, but the function definition is stored in the parser that is associated with scpiCmd and global is always valid.
One issue: Never call another #pgm# scpiCmd from one, they use the same instance of the parser, i.e. it will give some serious issues.
Functions create their own temporary instance of the parser and do not affect anything else.
The function and scpiCmds all work, the problem is enabling the function using a scpiCmd, independent of the scpiCmd calling the function. I made the addFuncGlobal a #pgm# command:
#scpiCmd EnablegetMeasUnit #pgm#
addFuncGlobal("getMeasUnit","""
If I manually enable that, it works fine. The problem is, I don't know how to enable the global function automatically.
For example, initCmd does not work:
#initCmd MeasDefault;
EnablegetMeasUnitIt shows the command execution in the log, but the global function doesn't work until I manually run the
EnablegetMeasUnit cmd. After I manually execute that, everything works as it should.
Thanks,
Josh