| gclib 329 Communications API for Galil controllers and PLCs |

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