gclib  307
Communications API for Galil controllers and PLCs
 All Data Structures Files Functions Variables Typedefs Macros Pages
redhat.md
1 # Red Hat & CentOS Linux {#redhat}
2 
3 ##Tested versions
4 
5 See the \link installation \endlink page for supported versions.
6 
7 ##Installation
8 On Red Hat, gclib is distributed in an RPM repository. The following steps can be performed to install gclib.
9 
10 ### Download Galil's repository information
11 
12 This step installs Galil's RPM repositories and only needs to be done once.
13 
14 \attention
15 * **Red Hat 7 and CentOS 7**
16  * Point a browser at http://www.galil.com/sw/pub/rhel/7/galilrpm-2-1.noarch.rpm and install the rpm.
17 
18 * **Red Hat 6 and CentOS 6**
19  * Point a browser at http://www.galil.com/sw/pub/rhel/6/galilrpm-2-1.noarch.rpm and install the rpm.
20 
21 <!--- $ sudo wget http://www.galil.com/sw/pub/rhel/galil.repo -O /etc/yum.repos.d/galil.repo -->
22 
23 ### Install Package
24 Install gclib package, approve "Installed size" and "Importing GPG key", if prompted.
25 
26  $ sudo yum install gclib
27 
28 ### Uninstall Package
29 To uninstall gclib.
30 
31  $ sudo yum remove gclib
32 
33 ##Installed files
34 * The gclib shared object files
35  * /usr/lib/libgclibo.so
36  * /usr/lib/libgclib.so
37 * The gclib header files
38  * /usr/include/gclib_errors.h
39  * /usr/include/gclibo.h
40  * /usr/include/gclib.h
41  * /usr/include/gclib_record.h
42 * gclib documentation tarball
43  * /usr/share/doc/gclib/gclib_129_doc.tar.gz
44 * Example source tarball
45  * /usr/share/doc/gclib/src/gclib_129_examples.tar.gz
46 * Source files to modify/rebuild libgclibo.so
47  * /usr/share/doc/gclib/src/gclibo_129_src.tar.gz
48 * GalilTools Communication Library (gcl) wrapper
49  * /usr/share/doc/gclib/src/gclib_129_gcl.tar.gz
50 * PCI driver files
51  * /usr/share/doc/gclib/src/gclib_129_pci.tar.gz
52 
53 ##Serial Ports and USB
54 If access to the serial ports or USB (e.g. DMC-4103) is desired through gclib, the following will provide steps to join the correct access group. If using USB, be sure the controller is powered and the usb is plugged in before beginning.
55 
56 ###Determine group with access
57 
58  $ ls -l /dev/ttyUSB* /dev/ttyS*
59  crw-rw----. 1 root dialout 4, 64 Mar 3 16:39 /dev/ttyS0
60  crw-rw----. 1 root dialout 4, 65 Mar 3 16:39 /dev/ttyS1
61  crw-rw----. 1 root dialout 4, 66 Mar 3 16:39 /dev/ttyS2
62  crw-rw----. 1 root dialout 4, 67 Mar 3 16:39 /dev/ttyS3
63  crw-rw----. 1 root dialout 188, 0 Mar 6 11:08 /dev/ttyUSB0
64 
65 In the above listing, **dialout** is the group that needs to be joined. **uucp** is another common group that may be listed.
66 
67 ###Add the desired *username* to the group.
68 
69  $ sudo gpasswd -a username dialout
70  [sudo] password for username:
71  Adding user username to group dialout
72 
73 Log out and back in for change to take effect.
74 
75  $ groups
76  username wheel dialout
77 
78 gclib can now connect to serial and usb devices from user *username*.
79 
80 ##PCI Controllers
81 If using a Galil PCI controller, the PCI driver must be installed.
82 
83 ###Install prerequisites
84 
85  $ sudo yum install kernel-devel-$(uname -r)
86  $ sudo yum install kernel-headers-$(uname -r)
87  $ sudo yum install gcc
88 
89 ###Extract source and build driver
90 
91  $ tar -xf /usr/share/doc/gclib/src/gclib_202_pci.tar.gz
92  $ make
93 
94 ###Copy module and add to kernel
95 
96  $ sudo cp galilpci.ko /lib/modules/$(uname -r)
97  $ sudo depmod
98  $ sudo modprobe galilpci
99 
100 ###Add galil group for access to PCI
101 
102  $ sudo groupadd -f -K GID_MIN=100 -K GID_MAX=499 galil
103  $ sudo cp 90-galilpci.rules /etc/udev/rules.d/
104  $ sudo udevadm control --reload-rules
105  $ sudo udevadm trigger
106  $ sudo usermod -a -G galil username #exchange "username" with actual user's name
107 
108 Logout and back in. The PCI hardware is now available for access.
109 
110  $ ls -l /dev/galil*
111  crw-rw---- 1 root galil 10, 56 Jun 9 11:07 /dev/galilpci0
112  $ echo -e "\x12\x16\r" > /dev/galilpci0
113  $ cat /dev/galilpci0
114  DMC1846 Rev 1.1a
115  :
116 
117 ##Documentation
118 The documentation is left as a tarball to minimize disk usage. The latest release version of the user manual is available at the following link.
119 * http://www.galil.com/sw/pub/all/doc/gclib/html/
120 
121 ###Offline html
122 The following allows viewing of the html docs from the installation.
123 
124  $ tar -xzf /usr/share/doc/gclib/gclib_132_doc.tar.gz html
125  $ firefox html/index.html
126 
127 ###Offline pdf
128 There may be a pdf shipped in the package. The following allows viewing of the pdf docs from the installation.
129 
130  $ tar -xzf /usr/share/doc/gclib/gclib_132_doc.tar.gz gclib_132.pdf
131  $ evince gclib_132.pdf
132 
133