Webmin在EPICS IOC启动中的应用

本文使用webmin启动远程工控机中的EPICS IOC,受控设备使用PI公司的六轴台以及相应的控制器C-887:

1)控制器C-887

  1. 六轴台:

3)在工控机上安装用于与C-887控制器进行通信的EPICS IOC程序,安装结束后,进入启动目录(EPICS IOC代码位于Github上GitHub - epics-motor/motorPIGCS2: EPICS asyn motor drivers for PI GCS2 controllers):

bash 复制代码
[root@localhost iocC887]# ls
envPaths  Makefile  PI_GCS2.substitutions  start.sh  st.cmd

编辑st.cmd,设置C-887控制器的IP地址,用于连接控制器:

bash 复制代码
#!../../bin/linux-x86_64/C887

#- You may have to change C887 to something else
#- everywhere it appears in this file

< envPaths

cd "${TOP}"

## Register all support components
dbLoadDatabase "dbd/C887.dbd"
C887_registerRecordDeviceDriver pdbbase

drvAsynIPPortConfigure("C867_ETH","192.168.3.220:23",0,0,0)
# Turn on asyn trace
asynSetTraceMask("C867_ETH",0,3)
asynSetTraceIOMask("C867_ETH",0,1)

# PI_GCS2_CreateController(portName, asynPort, numAxes, priority, stackSize, movingPollingRate, idlePollingRate)
PI_GCS2_CreateController("C867", "C867_ETH",6, 0,0, 100, 1000)


cd "${TOP}/iocBoot/${IOC}"
dbLoadTemplate("PI_GCS2.substitutions")

iocInit

编辑一个start.sh的shell脚本,内容如下:

bash 复制代码
#!/bin/bash

cd /usr/local/EPICS/program/motorHexpod-C887/iocBoot/iocC887
../../bin/linux-x86_64/C887 st.cmd

在/root目录下,创建三个文件其内容如下所示:

C887-Check-EPICS-Server.sh:用于查看IOC是否已经启动

bash 复制代码
[root@localhost ~]# cat C887-Check-EPICS-Server.sh
#!/bin/bash


screen -ls | grep "\.C887\b"

if [ $? -eq 0 ];then
        echo "C887 Server is already running now!"
else
        echo "C887 Server is not running!"
fi

C887-Start-EPICS-Server.sh:用于启动EPICS IOC

bash 复制代码
[root@localhost ~]# cat C887-Start-EPICS-Server.sh
#!/bin/bash


source /etc/profile.d/epics.sh
echo "Start C887 EPICS server, waiting ..."

screen -ls | grep "\.C887\b"

if [ $? -eq 0 ];then
        echo "C887 server is already running now!"
else
        cd /usr/local/EPICS/program/motorHexpod-C887/iocBoot/iocC887/
        screen -dmS C887 ./start.sh
        ret=$?
        sleep 5

        if [ $ret -eq 0 ];then
                echo "Start C887 Server successfully"
                exit 0
        else
                echo "Failed to Start C887 Server"
                exit 1
        fi

fi

echo "Start finished!"

C887-Stop-EPICS-Server.sh:用于结束EPICS IOC

bash 复制代码
[root@localhost ~]# cat C887-Stop-EPICS-Server.sh
#!/bin/bash

screen -ls | grep "\.C887\b"

if [ $? -ne 0 ];then
        echo "C887 Server is not running now!"
        exit 1
fi

echo "Stop C887 EPICS Server ..."
kill $(screen -ls | grep "C887" | cut -d "." -f1)
sleep 5
echo "C887 EPICS Server already stopped"

安装Webmin,并且启动,用局域网中其它计算机的浏览器进行初始登录,登录名为root,密码为安装系统时为root设置的密码:

登录后进入Tools->Custom Commonds创建三个用户自定义命令:

创建结束后,用户界面如下:

通过点击以上三个按钮,进行测试:

1、点击View C-887 EPICS Server:

2、点击Start C-887 EPICS Server:

客户端也正常显示了:

3、点击View C-887 EPICS Server:

4、点击Stop C-887 EPICS Server:

客户端连接也都断开了:

相关推荐
woshigaowei51462 个月前
自定义EPICS在LabVIEW中的测试
labview·epics
woshigaowei51462 个月前
LabVIEW中EPICS客户端/服务端的测试
labview·epics
yuyuyuliang005 个月前
Hexapod C-887使用手册 -- 4,5,6
hexapod c-887
yuyuyuliang001 年前
EPICS modbus 模块数字量读写练习
epics
yuyuyuliang001 年前
基于EPICS stream模块的直流电源的IOC控制程序实例
linux·c语言·epics
yuyuyuliang001 年前
基于asynPortDriver的asyn异步驱动程序示例
c语言·epics