Instrument control package: Difference between revisions
→Windows (cygwin): Added instructions for GPIB on Windows
(→Windows (cygwin): Added instructions for GPIB on Windows) |
|||
Line 60: | Line 60: | ||
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. | ||
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 | |||
# fake_linux_gpib.sh, Kire Pûdsje, Dec 2017 | |||
# This file generates a fake linux-gpib library on Windows, based on the | |||
# installed NI libraries. | |||
# Prerequisits are that during install of the NI drivers, the C/C++ support | |||
# and the NI Measurement & Automation explorer has been enabled. | |||
# this define should find the NI header file, if properly installled | |||
# otherwise just point it to the proper header file. | |||
NI_H_FILE="${NIEXTCCOMPILERSUPP}/include/ni4882.h" | |||
NI_DLL_FILE=ni4882.dll | |||
NI_DEF_FILE=/tmp/${0##*/}-$$.def | |||
# symlink NI header file | |||
mkdir -p /usr/include/gpib/ | |||
ln -sf "${NI_H_FILE}" /usr/include/gpib/ib.h | |||
# generate .def for all functions in the NI header file with a NI488CC prefix | |||
echo LIBRARY ${NI_DLL_FILE} > ${NI_DEF_FILE} | |||
echo EXPORTS >> ${NI_DEF_FILE} | |||
grep "NI488CC *[A-Za-z]" /usr/include/gpib/ib.h \ | |||
| sed "s/^.*NI488CC *//" \ | |||
| sed "s/(.*$//" >> ${NI_DEF_FILE} | |||
# generate the wrapper library simulating gpib-linux | |||
dlltool -d ${NI_DEF_FILE} -l /usr/lib/libgpib.a | |||
#cleanup | |||
cat ${NI_DEF_FILE} | |||
</source> | |||
== MacOS == | == MacOS == |