Hi Baeg,
Your startup script contains this:
TechSetup(1,8,10)
TechConfig(0,"SERIALPORT")
That looks to me like you are writing a "Model 1" driver. That is an old architecture with many limitations. I suggest you write a Model 3 driver that derives from asynMotorController and asynMotorAxis.
Mark
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of 백호령 via Tech-talk <tech-talk at aps.anl.gov>
Sent: Thursday, April 24, 2025 12:05 AM
To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: EPICS VAL/DVAL garbage value
Hello, we are currently working on developing a new controller.
We are developing a controller with an integrated controller+driver for simple motor control.
Raspberry Pi, Panasonic PLC, and Autonics' MD5-HD14 drives were connected, and EPICS 3.15.6 and Synaps were installed to create a motor control module.
One problem is that we have to set offset values because DVAL, VAL values are executed with strange non-zero values.
ex)
Name: IOC:m1.RMP
State: Connected Running
Value: VInt[-939441500, 202
Name: IOC:m1.REP
State: Connected Running
Value: VInt[424962560, 2025/04/24 13:51:26.222]
The motor runs well, but I'd like to ask for advice because it's inconvenient to use it this way.
I'm attaching the results of the st.cmd file execution as well. (I don't think there's anything wrong with executing it.)
====================================
./st.cmd
#!../../bin/linux-arm/Tech
cd "/usr/local/epics/iocs/Tech/iocBoot/iocTech"
< envPaths
epicsEnvSet("IOC","iocTech")
epicsEnvSet("TOP","/usr/local/epics/iocs/Tech")
epicsEnvSet("MODULES","/usr/local/epics/modules")
epicsEnvSet("MOTOR","/usr/local/epics/modules/motor")
epicsEnvSet("ASYN","/usr/local/epics/modules/asyn")
epicsEnvSet("CALC","/usr/local/epics/modules/calc")
epicsEnvSet("AUTOSAVE","/usr/local/epics/modules/autosave")
epicsEnvSet("SNCSEQ","/usr/local/epics/modules/seq")
epicsEnvSet("SSCAN","/usr/local/epics/modules/sscan")
epicsEnvSet("IPAC","/usr/local/epics/modules/ipac")
epicsEnvSet("BUSY","/usr/local/epics/modules/busy")
epicsEnvSet("EPICS_BASE","/usr/local/epics/base")
< pvSettings
epicsEnvSet("P","IOC:")
epicsEnvSet("M1","m1")
epicsEnvSet("M2","m2")
epicsEnvSet("M3","m3")
epicsEnvSet("M4","m4")
epicsEnvSet("M5","m5")
epicsEnvSet("M6","m6")
epicsEnvSet("M7","m7")
epicsEnvSet("M8","m8")
cd "/usr/local/epics/iocs/Tech"
## Register all support components
dbLoadDatabase("dbd/Tech.dbd")
Tech_registerRecordDeviceDriver(pdbbase)
## Serial Configuration
drvAsynSerialPortConfigure("SERIALPORT","/dev/ttyAMA0",0,0,0)
asynSetOption("SERIALPORT",-1,"baud","19200")
asynSetOption("SERIALPORT",-1,"bits","8")
asynSetOption("SERIALPORT",-1,"parity","odd")
asynSetOption("SERIALPORT",-1,"stop","1")
asynSetOption("SERIALPORT",-1,"clocal","Y")
asynSetOption("SERIALPORT",-1,"crtscts","N")
asynOctetSetInputEos("SERIALPORT",0,"\r")
asynOctetSetOutputEos("SERIALPORT",0,"\r")
#asynSetTraceIOMask("SERIALPORT", 0, 2)
#asynSetTraceMask("SERIALPORT", 0, 255)
TechSetup(1,8,10)
TechConfig(0,"SERIALPORT")
## Load record instances
dbLoadRecords "db/motor_record.db","P=IOC:,M=m1,S=0"
dbLoadRecords "db/motor_record.db","P=IOC:,M=m2,S=1"
dbLoadRecords "db/motor_record.db","P=IOC:,M=m3,S=2"
dbLoadRecords "db/motor_record.db","P=IOC:,M=m4,S=3"
dbLoadRecords "db/motor_record.db","P=IOC:,M=m5,S=4"
dbLoadRecords "db/motor_record.db","P=IOC:,M=m6,S=5"
dbLoadRecords "db/motor_record.db","P=IOC:,M=m7,S=6"
dbLoadRecords "db/motor_record.db","P=IOC:,M=m8,S=7"
#dbLoadRecords "db/motorUtil.db","P=$(P)"
# =====================================================================
## Begin: Setup autosave/restore
# =====================================================================
# ============================================================
# If all PVs don't connect continue anyway
# ============================================================
save_restoreSet_IncompleteSetsOk(1)
# ============================================================
# created save/restore backup files with date string
# useful for recovery.
# ============================================================
save_restoreSet_DatedBackupFiles(0)
# ============================================================
# Where to find the list of PVs to save
# ============================================================
set_requestfile_path("./")
# ============================================================
# Where to write the save files that will be used to restore
# ============================================================
set_savefile_path("./", "autosave")
# ============================================================
# Prefix that is use to update save/restore status database
# records
# ============================================================
#save_restoreSet_status_prefix("$(LOCA):$(DEV):")
#save_restoreSet_status_prefix("$(P)")
## Restore datasets
set_pass0_restoreFile("auto_settings.sav")
set_pass1_restoreFile("auto_settings.sav")
# =====================================================================
# End: Setup autosave/restore
# =====================================================================
## Set this to see messages from mySub
#var mySubDebug 1
## Run this to trace the stages of iocInit
#traceIocInit
cd "/usr/local/epics/iocs/Tech/iocBoot/iocTech"
iocInit
Starting iocInit
############################################################################
## EPICS R3.15.6
## EPICS Base built Dec 3 2018
############################################################################
reboot_restore: entry for file 'auto_settings.sav'
reboot_restore: Found filename 'auto_settings.sav' in restoreFileList.
*** restoring from './autosave/auto_settings.sav' at initHookState 6 (before record/device init) ***
reboot_restore: done with file 'auto_settings.sav'
reboot_restore: entry for file 'auto_settings.sav'
reboot_restore: Found filename 'auto_settings.sav' in restoreFileList.
*** restoring from './autosave/auto_settings.sav' at initHookState 7 (after record/device init) ***
reboot_restore: done with file 'auto_settings.sav'
iocRun: All initialization complete
#motorUtilInit("$(P)")
create_monitor_set("auto_settings.req", 30, "P=IOC:,M1=m1,M2=m2,M3=m3,M4=m4,M5=m5,M6=m6,M7=m7,M8=m8")
## Start any sequence programs
#seq sncTech,"user=root"
epics> auto_settings.sav: 304 of 304 PV's connected
epics>
epics> dbl
IOC:m1_able
IOC:m2_able
IOC:m3_able
IOC:m4_able
IOC:m5_able
IOC:m6_able
IOC:m7_able
IOC:m8_able
IOC:m1_ableput
IOC:m2_ableput
IOC:m3_ableput
IOC:m4_ableput
IOC:m5_ableput
IOC:m6_ableput
IOC:m7_ableput
IOC:m8_ableput
IOC:m1
IOC:m2
IOC:m3
IOC:m4
IOC:m5
IOC:m6
IOC:m7
IOC:m8
IOC:m1_vCh
IOC:m1_twCh
IOC:m2_vCh
IOC:m2_twCh
IOC:m3_vCh
IOC:m3_twCh
IOC:m4_vCh
IOC:m4_twCh
IOC:m5_vCh
IOC:m5_twCh
IOC:m6_vCh
IOC:m6_twCh
IOC:m7_vCh
IOC:m7_twCh
IOC:m8_vCh
IOC:m8_twCh
======================================
Can you guys give me some advice please?
Always Appreciate your helps and advices.
Best and Regards.
Baeg
|