Building EPICS Device Support for HiDEOS
The EPICS device support for HiDEOS comes from the EPICS extension area.
To retrieve the programs use CVS and check out extensions/src/hideos. The
explanation of how to do this can be found in the EPICS source/release
document. This document should give a brief explanation of how to build
and use the programs in extensions/src/hidos.
Check Your Makefile
The first thing to do is to Check the Makefile.Vx to be sure that the TOP
variable is pointing to your hideos_vx directory.
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
Loadable Object Files
Three important files are created and installed in the extensions/bin/mv167
here.
- ldpp.o - This is the front end to vxWorks ld() for C++ modules.
- Hideos.o - This is the vxWorks version of HiDEOS.
- EpicsHideos.o - This is the EPICS device support code for HiDEOS.
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
ld < ldpp.o
# this is HiDEOS for vxWorks
ldpp < Hideos.o
# this is the EPICS device support for HiDEOS
ldpp < ../tmp/EpicsHideos.o
# load a program into the mvme162 card 1
# xfd_app is generally the one you want
bpLoad(1,"hideos/install/usrapps/bare162/xfd_app")
# start HiDEOS
hideos_main
# start epics
iocLogDisable=1
iocInit
Running hideos_main() start 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.
"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 ([email protected]) updated 4/12/95