Editing Instrument control package
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 7: | Line 7: | ||
{| class="wikitable" style="text-align:center" | {| class="wikitable" style="text-align:center" | ||
|- | |- | ||
! !! Linux !! | ! !! Linux !! Windows (Cygwin) !! Windows (native) !! FreeBSD !! Mac OS X | ||
|- | |- | ||
! Serial | ! Serial | ||
Line 17: | Line 17: | ||
! i2c | ! i2c | ||
| bgcolor="green" | v0.1.0 || - || - || bgcolor="skyblue" | stalled || - | | bgcolor="green" | v0.1.0 || - || - || bgcolor="skyblue" | stalled || - | ||
|- | |- | ||
! TCP | ! TCP | ||
| bgcolor="green" | v0.2.0 || bgcolor="green" | v0.2.0 || bgcolor="green" | v0.2.0 || bgcolor="skyblue" | stalled || bgcolor="green" | v0.2.2 | | bgcolor="green" | v0.2.0 || bgcolor="green" | v0.2.0 || bgcolor="green" | v0.2.0 || bgcolor="skyblue" | stalled || bgcolor="green" | v0.2.2 | ||
|- | |- | ||
! USBTMC | ! USBTMC | ||
Line 34: | Line 25: | ||
|- | |- | ||
! GPIB | ! GPIB | ||
| bgcolor="green" | v0.2.0 [[#Linux|(*)]] || | | bgcolor="green" | v0.2.0 [[#Linux|(*)]] || - || - ||- || - | ||
|- | |- | ||
! VXI11 | ! VXI11 | ||
| bgcolor="green" | v0.2.0|| bgcolor="green" | v0.2.0 [[#Windows_.28cygwin.29|(*)]] || - || - || bgcolor=" | | bgcolor="green" | v0.2.0|| bgcolor="green" | v0.2.0 [[#Windows_.28cygwin.29|(*)]] || - || - || bgcolor="green" | v0.2.2 [[#MacOS|(*)]] | ||
|} | |} | ||
Line 46: | Line 37: | ||
{{Code|Check for interface support|<syntaxhighlight lang="octave" style="font-size:13px"> | {{Code|Check for interface support|<syntaxhighlight lang="octave" style="font-size:13px"> | ||
pkg load instrument-control | pkg load instrument-control | ||
if | if (exist("serial") == 3) | ||
disp("Serial: Supported") | disp("Serial: Supported") | ||
else | else | ||
Line 55: | Line 45: | ||
#similarly with: | #similarly with: | ||
# | #exist("parallel") == 3 | ||
# | #exist("i2c") == 3 | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
Line 67: | Line 57: | ||
For VXI11 support, please install 'rpcgen', 'libtirpc-devel', and 'libtirpc1' before installing instrument-control. | For VXI11 support, please install 'rpcgen', 'libtirpc-devel', and 'libtirpc1' before installing instrument-control. | ||
== MacOS == | == MacOS == | ||
You need to build | You need to build rpcgen from source [http://mirror.ancl.hawaii.edu/pub/FreeBSD/FreeBSD-current/src/usr.bin/rpcgen]. | ||
= Examples = | = Examples = | ||
Line 156: | Line 95: | ||
}} | }} | ||
Chaging some configurations is simple done by calling helper functions | |||
{{Code|Serial port example: helper functions|<syntaxhighlight lang="octave" style="font-size:13px"> | {{Code|Serial port example: helper functions|<syntaxhighlight lang="octave" style="font-size:13px"> | ||
set(s1, "baudrate", 9600) # Change baudrate | set(s1, "baudrate", 9600) # Change baudrate | ||
Line 367: | Line 306: | ||
== i2c == | == i2c == | ||
i2c | |||
== TCP == | == TCP == | ||
Line 471: | Line 370: | ||
# Convert uint8 array to string, | # Convert uint8 array to string, | ||
char(data) | char(data) | ||
# close | # close usbtmc session | ||
vxi11_close(t0) | vxi11_close(t0) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} | ||
=== Limitations === | === Limitations === | ||
For now, | For now, | ||
Line 503: | Line 401: | ||
* Every read or write command opens and closes a new gpib session, since the linux-gpib session pointer is only valid for single command. | * Every read or write command opens and closes a new gpib session, since the linux-gpib session pointer is only valid for single command. | ||
[[Category:Octave-Forge]] | |||
[[Category:Octave Forge |