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