Difference between revisions of "HowToPC104"
RalphLange (talk | contribs) m |
|||
(4 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
'''''This is an internal note of my lab (INFN-LNL ITALY) showing results of my first experience with running EPICS on an embedded PC104 to control a Camac Crate Controller by Serial-over-Ethernet and a Rockwell Micrologix 1500 PLC by serial line | '''''This is an internal note of my lab (INFN-LNL ITALY) showing results of my first experience with running EPICS on an embedded PC104 to control a Camac Crate Controller by Serial-over-Ethernet and a Rockwell Micrologix 1500 PLC by serial line. Both Device Supports were written using Asyn in collaboration with Ralph Lange.''''' | ||
Line 65: | Line 65: | ||
(Don't forget to set EPICS_CA_ADDR_LIST to the PC104 IP address if you're on a different subnet.) | (Don't forget to set EPICS_CA_ADDR_LIST to the PC104 IP address if you're on a different subnet.) | ||
-- [mailto:[email protected] Mauro Giacchini (INFN-LNL)] | |||
-- [mailto:[email protected] Mauro Giacchini (INFN-LNL)] | |||
7:35, 13 Apr 2005 (CDT) | |||
''Credits: This document was derived from the original version done by Arne Freyberger (JLAB), sent to me by Stephen Wood (JLAB). Thanks a lot to both of you and to Ralph Lange (BESSY) and Glen Write (CLS) for additional help.'' | ''Credits: This document was derived from the original version done by Arne Freyberger (JLAB), sent to me by Stephen Wood (JLAB). Thanks a lot to both of you and to Ralph Lange (BESSY) and Glen Write (CLS) for additional help.'' |
Latest revision as of 06:22, 6 May 2005
This is an internal note of my lab (INFN-LNL ITALY) showing results of my first experience with running EPICS on an embedded PC104 to control a Camac Crate Controller by Serial-over-Ethernet and a Rockwell Micrologix 1500 PLC by serial line. Both Device Supports were written using Asyn in collaboration with Ralph Lange.
1 Building R3.14.7 Base on a Linux Box
- The following was performed on a workstation type Slackware 7.0 linux box (equipped with an old PentiumIII, 500Mhz, 512MB RAM). I ran into a sync problem on HD using the “BigSlack” distro, so I created the ISO image of version 7.0 and installed it using a CD-ROM.
- Download baseR3.14.7.tar.gz from http://www.aps.anl.gov/epics/base/R3-14/7.php
- Create a working directory: /usr/src/R3.14.7
- cd /usr/src/R3.14.7
- tar -zxvf baseR3.14.7.tar.gz
- cd base
- Edit configure/CONFIG_SITE, look for the following variables and change them to what is shown below:
- CROSS_COMPILER_TARGET_ARCHS=
- STATIC_BUILD=YES
- Edit startup/Site.cshrc or define EPICS_BASE in your shell:
- setenv EPICS_BASE /usr/src/R3.14.7/base
- Source startup/Site.cshrc (or restart your shell)
- Type ``make in /usr/src/R3.14.7/base and go brew a pot of coffee.
- Check for binaries in bin/linux-x86
2 Building the Example Application
- cd /home/giacchin/ (or wherever you want to build the example)
- mkdir testIOC
- cd testIOC
- $EPICS_BASE/bin/linux-x86/makeBaseApp.pl -i example
- $EPICS_BASE/bin/linux-x86/makeBaseApp.pl -i -t example example
- make
- cd ../iocBoot/iocexample
- Start your IOC with ../../exampleApp/src/O.linux-x86/example st.cmd
- List the existing records using dbl
At this point you will be in the “iocSh” (aka ioc shell). You can use the CA commandline tools from base to access your IOC through Channel Access: “caget yourHost:aiExample1” (in the same net or after you point EPICS_CA_ADDR_LIST to your linux box). The values of that example record should change between 0 and 9.
3 Migrating exampleApp Code to your PC104
Once you've established working binaries on your linux box, it's time to move them to the PC104 card. I try to mimic the directory structure of the linux host on the PC104 card, so that you do not have to modify anything. The IOC boot structure should be portable without any changes, though.
- Log onto the pc104
- Create /home/giacchin (or wherever you want to put stuff) and the directory structure:
- mkdir /home/giacchin; cd /home/giacchin/
- mkdir testIOC; cd testIOC
- mkdir bin dbd db iocBoot iocBoot/iocexample
- Back on the host: cd /home/giacchin/testIOC/iocBoot/iocexample
- ftp from your linux box to your pc104
- cd /home/giacchin/testIOC/iocBoot/iocexample; lcd <same directory>
- put st.cmd
- cd /home/giacchin/testIOC/db; lcd <same directory>
- put dbExample1.db dbExample2.db dbsubExample.db
- cd /home/giacchin/testIOC/dbd ; lcd <same directory>
- put example.dbd
- cd /home/giacchin/testIOC/bin/linux-x86
- put caRepeater example
I used the TMZ104 (a PC104 starter kit made by TRI-M ENGINEERING). The Linux environment of the starter kit isn't equipped with all the libs necessary to use the caRepeater, therefore I copied the libraries from my host PC (with Slackware7.0) to the PC104 into the same directory. The missing libs were:
- libpthread
- libstdc++-libc6.1
- libreadline.so
Now we are ready to start our application on the PC104
- Log onto the pc104 card
- cd /home/giacchin/testIOC/bin/limux-x86
- chmod +x caRepeater example
- cd /home/giacchin/testIOC/iocBoot/iocexample
- Start the caRepeater: ../../bin/linux-x86/caRepeater &
- Start the example: ../../bin/linux-x86/example st.cmd
At this point you can access your PC104 through Channel Access from your host or another unix machine with EPICS: camonitor giacchinHost:dbExample1
(Don't forget to set EPICS_CA_ADDR_LIST to the PC104 IP address if you're on a different subnet.)
-- Mauro Giacchini (INFN-LNL)
7:35, 13 Apr 2005 (CDT)
Credits: This document was derived from the original version done by Arne Freyberger (JLAB), sent to me by Stephen Wood (JLAB). Thanks a lot to both of you and to Ralph Lange (BESSY) and Glen Write (CLS) for additional help.