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 | ||
Line 46: | Line 40: | ||
{{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 48: | ||
#similarly with: | #similarly with: | ||
# | #exist("parallel") == 3 | ||
# | #exist("i2c") == 3 | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
Line 70: | Line 63: | ||
To be able to use GPIB on windows, the linux-gpib library needs to be 'faked'. This can be done by copying the following script and run it in a bash-terminal. | To be able to use GPIB on windows, the linux-gpib library needs to be 'faked'. This can be done by copying the following script and run it in a bash-terminal. | ||
< | <source lang="bash"> | ||
#!/bin/bash | #!/bin/bash | ||
# fake_linux_gpib.sh, Kire Pûdsje, Dec 2017 | # fake_linux_gpib.sh, Kire Pûdsje, Dec 2017 | ||
Line 78: | Line 71: | ||
# Prerequisits are that during install of the NI drivers, the C/C++ support | # Prerequisits are that during install of the NI drivers, the C/C++ support | ||
# and the NI Measurement & Automation explorer has been enabled. | # and the NI Measurement & Automation explorer has been enabled. | ||
# this define should find the NI header file, if properly installled | # this define should find the NI header file, if properly installled | ||
Line 91: | Line 79: | ||
# symlink NI header file | # symlink NI header file | ||
mkdir -p | mkdir -p /usr/include/gpib/ | ||
ln -sf "${NI_H_FILE}" | ln -sf "${NI_H_FILE}" /usr/include/gpib/ib.h | ||
# generate .def for all functions in the NI header file with a NI488CC prefix | # generate .def for all functions in the NI header file with a NI488CC prefix | ||
echo LIBRARY ${NI_DLL_FILE} > ${NI_DEF_FILE} | echo LIBRARY ${NI_DLL_FILE} > ${NI_DEF_FILE} | ||
echo EXPORTS >> ${NI_DEF_FILE} | echo EXPORTS >> ${NI_DEF_FILE} | ||
grep "NI488CC *[A-Za-z]" | grep "NI488CC *[A-Za-z]" /usr/include/gpib/ib.h \ | ||
| sed "s/^.*NI488CC *//" \ | | sed "s/^.*NI488CC *//" \ | ||
| sed "s/(.*$//" >> ${NI_DEF_FILE} | | sed "s/(.*$//" >> ${NI_DEF_FILE} | ||
# generate the wrapper library simulating gpib-linux | # generate the wrapper library simulating gpib-linux | ||
dlltool -d ${NI_DEF_FILE} -l | dlltool -d ${NI_DEF_FILE} -l /usr/lib/libgpib.a | ||
#cleanup | #cleanup | ||
rm -f ${NI_DEF_FILE} | rm -f ${NI_DEF_FILE} | ||
</ | </source> | ||
== MacOS == | == MacOS == | ||
Line 113: | Line 101: | ||
If rpcgen cannot be build from source, the following error might be obtained: | If rpcgen cannot be build from source, the following error might be obtained: | ||
<syntaxhighlight | <syntaxhighlight style="font-size:13px"> | ||
pkg: error running `make' for the instrument-control package. | pkg: error running `make' for the instrument-control package. | ||
error: called from | error: called from | ||
Line 367: | Line 355: | ||
== i2c == | == i2c == | ||
i2c | |||
== TCP == | == TCP == | ||
Line 471: | Line 419: | ||
# 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 502: | Line 449: | ||
* Setting minor, sad, send_eoi and eos_mode is not implemented yet. | * Setting minor, sad, send_eoi and eos_mode is not implemented yet. | ||
* 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:Packages]] | [[Category:Octave Forge]][[Category:Packages]] |