Realterm now has an Examples directory, which contains more up-to-date examples than below RealtermDemo.m is on Download page |
Contents
|
Realterm's
ActiveX interface was added so it could be controlled from Matlab 5.
Realterm is fast, runs independent of the Matlab process, and is
reliable. It lets you see the data you are sending and receiving. As it
runs in its own process, there are none of the problems caused by
Matlabs single threaded-ness
Matlab V6 added serial port support, but it has problems with reliability, speed, and the matlab threading model |
(What follows is for V5.3. V6.5 of matlab has changed some activeX stuff. eg enumerations now return strings, not numbers. See "Introducing New ActiveX Features in Matlab 6.5" )
|
When you want to get data from an instrument, and process it in Matlab, I find it is easier to just capture data to a file with Realterm, then have Matlab read the file. This is a "design pattern" that appears ugly, but has been easy to get going, and sucessful. It is well decoupled, which is what makes it so easy to do.
The key point is that you can open a file for READ with Scilab, while Realterm has it open for WRITE
How:
It can be even easier to just put outgoing commands into a file, and use SendFile to send them. By setting SendRepeats and SendDelay, you can make the commands repeat automatically, and just use your matlab program to read the data at its leisure. This technique is ideal for data logging applications.
If you don't want to use the ActiveX interface, then later versions of Realterm let you directly send commands repeatedly using sendfile, and sendrep, and using capture to get the result. You can use this with Scilab for example, as it doesn't have an activeX interface.