Closed ciozi137 closed 1 year ago
@ciozi137 what is the status of this issue?
Handle Command.vi is still called by Instrument.lvclass:Process.vi. The "SetMagnetField" Sequence is handled by Instrument.Oxford1820.lvclass:Process.vi. I think that the issue described above needs to be better handled by the Instrument Framework
Perhaps Handle Command.vi should simly call "Send Message to Process" to forward the command to the child process. But how to deal with callbacks? As it is Handle command waits until there is a response to give. Not a great architecture.
PPMS uses its process.vi to communicate with the hardware. Messages are sent to it by PPMS:MessagetoProcess.vi; Replies go to Instrument:MessageToProcess.vi [Instrument broadcasts to the public via Instrument:MessageFromProcess.vi].
Oxford 1820 and VRM use their process.vi to handle sequences of commands (Heater, match PS current, wait, etc)
I think the solution should be to move all hardware communication to the child process.vi (like PPMS does); the child process can also be used to handle sequences (like 1820 and VRM) especially if non-blocking calls are avoided (see Wait sequence). Handle Command.vi should do simple message parsing: it can respond with data if it has, or forward messages to the child to execute.
Error handling updated in Instrument.lvclass:process.vi and Instrument.Framework-Template.lvclass:process.vi
CreatePrivateEvents, GetPrivateEvents, DestroyPrivateEvents, SendMessageToProcess created, configured, and called in Instrument.Framework-Template.lvclass:process.vi
Instrument.lvclass:process.vi: "Instrument: Open" and "Instrument: Close" are now disabled by default. If the user needs them (they have not moved their open/close to the child process) they can enable the states. But this is NOT recommended.
Open and Close are states in the Template:process.vi. Handle Command is perfectly capable to forward the command to the child process if the developer would like to go that route.