simulation

# The is the ASYN example for communication to 4 simulated motors
# "#!" marks lines that can be uncommented.

< envPaths

dbLoadDatabase("$(TOP)/dbd/motorSim.dbd")
motorSim_registerRecordDeviceDriver(pdbbase)
dbLoadTemplate("motor.substitutions")

# Create simulated motors: ( start card , start axis , low limit, high
limit, home posn, # cards, # axes to setup)
motorSimCreate( 0, 0, -32000, 32000, 0, 1, 4 )
# Setup the Asyn layer (portname, low-level driver drvet name, card,
number of axes on card)
drvAsynMotorConfigure("motorSim1", "motorSim", 0, 4)
iocInit

I call it (from within the .../iocBoot/iocSim directory) as
../.../bin/linux-x86/motorSim st.cmd.unix

In the MotorExApp, you have to uncomment the lines adding the Simulation
Support in the Makefile:
WithAsyn_LIBS += motorSimSupport
WithAsynVx_LIBS += motorSimSupport

uncomment the Simulation Support in WithAsynInclude.dbd and
WithAsynVxInclude.dbd:
include "motorSimSupport.dbd"

In the top level Makefile I'm sure you already have uncommented
DIRS += motorExApp iocBoot
iocBoot_DEPEND_DIRS = motorExApp

posted @ 2012-04-07 00:53  greencolor  阅读(316)  评论(0编辑  收藏  举报