I'm creating a new LabVIEW Driver for a new instrument that uses a Serial Interface. The Instrument has a SCPI library and I use that for control and communication. The hitch is that the Instrument defaults to a Terminal Mode (including Echos). I need to initiate Serial Communication and Send a "SCPI" mode command which also stops the 'Echo' reaction. After that I can Send & Recieve information just like a traditional SCPI instrument.
Because an Instrument Reset or some Instrument errors can cause the Instrument to drop back into Terminal Mode without notifying the software, I find it necessary to monitor all communication for a "Terminal" like reaction and restore "SCPI" mode if required.
My solution to this problem is to encapsulate all actual communication in a "Communication Handler" that keeps track of the Serial Port in use and handles any error conditions internally. Because of this, any actual commands (VIs) that I create for the Driver do not need VISA Resource Inputs or Outputs as the actual VISA Resource is encapsulated in the Communication Handler which is only given the actual SCPI Command for processing.
There are other advantages to the Communication Handler such as easier Communication Logging and cleaner Block Diagrams that contain the command VIs.
My big question is: Is it OK to handle Serial Communication in this manner in a LabVIEW Driver that I will eventually submit to NI for approval?
Thanks,
Tom Highfield (CLD)