Building EPICS Device Support for HiDEOS
You must get the EPICS device support sources files for HiDEOS from
the HiDEOS home page ( hit EPICS HiDEOS device support source).
Untar the file into your getrel tree or application developers tree. An
easy way to do this is to create a hideos directory and untar it there.
Example getrel tree and some of the files you will expect and a build:
epics3.12.2/
genericApp/
otherApp/
hideos/
Makefile
Makefile.Vx
Makefile.hideos
devHideos.cc
devHideos.h
devSiHideos.cc
devSoHideos.cc
devSoiHideos.cc
string_test.cc
other_files_too.cc
O.mv167/
Hideos.o
EpicsHideos.o
ldpp.o
devHideos.o
devSoHideos.o
devSiHideos.o
devSoiHideos.o
string_test.o
base/
config/
include/
cat_ascii/
replace_ascii/
ioc/
testioc/
st.cmdmv167
Instructions to Setup and Build Device Support
The first thing to do is to Check the Makefile.hideos to be sure that the TOP
variable is pointing to your hideos build tree.
Check the Makefile.Vx and make sure that the EPICS variable points to the
top of your getrel tree. Remember that it is from the O.mv167 directory,
so if you are specifing a relative path name, be careful. In the above
example, set "EPICS=../.." in Makefile.Vx.
Now type gnumake.
Some of the Original Distributed Source Files
- devAiTest.cc - example HiDEOS/EPICS device support (with comments)
- devAiADC.cc - GreenSpring IP-PrecisionADC ADC support for AI record
- devAoDAC.cc - SysTran DAC128V support for AO record
- devAiLove.cc - Love controller PV read into AI records
- devSiTest.cc - example of string in processing using serial IPacks
- devSoTest.cc - example of string out processing using serial IPacks
- devSoiTest.cc - example of string transaction using serial IPacks
- histo_test.cc - example of a vxWork task working with a HiDEOS task
- string_test.cc - a vxWorks task to test the HiDEOS serial IPacks
What the Build Created that You Need
Three important files are built in the O.mv167 directory that must be
loaded correctly in your vxWorks start up script.
- ldpp.o - This is the front end to vxWorks ld() for C++ modules. Use
ldpp() instead of ld() to load all HiDEOS related object files that run
under vxWorks.
- Hideos.o - This is the vxWorks version of HiDEOS. This file really
contains a whole bunch of object files which come from the main HiDEOS
build tree.
- EpicsHideos.o - This is the EPICS device support code for HiDEOS.
This is all the object files created from compiling the source files in
epics_hideos.tar.gz.
Everything in the HiDEOS-EPICS device support directory should be rebuild
when a you go to a new release of EPICS or HiDEOS. The source files are
dependant on both HiDEOS and EPICS versions.
vxWorks Startup Script Changes (st.cmdmv167)
Your vxWorks startup script file should look similar to the following listing.
The additions here are loading the c++ front end, the vxWorks HiDEOS version,
and the EPICS device support for HiDEOS. Remember, this is only a stripped
down version of a startup script to be used as an example of how to load
and start HiDEOS, a real startup script would have much more stuff in it.
# epics code - same as
ld < targetmv167/iocCore
ld < targetmv167/drvSup
ld < targetmv167/devSup
ld < targetmv167/recSup
# epics databases
dbLoad "default.dctsdr"
dbLoadRecords "something.db"
# this is c++ loader and new operator and global constructor stuff
# use ldpp() instead of ld() to load HiDEOS object files
ld < ../../hideos/O.mv167/ldpp.o
# this is HiDEOS for vxWorks - constructed from your HiDEOS build tree
ldpp < ../../hideos/O.mv167/Hideos.o
# this is the EPICS device support for HiDEOS
# dependant on an EPICS version and HiDEOS version
ldpp < ../../hideos/O.mv167/EpicsHideos.o
# load a program into the mvme162 card 1
# xfd_app is generally the one you want
# Comes from your HiDEOS build tree. This is the fully resolved
# executable that starts executing on your 162 processor
bpLoad(1,"/install/usrapps/bare162/xfd_app")
# start HiDEOS running on this vxWorks processor
hideos_main
# if you will be using the HiDEOS GPIB support, configure the GPIB
# driver here. Uncomment the one that corresponds to the slot you have
# the GPIB IP module installed.
# HiDEOSGpibLinkConfig(link,HiDEOS card number,"HiDEOS GPIB task name")
# HiDEOSGpibLinkConfig(13,1,"a-ip488")
# HiDEOSGpibLinkConfig(13,1,"b-ip488")
# HiDEOSGpibLinkConfig(13,1,"c-ip488")
# HiDEOSGpibLinkConfig(13,1,"d-ip488")
# start epics
iocLogDisable=1
iocInit
Running hideos_main() starts hideos running, you want to do this before
iocInit(). Running bpLoad() downloads the HiDEOS MVME162 executable and
starts it running.
cat_ascii/devSup.ascii Changes
Here are examples of devSup.ascii lines for each of the device support in
this directory. Be sure to run "makesdr" after making the changes.
It will not be necessary to add all of them, only the ones you will use.
You must add one entry for each HiDEOS/EPICS device support module you
want to use.
"ai" VME_IO "devHideosAi" "Hideos aiTest"
"ai" VME_IO "devHideosADC" "Hideos PrecisionADC"
"ai" VME_IO "devHideosDAC" "Hideos SysTran DAC128V"
"ai" VME_IO "devAiLove" "Hideos Love"
"stringin" VME_IO "devSiHideos" "Hideos si Test"
"stringin" VME_IO "devSiHideos" "Hideos soi Test"
"stringout" VME_IO "devSoHideos" "Hideos so Test"
Creating databases With the Support Routines
As seen above, all the HiDEOS devices appear as VME links. The first string
in the parm field must be the name of the HiDEOS task you wish to connect
with. The card field must be the card which contains the HiDEOS task. Card
0 in the first processor in the crate, probably the one running EPICS/vxWorks.
If you use card 0, HiDEOS will attempt to communicate with a task on the
local CPU (just a note).
Industry packs present on the mvme162 on automatically configured and given
names. These names are the ones used in the parm field of the link. The
industry pack names are always prefixed by a letter (a,b,c,d) indicating the
slot in which they reside.
Industry pack reserved names (the beginning x is the slot letter a,b,c,d):
- x-Serial - The GreenSpring Dual serial, 2 serial ports
- x-Serial - The GreenSpring quad serial device, 4 serial ports
- x-Serial - The GreenSpring octal serial device, 8 serial ports
- x-ip488 - The GreenSpring GPIB controller
- x-ADC - The 16 channel GreenSpring IP-PrecisionADC
- x-DAC - The 8 channel SysTran DAC128V
Using the Serial Devices
The serial devices require a subscript to identify which port to connect with.
Subscripts are specified like c arrays, so placing a-Serial[1] in the parm
field will connect you with the second serial port of the dual serial in
slot 'a' of the IP bus.
Using the SysTran DAC128V
This is an 8 channel 12 bit DAC. The signal field of the AO record selects
the channel. The valid range for channel is [1,8]. In the simple mode,
where an AO record is created with all default values, the valid range
for the VAL field is an integer value [-2048,2048). See the SysTran user
manual for more information. The number placed in the VAL field will be
mapped directly into the output register on the DAC.
- parm field format: "x-DAC"
Using the GreenSpring IP-PrecisionADC
The ADC requires additional configuration information to be placed in the
parm field. Be careful if you are going to mix single-ended/differtial
channels. This module will be updated soon to use a voltage range to
automatically select the gain.
- parm field format: "x-ADC,[SD],yy,zz"
- where S=single-ended,D=differential,yy=channel,zz=gain
- yy is an element of [1,16] for single ended channels
- yy is an element of [1,8] for differential channels
- zz = 001,005,050,500
- Gain Info:
- 001) -5 to 5 V, 15us settling time
- 005) -1 to 1 V, 15us settling time
- 50) -100 to 100 mV, 35us settling time
- 500) -10 to 10 mV, 200us settling time (see reference material)
Using the Love controllers
The current support only does process variable/status reads. You must download
the HiDEOS executable containing the love support. The love support on the
mvme162 attempt to connect to the dual serial port 0. A HiDEOS task is
started for you to communicate with called love. The string "love" must be
placed first in the parm field as explained above. The format for the parm
field is as follows:
- love,{address}
- Where {address} is a number expressed in hex notation which is the
address of the love controller you which to communicate with.
- Example: love,0x32
- Set up communication link with love controller node 0x32 on the RS485 bus.
Be sure to set signal to zero.
Configuring Serial Ports
Run the following command from the vxWorks shell or startup script.
ConfigureHideosSerialPort(char* device,int card,int baud,char parity,
int bits_per_character,int stop_bits,char flow_control)
- device is the Hideos serial port name(same as parm field),
such as "a-Serial[0]" or "d-Serial[2]".
- card is the MVME162 card where the device exists (usually 1).
- baud is the baud rate.
- parity is 'E' for even, 'O' for odd, 'N' for none.
- bits_per_character = {5,6,7,8}
- stop_bits = {1,2}
- flow_control is 'N' for none, 'H' for hardware (don't use
hardware flow control unless your device supports it).
Starting Love Tasks and Fanuc Tasks
Run the following command from the vxWorks shell or startup script.
ConfigureFanucTask(new_task_name, card, name_of_serial_port_to_connect_to)
ConfigureLoveTask(new_task_name, card, name_of_serial_port_to_connect_to)
Example for starting love task on serial port 3 of octal serial in slot b:
ConfigureLoveTask("love_port3",1,"b-Serial[2]")
Card 1 refers to the first HiDEOS slave board.
Argonne National Laboratory
Copyright
Information
Jim Kowalkowski (jbk@aps.anl.gov) updated 5/10/96