EPICS Home

Experimental Physics and Industrial Control System


 
1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <2025 Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <2025
<== Date ==> <== Thread ==>

Subject: RE: Galil Motor Controller (DMC-4183) EPICS Module Setup
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: Jonathan Hai <haic at mcmaster.ca>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Thu, 13 Mar 2025 20:52:31 +0000

Hi Jonathon,

 

You are getting errors like this:

 

dbLoadTemplate("/home/jonathanhai/support/Galil/GalilTestApp/Db/DMC01_motors-v6-10up.substitutions", "P=DMC01:, PORT=DMC01")

macLib: macro GALIL is undefined (expanding string $(GALIL)/GalilSup/Db/galil_motor-v6-10up.template)

filename="../dbStatic/dbLexRoutines.c" line number=277 dbRead opening file (null)

ERROR failed to load '$(GALIL)/GalilSup/Db/galil_motor-v6-10up.template'

 

The problem is that GALIL is not defined in any configure/RELEASE* file.  I suggest you create the file home/jonathanhai/support/Galil/configure/RELEASE.local.

 

This is what mine contains.  You will need to edit for your site.

 

SUPPORT=/corvette/home/epics/devel

EPICS_BASE=/corvette/usr/local/epics-devel/base-7.0.9

AUTOSAVE=$(SUPPORT)/autosave-5-11

SNCSEQ=$(SUPPORT)/seq-2-2-9

SSCAN=$(SUPPORT)/sscan-2-11-5

CALC=$(SUPPORT)/calc-3-7-4

ASYN=$(SUPPORT)/asyn-4-45

BUSY=$(SUPPORT)/busy-1-7-3

MOTOR=$(SUPPORT)/motor-7-2-2

GALIL=$(SUPPORT)/Galil-4-0-2

IPAC=$(SUPPORT)/ipac-2-16

-include $(TOP)/../../RELEASE.local

-include $(TOP)/../../RELEASE.$(EPICS_HOST_ARCH).local

 

The last 2 lines I use to enable building Windows and Linux in the same tree.  You probably don’t need them.

 

Mark

 

 

From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Jonathan Hai via Tech-talk
Sent: Thursday, March 13, 2025 1:51 PM
To: tech-talk at aps.anl.gov
Subject: Galil Motor Controller (DMC-4183) EPICS Module Setup

 

Hi Folks,

 

First of all thanks to everyone else who's helped me with my issues so far. The Galil module has built successfully! However, now I'm having trouble getting the Galil IOC up and running. I'm trying the iocGalilTest's st.cmd, and DMC01Configure.cmd (included here.) But I'm running into issues. I've made a log of it, please excuse some of the mistakes in it. Sloppy fingers. Could anyone point me in the right direction? I'd like to be able to read and write PVs and have the motor attached to the Galil DMC axis respond accordingly.

 

Thanks for all your help people.

 

---

st.cmd:

```

#!../../bin/linux-x86_64/GalilTest

 

< envPaths

 

cd ${TOP}

 

## Register all support components

dbLoadDatabase("dbd/GalilTest.dbd",0,0)

GalilTest_registerRecordDeviceDriver(pdbbase)

 

cd ${TOP}/iocBoot/${IOC}

 

##################################################################################################

# Configuration settings

 

# IOC record prefix used for sscan/saveData databases and autosave setup

epicsEnvSet("IOCPREFIX", "DMC4183:")

 

# Configure an example DMC (digital motor controller)

< DMC01Configure.cmd

 

# Configure an example RIO (Remote IO PLC controller)

# < RIO01Configure.cmd

 

epicsEnvSet("GALIL", "/home/jonathanhai/support/Galil")

 

##################################################################################################

 

### Scan-support software

# crate-resident scan. This executes 1D, 2D, 3D, and 4D scans, and caches

# 1D data, but it doesn't store anything to disk. (See 'saveData' below for that.)

dbLoadRecords("$(SSCAN)/sscanApp/Db/standardScans.db","P=$(IOCPREFIX),MAXPTS1=8000,MAXPTS2=1000,MAXPTS3=10,MAXPTS4=10,MAXPTSH=8000")

dbLoadRecords("$(SSCAN)/sscanApp/Db/saveData.db","P=$(IOCPREFIX)")

 

##################################################################################################

 

< autosave.cmd

 

# Start the IOC

iocInit()

 

# Initialize saveData for step scans

saveData_Init("saveData.req", "P=$(IOCPREFIX)")

 

##################################################################################################

# Configuration settings

 

# Create DMC autosave monitor sets

< DMC01CreateMonitorSet.cmd

 

# Create RIO autosave monitor sets

< RIO01CreateMonitorSet.cmd

 

##################################################################################################

 

# end

```

 

---

DMC01Configure.cmd:

```

# Configure an example DMC (digital motor controller)

 

##################################################################################################

# Configuration settings

# Configure these settings for site

 

## uncomment to see every command sent to galil

#epicsEnvSet("GALIL_DEBUG_FILE", "galil_debug.txt")

 

# Asyn port name (eg. DMC01, DMC02, RIO01)

epicsEnvSet("PORT", "DMC01")

 

# Controller address (IP address, serial port)

epicsEnvSet("ADDRESS", "192.168.0.195")

 

# Controller update period Unit = millisecond

# Range 2-200

epicsEnvSet("UPDPERIOD", "8")

 

##################################################################################################

# Derived configuration settings

 

# Record prefix derived from asyn port name

epicsEnvSet("P", "$(PORT):")

 

##################################################################################################

 

#Load motor records for real and coordinate system (CS) motors

#Motor record version 6-9 and below

# dbLoadTemplate("$(TOP)/GalilTestApp/Db/$(PORT)_motors-v6-9down.substitutions", "P=$(P), PORT=$(PORT)")

#Motor record version 6-10 and up

dbLoadTemplate("$(TOP)/GalilTestApp/Db/$(PORT)_motors-v6-10up.substitutions", "P=$(P), PORT=$(PORT)")

 

#Load DMC controller features (eg. Limit switch type, home switch type, output compare, message consoles)

dbLoadTemplate("$(TOP)/GalilTestApp/Db/galil_dmc_ctrl.substitutions", "P=$(P), PORT=$(PORT)")

 

#Load extra features for real axis/motors (eg. Motor type, encoder type)

dbLoadTemplate("$(TOP)/GalilTestApp/Db/$(PORT)_motor_extras.substitutions", "P=$(P), PORT=$(PORT)")

 

#Load extra features for CS axis/motors (eg. Setpoint monitor)

dbLoadTemplate("$(TOP)/GalilTestApp/Db/galil_csmotor_extras.substitutions", "P=$(P), PORT=$(PORT)")

 

#Load kinematics for CS axis/motors (eg. Forward and reverse kinematics, kinematic variables)

dbLoadTemplate("$(TOP)/GalilTestApp/Db/galil_csmotor_kinematics.substitutions", "P=$(P), PORT=$(PORT)")

 

#Load coordinate system features (eg. Coordinate system S and T status, motor list, segments processed, moving status)

dbLoadTemplate("$(TOP)/GalilTestApp/Db/galil_coordinate_systems.substitutions", "P=$(P), PORT=$(PORT)")

 

#Load digital IO databases

dbLoadTemplate("$(TOP)/GalilTestApp/Db/galil_dmc_digital_ports.substitutions", "P=$(P), PORT=$(PORT)")

 

#Load analog IO databases

dbLoadTemplate("$(TOP)/GalilTestApp/Db/galil_dmc_analog_ports.substitutions", "P=$(P), PORT=$(PORT)")

 

#Load user defined functions

dbLoadTemplate("$(TOP)/GalilTestApp/Db/galil_userdef_records.substitutions", "P=$(P), PORT=$(PORT)")

 

#Load user defined array support

dbLoadTemplate("$(TOP)/GalilTestApp/Db/galil_user_array.substitutions", "P=$(P), PORT=$(PORT)")

 

#Load profiles

dbLoadTemplate("$(TOP)/GalilTestApp/Db/$(PORT)_profileMoveController.substitutions", "P=$(P), PORT=$(PORT)")

dbLoadTemplate("$(TOP)/GalilTestApp/Db/$(PORT)_profileMoveAxis.substitutions", "P=$(P), PORT=$(PORT)")

 

# GalilCreateController command parameters are:

#

# 1. Const char *portName - The name of the asyn port that will be created for this controller

# 2. Const char *address - The address of the controller

# 3. double updatePeriod - The time in ms between datarecords 2ms min, 200ms max. Async if controller + bus supports it, otherwise is polled/synchronous.

# - Recommend 50ms or less for ethernet

# - Specify negative updatePeriod < 0 to force synchronous tcp poll period. Otherwise will try async udp mode first

 

# Create a Galil controller

GalilCreateController("$(PORT)", "$(ADDRESS)", "$(UPDPERIOD)")

 

# GalilCreateAxis command parameters are:

#

# 1. char *portName Asyn port for controller

# 2. char axis A-H,

# 3. char *Motor interlock digital port number 1 to 8 eg. "1,2,4". 1st 8 bits are supported

# 4. int Interlock switch type 0 active when opto active, all other values switch type active when opto inactive

 

# Create the axis

# GalilCreateAxis("$(PORT)","A","",1)

# GalilCreateAxis("$(PORT)","B","",1)

# GalilCreateAxis("$(PORT)","C","",1)

# GalilCreateAxis("$(PORT)","D","",1)

# GalilCreateAxis("$(PORT)","E","",1)

# GalilCreateAxis("$(PORT)","F","",1)

GalilCreateAxis("$(PORT)","G","",1)

# GalilCreateAxis("$(PORT)","H","",1)

 

# GalilAddCode command parameters are:

# Add custom code to generated code

# 1. char *portName Asyn port for controller

# 2. int section = code section to add custom code into 0 = card code, 1 = thread code, 2 = limits code, 3 = digital code

# 3. char *code_file custom code file

# GalilAddCode("$(PORT)", 1, "customcode.dmc")

 

# GalilReplaceHomeCode command parameters are:

# Replace generated axis home code with custom code

# 1. char *portName Asyn port for controller

# 2. char *Axis A-H

# 3. char *code_file custom code file

# GalilReplaceHomeCode("$(PORT)", "A", "homeA.dmc")

 

# GalilCreateCSAxes command parameters are:

#

# 1. char *portName Asyn port for controller

 

#Create all CS axes (ie. I-P axis)

GalilCreateCSAxes("$(PORT)")

 

# GalilStartController command parameters are:

#

# 1. char *portName Asyn port for controller

# 2. char *code file(s) to deliver to the controller we are starting. "" = use generated code (recommended)

# Specify a single file or to use templates use: headerfile;bodyfile1!bodyfile2!bodyfileN;footerfile

# 3. int Burn program to EEPROM conditions

# 0 = transfer code if differs from eeprom, dont burn code to eeprom, then finally execute code thread 0

# 1 = transfer code if differs from eeprom, burn code to eeprom, then finally execute code thread 0

# It is asssumed thread 0 starts all other required threads

# 4. int Thread mask. Check these threads are running after controller code start. Bit 0 = thread 0 and so on

# if thread mask < 0 nothing is checked

# if thread mask = 0 and GalilCreateAxis appears > 0 then threads 0 to number of GalilCreateAxis is checked (good when using the generated code)

 

# Start the controller

GalilStartController("$(PORT)", "", 1, 0)

 

# Start the controller

# Example using homing routine template assembly

#GalilStartController("$(PORT)", "$(GALIL)/GalilSup/Db/galil_Default_Header.dmc;$(GALIL)/GalilSup/Db/galil_Home_RevLimit.dmc!$(GALIL)/GalilSup/Db/galil_Home_ForwLimit.dmc!$(GALIL)/GalilSup/Db/galil_Home_Home.dmc!$(GALIL)/GalilSup/Db/galil_Home_ForwLimit.dmc!$(GALIL)/GalilSup/Db/galil_Piezo_Home.dmc!$(GALIL)/GalilSup/Db/galil_Piezo_Home.dmc!$(GALIL)/GalilSup/Db/galil_Piezo_Home.dmc!$(GALIL)/GalilSup/Db/galil_Piezo_Home.dmc;$(GALIL)/GalilSup/Db/galil_Default_Footer.dmc", 0, 0, 3)

 

# GalilCreateProfile command parameters are:

#

# 1. char *portName Asyn port for controller

# 2. Int maxPoints in trajectory

 

# Create trajectory profiles

GalilCreateProfile("$(PORT)", 2000)

 

# DMC autosave restore configuration

# restore settings in pass 0 so encoder ratio is set correctly for position restore in device support init

set_pass0_restoreFile("GalilTest_$(PORT)Settings.sav")

# restore positions in pass 0 so motors don't move

set_pass0_restoreFile("GalilTest_$(PORT)Positions.sav")

# restore kinematic equation character arrays in pass 1

set_pass1_restoreFile("GalilTest_$(PORT)Kinematics.sav")

```

---

log:

jonathanhai@FRIDAY:~/support/Galil/iocBoot/iocGalilTest$ ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 scope host lo

       valid_lft forever preferred_lft forever

    inet6 ::1/128 scope host noprefixroute 

       valid_lft forever preferred_lft forever

2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000

    link/ether f8:75:a4:68:1e:41 brd ff:ff:ff:ff:ff:ff

    inet 192.169.0.100/24 brd 192.169.0.255 scope global noprefixroute enp0s31f6

       valid_lft forever preferred_lft forever

    inet6 fe80::f23e:b6f2:d2ab:8cbd/64 scope link noprefixroute 

       valid_lft forever preferred_lft forever

3: wlp0s20f3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000

    link/ether 98:af:65:56:f6:7b brd ff:ff:ff:ff:ff:ff

    inet 172.17.175.144/21 brd 172.17.175.255 scope global dynamic noprefixroute wlp0s20f3

       valid_lft 1714sec preferred_lft 1714sec

    inet6 fe80::3806:962a:1376:2316/64 scope link noprefixroute 

       valid_lft forever preferred_lft forever

jonathanhai@FRIDAY:~/support/Galil/iocBoot/iocGalilTest$ sudo ip addr add 192.168.0.69/24 dev enp0s31f6

[sudo] password for jonathanhai: 

jonathanhai@FRIDAY:~/support/Galil/iocBoot/iocGalilTest$ ip a | grep enp0s31f6 -A 3

2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000

    link/ether f8:75:a4:68:1e:41 brd ff:ff:ff:ff:ff:ff

    inet 192.169.0.100/24 brd 192.169.0.255 scope global noprefixroute enp0s31f6

       valid_lft forever preferred_lft forever

    inet 192.168.0.69/24 scope global enp0s31f6

       valid_lft forever preferred_lft forever

    inet6 fe80::f23e:b6f2:d2ab:8cbd/64 scope link noprefixroute 

       valid_lft forever preferred_lft forever

jonathanhai@FRIDAY:~/support/Galil/iocBoot/iocGalilTest$ sudo arp-scan --localnet | grep "00:50:4C"

jonathanhai@FRIDAY:~/support/Galil/iocBoot/iocGalilTest$ ping 192.168.0.195

PING 192.168.0.195 (192.168.0.195) 56(84) bytes of data.

64 bytes from 192.168.0.195: icmp_seq=1 ttl=64 time=0.700 ms

64 bytes from 192.168.0.195: icmp_seq=2 ttl=64 time=0.505 ms

64 bytes from 192.168.0.195: icmp_seq=3 ttl=64 time=0.527 ms

64 bytes from 192.168.0.195: icmp_seq=4 ttl=64 time=0.354 ms

^C

--- 192.168.0.195 ping statistics ---

4 packets transmitted, 4 received, 0% packet loss, time 3081ms

rtt min/avg/max/mdev = 0.354/0.521/0.700/0.122 ms

jonathanhai@FRIDAY:~/support/Galil/iocBoot/iocGalilTest$ telnet 192.168.0.99 23

Trying 192.168.0.99...

^C

jonathanhai@FRIDAY:~/support/Galil/iocBoot/iocGalilTest$ telnet 192.168.0.195 23Trying 192.168.0.195...

Connected to 192.168.0.195.

Escape character is '^]'.

^]

telnet> ^Z

[1]+  Stopped                 telnet 192.168.0.195 23

jonathanhai@FRIDAY:~/support/Galil/iocBoot/iocGalilTest$ ./st.cmd

#!../../bin/linux-x86_64/GalilTest

< envPaths

epicsEnvSet("IOC","iocGalilTest")

epicsEnvSet("TOP","/home/jonathanhai/support/Galil")

epicsEnvSet("EPICS_BASE","/home/jonathanhai/epics-base")

epicsEnvSet("SUPPORT","/home/jonathanhai/support")

epicsEnvSet("ASYN","/home/jonathanhai/support/asyn-R4-45")

epicsEnvSet("CALC","/home/jonathanhai/support/calc")

epicsEnvSet("MOTOR","/home/jonathanhai/support/motor")

epicsEnvSet("SSCAN","/home/jonathanhai/support/sscan")

epicsEnvSet("AUTOSAVE","/home/jonathanhai/support/autosave")

epicsEnvSet("BUSY","/home/jonathanhai/support/busy")

cd /home/jonathanhai/support/Galil

## Register all support components

dbLoadDatabase("dbd/GalilTest.dbd",0,0)

GalilTest_registerRecordDeviceDriver(pdbbase)

cd /home/jonathanhai/support/Galil/iocBoot/iocGalilTest

##################################################################################################

# Configuration settings

# IOC record prefix used for sscan/saveData databases and autosave setup

epicsEnvSet("IOCPREFIX", "DMC4183:")

# Configure an example DMC (digital motor controller)

< DMC01Configure.cmd

# Configure an example DMC (digital motor controller)

##################################################################################################

# Configuration settings

# Configure these settings for site

## uncomment to see every command sent to galil

#epicsEnvSet("GALIL_DEBUG_FILE", "galil_debug.txt")

# Asyn port name (eg. DMC01, DMC02, RIO01)

epicsEnvSet("PORT", "DMC01")

# Controller address (IP address, serial port)

epicsEnvSet("ADDRESS", "192.168.0.195")

# Controller update period Unit = millisecond

# Range 2-200

epicsEnvSet("UPDPERIOD", "8")

##################################################################################################

# Derived configuration settings

# Record prefix derived from asyn port name

epicsEnvSet("P", "DMC01:")

##################################################################################################

#Load motor records for real and coordinate system (CS) motors

#Motor record version 6-9 and below

# dbLoadTemplate("$(TOP)/GalilTestApp/Db/$(PORT)_motors-v6-9down.substitutions", "P=$(P), PORT=$(PORT)")

#Motor record version 6-10 and up

dbLoadTemplate("/home/jonathanhai/support/Galil/GalilTestApp/Db/DMC01_motors-v6-10up.substitutions", "P=DMC01:, PORT=DMC01")

macLib: macro GALIL is undefined (expanding string $(GALIL)/GalilSup/Db/galil_motor-v6-10up.template)

filename="../dbStatic/dbLexRoutines.c" line number=277 dbRead opening file (null)

ERROR failed to load '$(GALIL)/GalilSup/Db/galil_motor-v6-10up.template'

dbLoadRecords("$(GALIL)/GalilSup/Db/galil_motor-v6-10up.template", P=DMC01:, PORT=DMC01,M="A",ADDR=0,EGU=mm,DESC="",VELO=20,VMAX=20,ACCL=1,BDST=0,BVEL=0,BACC=5,MRES=.0025,SREV=1000,ERES=0.001,PREC=5,DHLM=42273.3,DLLM=-42273.3,OFF=0,UEIP=0,RTRY=0,NTM="YES",PCOF=0,ICOF=0,DCOF=0)

Substitution file error: Error while reading included file

line 34: '}'

#Load DMC controller features (eg.  Limit switch type, home switch type, output compare, message consoles)

dbLoadTemplate("/home/jonathanhai/support/Galil/GalilTestApp/Db/galil_dmc_ctrl.substitutions", "P=DMC01:, PORT=DMC01")

macLib: macro GALIL is undefined (expanding string $(GALIL)/GalilSup/Db/galil_dmc_ctrl.template)

filename="../dbStatic/dbLexRoutines.c" line number=277 dbRead opening file (null)

ERROR failed to load '$(GALIL)/GalilSup/Db/galil_dmc_ctrl.template'

dbLoadRecords("$(GALIL)/GalilSup/Db/galil_dmc_ctrl.template", P=DMC01:, PORT=DMC01,SCAN="Passive",DEFAULT_HOMETYPE=1,DEFAULT_LIMITTYPE=1,PREC=5)

Substitution file error: Error while reading included file

line 38: '}'

#Load extra features for real axis/motors (eg. Motor type, encoder type)

dbLoadTemplate("/home/jonathanhai/support/Galil/GalilTestApp/Db/DMC01_motor_extras.substitutions", "P=DMC01:, PORT=DMC01")

macLib: macro GALIL is undefined (expanding string $(GALIL)/GalilSup/Db/galil_motor_extras.template)

filename="../dbStatic/dbLexRoutines.c" line number=277 dbRead opening file (null)

ERROR failed to load '$(GALIL)/GalilSup/Db/galil_motor_extras.template'

dbLoadRecords("$(GALIL)/GalilSup/Db/galil_motor_extras.template", P=DMC01:, PORT=DMC01,M="A",ADDR=0,PREC=3,SCAN="Passive",MTRTYPE="3",MTRON="0",EGU="mm")

Substitution file error: Error while reading included file

line 48: '}'

#Load extra features for CS axis/motors (eg. Setpoint monitor)

dbLoadTemplate("/home/jonathanhai/support/Galil/GalilTestApp/Db/galil_csmotor_extras.substitutions", "P=DMC01:, PORT=DMC01")

macLib: macro GALIL is undefined (expanding string $(GALIL)/GalilSup/Db/galil_csmotor_extras.template)

filename="../dbStatic/dbLexRoutines.c" line number=277 dbRead opening file (null)

ERROR failed to load '$(GALIL)/GalilSup/Db/galil_csmotor_extras.template'

dbLoadRecords("$(GALIL)/GalilSup/Db/galil_csmotor_extras.template", P=DMC01:, PORT=DMC01,M="I",ADDR=8,PREC=3,SCAN="Passive",EGU="mm")

Substitution file error: Error while reading included file

line 37: '}'

#Load kinematics for CS axis/motors (eg. Forward and reverse kinematics, kinematic variables)

dbLoadTemplate("/home/jonathanhai/support/Galil/GalilTestApp/Db/galil_csmotor_kinematics.substitutions", "P=DMC01:, PORT=DMC01")

macLib: macro GALIL is undefined (expanding string $(GALIL)/GalilSup/Db/galil_forward_transform.template)

filename="../dbStatic/dbLexRoutines.c" line number=277 dbRead opening file (null)

ERROR failed to load '$(GALIL)/GalilSup/Db/galil_forward_transform.template'

dbLoadRecords("$(GALIL)/GalilSup/Db/galil_forward_transform.template", P=DMC01:, PORT=DMC01,M="I",ADDR="8")

Substitution file error: Error while reading included file

line 36: '}'

#Load coordinate system features (eg. Coordinate system S and T status, motor list, segments processed, moving status)

dbLoadTemplate("/home/jonathanhai/support/Galil/GalilTestApp/Db/galil_coordinate_systems.substitutions", "P=DMC01:, PORT=DMC01")

macLib: macro GALIL is undefined (expanding string $(GALIL)/GalilSup/Db/galil_coordinate_system.template)

filename="../dbStatic/dbLexRoutines.c" line number=277 dbRead opening file (null)

ERROR failed to load '$(GALIL)/GalilSup/Db/galil_coordinate_system.template'

dbLoadRecords("$(GALIL)/GalilSup/Db/galil_coordinate_system.template", P=DMC01:, PORT=DMC01,R="S",ADDR="0",SCAN=".1 second")

Substitution file error: Error while reading included file

line 32: '}'

#Load digital IO databases

dbLoadTemplate("/home/jonathanhai/support/Galil/GalilTestApp/Db/galil_dmc_digital_ports.substitutions", "P=DMC01:, PORT=DMC01")

macLib: macro GALIL is undefined (expanding string $(GALIL)/GalilSup/Db/galil_digital_in_bit.template)

filename="../dbStatic/dbLexRoutines.c" line number=277 dbRead opening file (null)

ERROR failed to load '$(GALIL)/GalilSup/Db/galil_digital_in_bit.template'

dbLoadRecords("$(GALIL)/GalilSup/Db/galil_digital_in_bit.template", P=DMC01:, PORT=DMC01,R=Galil0Bi0,BYTE=0,MASK=0x000001,ZNAM="Off",_ONAM_="On",ZSV="NO_ALARM",OSV="MAJOR")

Substitution file error: Error while reading included file

line 35: '}'

#Load analog IO databases

dbLoadTemplate("/home/jonathanhai/support/Galil/GalilTestApp/Db/galil_dmc_analog_ports.substitutions", "P=DMC01:, PORT=DMC01")

macLib: macro GALIL is undefined (expanding string $(GALIL)/GalilSup/Db/galil_analog_in.template)

filename="../dbStatic/dbLexRoutines.c" line number=277 dbRead opening file (null)

ERROR failed to load '$(GALIL)/GalilSup/Db/galil_analog_in.template'

dbLoadRecords("$(GALIL)/GalilSup/Db/galil_analog_in.template", P=DMC01:, PORT=DMC01,R="GalilAi0",ADDR="1",SCAN="I/O Intr",PREC="3")

Substitution file error: Error while reading included file

line 32: '}'

#Load user defined functions

dbLoadTemplate("/home/jonathanhai/support/Galil/GalilTestApp/Db/galil_userdef_records.substitutions", "P=DMC01:, PORT=DMC01")

macLib: macro GALIL is undefined (expanding string $(GALIL)/GalilSup/Db/galil_userdef_records.template)

filename="../dbStatic/dbLexRoutines.c" line number=277 dbRead opening file (null)

ERROR failed to load '$(GALIL)/GalilSup/Db/galil_userdef_records.template'

dbLoadRecords("$(GALIL)/GalilSup/Db/galil_userdef_records.template", P=DMC01:, PORT=DMC01,ADDR=0,EPICSNAME="BEGIN",GALILSTR="begin",DRVCMD="VAR",SCAN="I/O Intr",DRVL=0,DRVH=1,LOW=0,HIGH=1,LSV="MINOR",HSV="MINOR",ZNAM="Invalid",_ONAM_="Ok",ZSV="MAJOR",OSV="NO_ALARM",DEFAULT="10",EGU="",PINI="YES")

Substitution file error: Error while reading included file

line 52: '}'

#Load user defined array support

dbLoadTemplate("/home/jonathanhai/support/Galil/GalilTestApp/Db/galil_user_array.substitutions", "P=DMC01:, PORT=DMC01")

macLib: macro GALIL is undefined (expanding string $(GALIL)/GalilSup/Db/galil_user_array.template)

filename="../dbStatic/dbLexRoutines.c" line number=277 dbRead opening file (null)

ERROR failed to load '$(GALIL)/GalilSup/Db/galil_user_array.template'

dbLoadRecords("$(GALIL)/GalilSup/Db/galil_user_array.template", P=DMC01:, PORT=DMC01,ADDR="0",NELM=1000)

Substitution file error: Error while reading included file

line 34: '}'

#Load profiles

dbLoadTemplate("/home/jonathanhai/support/Galil/GalilTestApp/Db/DMC01_profileMoveController.substitutions", "P=DMC01:, PORT=DMC01")

macLib: macro GALIL is undefined (expanding string $(GALIL)/GalilSup/Db/galil_profileMoveController.template)

filename="../dbStatic/dbLexRoutines.c" line number=277 dbRead opening file (null)

ERROR failed to load '$(GALIL)/GalilSup/Db/galil_profileMoveController.template'

dbLoadRecords("$(GALIL)/GalilSup/Db/galil_profileMoveController.template", P=DMC01:, PORT=DMC01,R=Prof1:,TIMEOUT=1)

Substitution file error: Error while reading included file

line 43: '}'

dbLoadTemplate("/home/jonathanhai/support/Galil/GalilTestApp/Db/DMC01_profileMoveAxis.substitutions", "P=DMC01:, PORT=DMC01")

macLib: macro GALIL is undefined (expanding string $(GALIL)/GalilSup/Db/galil_profileMoveAxis.template)

filename="../dbStatic/dbLexRoutines.c" line number=277 dbRead opening file (null)

ERROR failed to load '$(GALIL)/GalilSup/Db/galil_profileMoveAxis.template'

dbLoadRecords("$(GALIL)/GalilSup/Db/galil_profileMoveAxis.template", P=DMC01:, PORT=DMC01,R=Prof1:,M=1,ADDR=0,NREADBACK="1441",ZNAM="Relative",_ONAM_="Absolute",PREC=4,TIMEOUT=1)

Substitution file error: Error while reading included file

line 58: '}'

# GalilCreateController command parameters are:

#

# 1. Const char *portName     - The name of the asyn port that will be created for this controller

# 2. Const char *address      - The address of the controller

# 3. double updatePeriod      - The time in ms between datarecords 2ms min, 200ms max.  Async if controller + bus supports it, otherwise is polled/synchronous.

#                             - Recommend 50ms or less for ethernet

#                             - Specify negative updatePeriod < 0 to force synchronous tcp poll period.  Otherwise will try async udp mode first

# Create a Galil controller

GalilCreateController("DMC01", "192.168.0.195", "8")

Connected to DMC4183 Rev 1.3i-SER at 192.168.0.195

# GalilCreateAxis command parameters are:

#

# 1. char *portName Asyn port for controller

# 2. char  axis A-H,

# 3. char  *Motor interlock digital port number 1 to 8 eg. "1,2,4".  1st 8 bits are supported

# 4. int   Interlock switch type 0 active when opto active, all other values switch type active when opto inactive

# Create the axis

# GalilCreateAxis("$(PORT)","A","",1)

# GalilCreateAxis("$(PORT)","B","",1)

# GalilCreateAxis("$(PORT)","C","",1)

# GalilCreateAxis("$(PORT)","D","",1)

# GalilCreateAxis("$(PORT)","E","",1)

# GalilCreateAxis("$(PORT)","F","",1)

GalilCreateAxis("DMC01","G","",1)

# GalilCreateAxis("$(PORT)","H","",1)

# GalilAddCode command parameters are:

# Add custom code to generated code

# 1. char *portName Asyn port for controller

# 2. int section = code section to add custom code into 0 = card code, 1 = thread code, 2 = limits code, 3 = digital code

# 3. char *code_file custom code file

# GalilAddCode("$(PORT)", 1, "customcode.dmc")

# GalilReplaceHomeCode command parameters are:

# Replace generated axis home code with custom code

# 1. char *portName Asyn port for controller

# 2. char *Axis A-H

# 3. char *code_file custom code file

# GalilReplaceHomeCode("$(PORT)", "A", "homeA.dmc")

# GalilCreateCSAxes command parameters are:

#

# 1. char *portName Asyn port for controller

#Create all CS axes (ie. I-P axis)

GalilCreateCSAxes("DMC01")

# GalilStartController command parameters are:

#

# 1. char *portName Asyn port for controller

# 2. char *code file(s) to deliver to the controller we are starting. "" = use generated code (recommended)

#             Specify a single file or to use templates use: headerfile;bodyfile1!bodyfile2!bodyfileN;footerfile

# 3. int   Burn program to EEPROM conditions

#             0 = transfer code if differs from eeprom, dont burn code to eeprom, then finally execute code thread 0

#             1 = transfer code if differs from eeprom, burn code to eeprom, then finally execute code thread 0

#             It is asssumed thread 0 starts all other required threads

# 4. int   Thread mask.  Check these threads are running after controller code start.  Bit 0 = thread 0 and so on

#             if thread mask < 0 nothing is checked

#             if thread mask = 0 and GalilCreateAxis appears > 0 then threads 0 to number of GalilCreateAxis is checked (good when using the generated code)

# Start the controller

GalilStartController("DMC01", "", 1, 0)

Code started successfully on model DMC4183 Rev 1.3i-SER, address 192.168.0.195

# Start the controller

# Example using homing routine template assembly

#GalilStartController("$(PORT)", "$(GALIL)/GalilSup/Db/galil_Default_Header.dmc;$(GALIL)/GalilSup/Db/galil_Home_RevLimit.dmc!$(GALIL)/GalilSup/Db/galil_Home_ForwLimit.dmc!$(GALIL)/GalilSup/Db/galil_Home_Home.dmc!$(GALIL)/GalilSup/Db/galil_Home_ForwLimit.dmc!$(GALIL)/GalilSup/Db/galil_Piezo_Home.dmc!$(GALIL)/GalilSup/Db/galil_Piezo_Home.dmc!$(GALIL)/GalilSup/Db/galil_Piezo_Home.dmc!$(GALIL)/GalilSup/Db/galil_Piezo_Home.dmc;$(GALIL)/GalilSup/Db/galil_Default_Footer.dmc", 0, 0, 3)

# GalilCreateProfile command parameters are:

#

# 1. char *portName Asyn port for controller

# 2. Int maxPoints in trajectory

# Create trajectory profiles

GalilCreateProfile("DMC01", 2000)

# DMC autosave restore configuration

# restore settings in pass 0 so encoder ratio is set correctly for position restore in device support init

set_pass0_restoreFile("GalilTest_DMC01Settings.sav")

# restore positions in pass 0 so motors don't move

set_pass0_restoreFile("GalilTest_DMC01Positions.sav")

# restore kinematic equation character arrays in pass 1

set_pass1_restoreFile("GalilTest_DMC01Kinematics.sav")

# Configure an example RIO (Remote IO PLC controller)

# < RIO01Configure.cmd

epicsEnvSet("GALIL", "/home/jonathanhai/support/Galil")

##################################################################################################

### Scan-support software

# crate-resident scan.  This executes 1D, 2D, 3D, and 4D scans, and caches

# 1D data, but it doesn't store anything to disk.  (See 'saveData' below for that.)

dbLoadRecords("/home/jonathanhai/support/sscan/sscanApp/Db/standardScans.db","P=DMC4183:,MAXPTS1=8000,MAXPTS2=1000,MAXPTS3=10,MAXPTS4=10,MAXPTSH=8000")

dbLoadRecords("/home/jonathanhai/support/sscan/sscanApp/Db/saveData.db","P=DMC4183:")

##################################################################################################

< autosave.cmd

####################################################

## save_restore setup

save_restoreSet_Debug(0)

# status-PV prefix, so save_restore can find its status PV's.

save_restoreSet_status_prefix("DMC4183:")

# Ok to save/restore save sets with missing values (no CA connection to PV)?  

save_restoreSet_IncompleteSetsOk(1)

# Save dated backup files?

save_restoreSet_DatedBackupFiles(1)

# Number of sequenced backup files to write

save_restoreSet_NumSeqFiles(1)

# Time interval between sequenced backups

save_restoreSet_SeqPeriodInSeconds(300)

# specify where save files should be

#set_savefile_path(${TOP}, "autosaveSaves")

set_savefile_path("/autosave", "")

# specify what save files should be restored.  Note these files must be

# in the directory specified in set_savefile_path(), or, if that function

# has not been called, from the directory current when iocInit is invoked

# example: set_pass0_restoreFile("autosave_geiger.sav")

# specify directories in which to to search for included request files

# set_requestfile_path(${TOP}, "autosaveReqs")

set_requestfile_path("/home/jonathanhai/support/Galil/GalilSup/Db", "")

set_requestfile_path("/home/jonathanhai/support/motor/motorApp/Db", "")

set_requestfile_path("/home/jonathanhai/support/sscan/sscanApp/Db", "")

set_requestfile_path("/home/jonathanhai/support/Galil/iocBoot/iocGalilTest", "")

dbLoadRecords("/home/jonathanhai/support/autosave/asApp/Db/save_restoreStatus.db","P=DMC4183:")

save_restoreSet_CAReconnect(1)

## End of autosave set-up

####################################################

# Start the IOC

iocInit()

Starting iocInit

############################################################################

## EPICS R7.0.9

## Rev. 2025-03-10T16:19-0400

## Rev. Date build date/time: 

############################################################################

1309 PVs had no saved value.

8 PVs had no saved value.

144 PVs had no saved value.

2025/03/13 14:31:09.339 DMC01:Prof1:TimeMode devAsynInt32::processCallbackOutput process write error 

2025/03/13 14:31:09.339 DMC01:Prof1:MoveMode devAsynInt32::processCallbackOutput process write error 

2025/03/13 14:31:09.339 DMC01:Prof1:M1UseAxis devAsynInt32::processCallbackOutput process write error 

2025/03/13 14:31:09.339 DMC01:Prof1:M2UseAxis devAsynInt32::processCallbackOutput process write error 

2025/03/13 14:31:09.339 DMC01:Prof1:M3UseAxis devAsynInt32::processCallbackOutput process write error 

2025/03/13 14:31:09.339 DMC01:Prof1:M4UseAxis devAsynInt32::processCallbackOutput process write error 

2025/03/13 14:31:09.339 DMC01:Prof1:M5UseAxis devAsynInt32::processCallbackOutput process write error 

2025/03/13 14:31:09.339 DMC01:Prof1:M6UseAxis devAsynInt32::processCallbackOutput process write error 

2025/03/13 14:31:09.339 DMC01:Prof1:M8UseAxis devAsynInt32::processCallbackOutput process write error 

2025/03/13 14:31:09.339 DMC01:Prof1:NumAxes devAsynInt32::processCallbackOutput process write error 

2025/03/13 14:31:09.339 DMC01:Prof1:NumPoints devAsynInt32::processCallbackOutput process write error 

2025/03/13 14:31:09.339 DMC01:Prof1:NumPulses devAsynInt32::processCallbackOutput process write error 

2025/03/13 14:31:09.339 DMC01:Prof1:StartPulses devAsynInt32::processCallbackOutput process write error 

2025/03/13 14:31:09.339 DMC01:Prof1:EndPulses devAsynInt32::processCallbackOutput process write error 

iocRun: All initialization complete

# Initialize saveData for step scans

 


References:
Galil Motor Controller (DMC-4183) EPICS Module Setup Jonathan Hai via Tech-talk

Navigate by Date:
Prev: Re: Image Acquisition Issue with AreaDetector/ADAravis Guruswamy, Tejas via Tech-talk
Next: Link error in MRF event system due to reference clock glitch Hong, Ran via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <2025
Navigate by Thread:
Prev: Galil Motor Controller (DMC-4183) EPICS Module Setup Jonathan Hai via Tech-talk
Next: Link error in MRF event system due to reference clock glitch Hong, Ran via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  <2025