Description: Tested in R13!!!
This app is designed to allow easier interfacing with interfaces such as GPIB, Serial, and others (though honestly I've never tried it on anything other than an iotech GPIB.)For information on interfaces, check out
NOTE: In this app, I refer to interfaces as devices, because they interface to a physical device, like a multimeter or an O-scope, etc.
In it's present state, this app has 3 Command Environments, each has a different prompt, and responds differently to commands.
Device ($>) in the device command environment (ce), commands that you type at the prompt are sent directly to the current interface using fprintf. fscanf is then called on the interface, and the results are displayed on the console (Command Window).
Please note that because of this, by default, all new interfaces created in this program are created with a Timeout of 1 (second). You can change the default value for any new interfaces created during the runtime by typing 'default Timeout' in the Program CE. You can also change the value of the variable defaultTimeout in the beginning of this code, to change the startup value for default Timeout. use intrhelp to find out how to st a custom Timeout.
FUTURE PLANS: I plan to add a simple way of opting out of calling fscanf, on a onetime basis and on a toggle basis. I hope to introduce a new CE which will allow you to use MATLAB code for strings (indexing, and concatenating, and casteing, etc) to send commands, e.g., instead of:
$>MATH1:DEFINE "CH1 + CH2"
You could use:
:$>['MATH1:DEFINE ','"CH1 + CH2"'];
I understand in the above situation, there's no point, by ideally, you could use variables instead of string literals Program (:>) This CE simply allows access to basic commands specific to MICE.
Commands like quit, cls, new device, device list, etc. Feel free to hardcode your own commands into the Program Section (feel free to do it anywhere, but it will be a little harder anywhere else).
If you have any good ideas of commands you want to see, let me know. To get a complete list of Program CE commands, get out a pen and paper and write down all the cases in the switch command of the program section.
In theory, the MATLAB CE works just like you're typing in the
Command Window. I'm not going to gurauntee that, but that's the premise.
Switching Command Environments
To switch from one CE to another, simply type the prompt at any of the CEs' prompts. E.g., to switch from the MATLAB CE, to the device CE, it would look like this:
To do a CE override, in otherwords, send a single command to another CE without actually switching to that CE, simply type the prompt of the target CE, without the > at the end. So if you wanted to quit MICE (but honestly, I mean why would you?) from the device CE, it goes like this:
To find out what the current device is from the MATLAB CE, like this:
And to send the identity query to the current interface from the program CE:
"A Bug is a feature that has yet to be documented."
Related: Access, Basic, Simply, literals, ideally, variables, String, specific, micecommands, elseif, Ideas, Complete, harder, hardcode, Section, Point, there039s
O/S:BSD, Linux, Solaris, Mac OS X
File Size: 10.0 KB