一、 CA-Gateway简介

总网站
用户手册
安装包

二、 CA-Gateway安装和测试

2.1 安装导引

以下内容来自用户手册Building the Gateway部分:
The Gateway uses 3.14 makefiles as it can only be built with 3.14. To build it you need to:
Obtain base and put it at the same directory level as extensions. Use at least base 3.14.

  1. Do a make in base to build base.
  2. Obtain extensions/configure.
  3. Change extensions/configure/RELEASE so EPICS_BASE points to your base.
  4. Do a make in extensions/config.
  5. Make sure that either GNU or Perl regular expressions are installed on your system. If neither is available, obtain the GNU Regex extension and build it in extensions/src/gnuregex.
  6. Obtain the Gateway directory and put it under extensions/src/gateway.
  7. Check the settings in extensions/src/gateway/Makefile.
  8. Do a make in extensions/src/gateway.

2.2 安装环境准备

  1. 下载并安装epics base(3.14及以上版本)。
  2. 下载并安装extentions。
    相关介绍、安装包
    下载后解压至和epics base在同一级目录下的位置。
    进行一些配置后执行make。
  3. 确定系统中安装有GNU或Perl后,将PVGateway安装包解压至 extensions/src/ 文件夹下。
  4. 安装pcas模块(USPAS的pcas模块内置在base/modules/pcas路径下)。
  5. extensions/src/gateway/下执行make。

2.3 可能需要的一些链接

在testTop文件夹下执行测试所需要的环境部署:
【nose-tap】https://github.com/python-tap/nose-tap
【pyepics】https://epics.anl.gov/tech-talk/2016/msg00918.php

三、 CA-Gateway启动命令和相关选项

gateway 的启动方式为:

gateway [options]

其中,options有如下选项:

options description
-debug [value] Enter a value between 0-100. 50 gives lots of information, 1 gives a small amount. For developers.
-pvlist [filename] Name of the file with all the allowed PVs in it. There is a sample file, gateway.pvlist, in the source distribution and reproduced here. The version in the distribution may be more recent. See Access Security for more information.
-access [filename] Name of the file with all the EPICS access security rules in it. The syntax for this file is the same as that for EPICS access security. See the Application Developers Guide for more information on this syntax and EPICS access security in general, and see Access Security below for more information. There is a sample file, gateway.access, in the source distribution and reproduced here. The version in the distribution may be more recent.
-log [filename] Name of file where all messages from the Gateway go, including stderr and stdout. This file will be automatically renamed if the Gateway is in server mode and it restarts.
-command [filename] Name of the file where your customized Gateway command file goes. The specified commands in this file are executed when a USR1 signal is sent to the Gateway or the internal process variable, gateway:commandFlag, is set to 1. Lines in the command file may be R1, R2, R3, or AS to run reports 1-3 and reread the access security file, respectively. See Reports below for more information. There is a sample file, gateway.command, in the source distribution and reproduced here. The version in the distribution may be more recent
-putlog [filename] Name of the file where Gateway put logging goes. Put logging is specified with TRAPWRITE in the access file. See the Application Developers Guide under access security as well as Access Security and Put Logging below for more information. This file will be automatically renamed if the Gateway is in server mode and it restarts.
-report [filename] Name of the file where reports go. The reports are appended if the file exists when the reports are generated. If not specified, the name is gateway:report.
-home [directory] Directory where the Gateway looks for its input files and writes its output files. Setting this is equivalent to changing to that directory before starting the Gateway. Setting the environment variable GATEWAY_HOME also accomplishes the same result.
-sip [ip-address] gateway 开启的服务端的IP地址,用于监听 PV 请求。该选项设置了 gateway 的环境变量EPICS_CAS_INTF_ADDR。
-signore [ip-address-list] gateway 服务端会忽略该IP地址列表内的客户端的 PV 请求。该选项设置了 gateway 的环境变量 EPICS_CAS_IGNORE_ADDR_LIST。
-cip [ip-address-list] gateway 客户端会在该IP地址列表中搜索 PV。该选项设置了 gateway 的环境变量 EPICS_CA_AUTO_LIST=NO 和 EPICS_CA_ADDR_LIST。
-sport [port] gateway 开启的服务端的端口号,用于监听 PV 请求。默认为 5064。该选项设置了 gateway 的环境变量 EPICS_CAS_SERVER_PORT.
-cport [port] gateway 客户端会在搜索IP列表的该端口号搜索 PV。该选项设置了 gateway 的环境变量 EPICS_CA_SERVER_PORT。注意,由于 Channel Access 的特性,如果指定了 -cport 而没有指定 -sport,那么 gateway 服务端的端口号也将与指定的 -cport 相同。
-connect_timeout [sec] The amount of time in seconds that the Gateway will allow a process variable search to continue before marking the process variable as being Dead. The default is 1.
-inactive_timeout [sec] The amount of time in seconds that the Gateway will hold the real connection to an Inactive process variable. The default is 7200 (2 hours).
-dead_timeout [sec] The amount of time in seconds that the Gateway will continue to look for process variables that are Connecting to the IOCs that the Gateway is using. The default is 120 (2 min).
-disconnect_timeout [sec] The amount of time in seconds that the Gateway will hold Disconnected process variables (those that were connected but have been disconnected). The default is 7200 (2 hours).
-reconnect_inhibit [sec] The minimum amount of time in seconds after the last beacon anomaly sequence before generating a new one. The Gateway generates a beacon anomaly sequence when process variables from the IOCs reconnect and when it rereads access security. Thus causes MEDMs to reissue search requests for unconnected PVs. Used to limit the beacon sequences, and hence the search requests. Search requests last for about 8 min., so it is not necessary to reissue beacon anomalies much more frequently than 8 min. The default is 300 (5 minutes).
-server Start in server mode. Start a daemon that watches the Gateway and automatically restarts it if it dies. Not available on WIN32. See Server Mode.
-mask [string] Event mask that is used for connections to the IOCs. Use any combination of v (value), a (alarm), l (log). The default is va (forward value and alarm change events). Also see option -archive.
-prefix [string] Set the prefix for the Gateway internal process variables. Defaults to the hostname on which the Gateway is running.
-uid [integer] Run the Gateway server as this user id number. The Gateway does a setuid(2) to this uid. Not available on WIN32.
-gid [integer] Run the Gateway server as this group id number. The Gateway does a setgid(2) to this uid. Not available on WIN32.
-archive Use separate archive monitors (which honor ADEL instead of MDEL) when archive client connects. This is the preferred method (in opposite to -mask) when the gateway should be used by archivers and “normal” clients (medm) at the same time.
-no_cache Do not use cached (monitored) values when a client does ca_get. This results in higher network traffic to the IOC but returns always the current value, even if no monitor event had been send (e.g. because of a MDEL). This also solves problems with record fields like HOPR or EGU if they are modified during run-time.

例如,在一个具有双网卡的主机上(具有192.168.206.234和192.168.200.200两个IP)开启 gateway,从一个网段(192.168.200.0)向另一个网段(192.168.206.0)转发 PV,可以利用如下命令:

gateway -log gateway.log -cip 192.168.200.255 -sip 192.168.206.234

该命令使 gateway 在 192.168.200.0 网段搜索 PV,并开启一个服务端,服务端的IP为 192.168.206.234;同时,将 gateway 的行为记录到 gateway.log 文件中。

四、 CA-Gateway具体应用场景

4.1 gateway用于两个网段之间的PV访问

当两个无法互相访问的网段(假设分别为A网段和B网段)之间需要访问对方网段的PV时,可利用gateway进行PV转发。
本例中的相关主机信息如下图所示。其中以192.168.206.0作为A网段,192.168.200.0作为B网段,gateway所在主机具备同时面向两个网段的双网卡;在gateway主机上启动两个CA-Gateway服务,用于双向转发PV。


该场景会造成PV在网络中的回环。具体来说,即由于gateway搜索PV时使用了广播模式,C1 端的搜索也会收到PC1中的PV经过 C1-S1-C2-S2 又回传给PC1;类似地,PC2中的PV经过 C2-S2-C1-S1 又回传给PC2。
若要阻断这种回环,需要阻断C1搜索PV时,来自S2的应答;类似地,还需阻断C2搜索PV时,来自S1的应答。

有两种gateway启动方式可以实现这种场景:
1. 方式一:gateway服务端口号设置为非默认搜索端口号
由于CA广播搜索的UDP端口号默认为5064,将gateway的服务监听端口号设置为非5064的其他值时,就不会接收到广播搜索信号,因此该gateway服务也不会被触发。

./gateway -cip 192.168.206.255 -sip 192.168.200.200 -sport 20000 –server
./gateway -cip 192.168.200.255 -sip 192.168.206.234 -sport 20001 –server

2. 方式二:gateway服务端屏蔽特定客户端IP
在gateway服务端进行设置,可以忽略特定IP的客户端发起的PV搜索请求,因此该gateway服务不会响应其他gateway的搜索请求。

./gateway -cip 192.168.206.255 -sip 192.168.200.200 -signore 192.168.200.200 –server
./gateway -cip 192.168.200.255 -sip 192.168.206.234 -signore 192.168.206.234 –server

这里的“-signore”选项,实际是设置了 EPICS_CAS_IGNORE_ADDR_LIST 环境变量1

4.2 gateway用于两个以上网段之间的PV访问

同理地,对于两个以上网段的多个gateway,也可采取类似方法避免同一PV的多个来源问题。

来自PC2的PV被PC1访问时,有两种路径:可以通过 PC2-gateway1-PC1 直接访问;也可通过 PC2-gateway2-gateway3-PC1 访问到。为了避免第二种路径的访问方式,采取上述gateway启动配置,截断 gateway2-gateway3 的通路即可。


  1. 来自EPICS_CAS_IGNORE_ADDR_LIST参数中指定的任何IP地址的PV请求都不会得到回复。在R3.14和以前的版本中,iocCore使用的CA服务器没有实现这个特性。 ↩︎

CA-Gateway 的配置和使用手册相关推荐

  1. 物料分类账业务配置及操作手册

    物料分类账业务配置及操作手册 物料分类账业务配置及操作手册 Overview 业务说明 物料分类账的主要作用在于将实际成本和标准成本的差异分摊到库存和销售成本中,从而实现差异在实际的使用者中进行分摊, ...

  2. 网关Spring Cloud Gateway的配置和使用

    文章目录 1. 什么是Spring Cloud Gateway? 2. Gateway与zuul的区别 3. Gateway的配置和使用 ①:常用的路由断言工厂 ②:常用的过滤器工厂(GatewayF ...

  3. cj20n sap 报错未知列的名称_SAP,PS模块配置和操作手册

    SAP PS模块配置和操作手册 SAP PS模块配置和操作手册 Overview 项目管理 项目管理总的来说就是需要管理整个项目实施的过程,在这个过程中,需要将各级任务进行分解,也就是通常说的WBS. ...

  4. VMware vSphere 6.7 虚拟化搭建及配置完整详细手册 | 周末送资料

    VMware vSphere 6.7 虚拟化搭建及配置完整详细手册 | 周末送资料 https://mp.weixin.qq.com/s?__biz=MjM5NTk0MTM1Mw==&mid= ...

  5. cj20n sap 报错未知列的名称_sap ps模块全称 SAP,PS模块配置和操作手册

     SAP PS模块配置和操作手册 SAP PS模块配置和操作手册 Overview 项目管理 项目管理总的来说就是需要管理整个项目实施的过程,在这个过程中,需要将各级任务进行分解,也就是通常说的WB ...

  6. h700整列卡直通配置_DELL服务器RAID H700,PERC H800阵列卡配置中文完全手册图解

    对RAID进行操作会导致数据丢失,请在操作之前务必将重要数据妥善备份. 名称解释: Disk Group:磁盘组,这里相当于是阵列,例如配置了一个RAID5,就是一个磁盘组 VD(Virtual Di ...

  7. SolarWinds安装、配置、使用手册

    SolarWinds安装.配置.使用手册 v1.0 [版本修订说明] 版本1.0为初稿. 一.说明 该文档适用于在Windows 98 / NT / 2000 / ME / XP以上操作系统上安装使用 ...

  8. sap 标准委外和工序委外_SAPPP-SAP委外工序业务配置及操作手册.doc

    SAPPP-SAP委外工序业务配置及操作手册 SAP委外工序业务配置及操作手册 SAP委外工序业务配置及操作手册 Business Solution SAP系统中委托加工分为委托加工和委外的工序. 委 ...

  9. sap 标准委外和工序委外_[技术手册] sappp-sap委外工序业务配置及操作手册.doc

    [技术手册] sappp-sap委外工序业务配置及操作手册.doc SAP 培训: 1/23Edited by 陆大春(Trigger Lau) at 2012-03-19 Version:1.0 F ...

  10. SAP按销售订单生产和标准结算配置及操作手册

    SAP按销售订单生产和标准结算配置及操作手册 http://blog.sina.com.cn/s/blog_6787c0b80101a3tl.html SAP按销售订单生产和标准结算配置及操作手册 S ...

最新文章

  1. HBASE_API的应用
  2. AI产品经理必修——揭开算法的面纱(余弦定理)
  3. 获得一个字符的ASCII值
  4. NET插件系统之四——提升系统搜索插件和启动速度的思考
  5. 中国馆智能视频监控系统
  6. [Android]使用Dagger 2进行依赖注入 - Producers(翻译)
  7. 基于域名的apache服务器
  8. 二分答案——yyy2015c01 的 U 盘(洛谷 P2370)
  9. VB 二进制数据读写实例
  10. Yii 关于AR分表
  11. MATLAB BP神经网络的设计与优化
  12. 计算机的超级终端程序无法使用,超级终端怎么用?
  13. 非极大值抑制算法(NMS)的python实现
  14. 免费html转换成word,如何免费将网页内容转成Word文档
  15. word 大纲视图的生成
  16. 丢失api-ms-win-crt-heap-l1-1-0.dll 错误的解决办法
  17. IE被劫持多一个IE图标,无法删除主页也被篡改
  18. smb.conf - Samba组件的配置文件
  19. MySql 数据库 管理员密码忘记怎么办?
  20. Linux Bash漏洞最新最全的修复方法

热门文章

  1. java单例模式线程安全
  2. SQL Server 中WITH (NOLOCK)浅析(大自然的搬运工)
  3. 标准SQL规范中定义的四个事务隔离级别
  4. TCP过程中,网络断开问题解决办法
  5. 匹配树结构 并删除树节点(将B树的id存起来,然后根据存起来的id,匹配到A中节点id保留A该节点)
  6. 腾讯云服务器增加网卡,Windows腾讯云服务器如何更新virtio网卡驱动
  7. SAP从入门到放弃系列之QM质量检验流程概述
  8. Farewell Livy, Hi Linkis
  9. python下载进度条怎么做
  10. python爬虫多线程实战:爬取美桌1080p壁纸图片