GUI Program for sending serial commands to instrument

1 view (last 30 days)
I am trying to use MATLAB to control an instrument via an RS-232 connection. I want to write a GUI containing several buttons that each send a separate command to the instrument. I'm wondering what the best way to handle the serial object is. When the program is executed, it prompts the user to enter the appropriate com port.
Should I create the serial object at the beginning and make it a global variable? The only other option I see is to create a new serial object each time I want to send a command to the instrument and then delete it after the command was sent. Is there some other way to handle this?

Answers (0)

Categories

Find more on Instrument Control Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!