Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

127 Commits

Repository files navigation

ReadEncoder for SRT

Reading encoder module for SRT: The Small Radio Telescope.

Software prerequisites

Installation:

Example installation commands:

mkdir build/
cd build/
cmake -DCMAKE_INSTALL_PREFIX="/opt/ReadEncoder/" -DCMAKE_BUILD_TYPE="Release" -DBUILD_DOC=OFF ../
make
make install

Run:

E.g.:

./ReadEncoder -s 1 -l 2 -n "ttyUSB0" -b 19200 -p 'E' -d 8 -t 1 -a 127 -e 0 -u 40000 -o 1 -r 0 -i 1 -c 1 -g 1

or the same in a longer version:

./ReadEncoder --start 1 \
--length 2 \
--deviceName "ttUSB0" \
--baud 19200 \
--parity 'E' \
--data_bit 8 \
--stop_bit 1 \
--slave_ad 127 \
--timeout_sec 0 \
--timeout_usec 40000 \
--loops 1 \
--repTime 0 \
--setTerm false \
--inPlace false \
--recovery true \
--debug true

If you will get an error message like:

error while loading shared libraries: libmodbus.so.5: cannot open shared object file: No such file or directory

then you need to add the libmodbus library folder to the LD_LIBRARY_PATH, e.g.:

echo 'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/' >> ~/.bashrc

Command line options:

Long commandShort commandArgumentDescription
helphno
startsrequiredwhere to start reading (w/o offset)
lengthlrequiredhow many registers to read
deviceNamenrequirede.g. "/dev/ttyUSB0" or shorter "ttyUSB0"
baudbrequired[bps]
parityprequired'N', 'E' or 'O'
data_bitdrequirednumber of bits of data, the allowed values are 5, 6, 7 and 8
stop_bittrequiredbits of stop, the allowed values are 1 and 2
slave_adarequiredslave address
timeout_secerequiredtimeout to set in [sec]...
timeout_usecurequired...and the [μsec] part. At least 13000, better 20000 (20ms) or 40000
loopsorequiredhow many loops of reading. 0 = Inf
repTimerrequiredtime between loops [msec]
setTermmrequiredset termination register. False / 0 or off / 1 or on. Def = false
inPlaceirequiredin inifinite loop mode print registers in place or scroll the screen. Def = false
recoverycrequirederror recovery mode. Default = false
debuggrequireddebug mode. Default = false

About

Reading encoders for SRT: The Small Radio Telescope

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages