当前位置: 首页 > news >正文

wordpress点击外链网站快速优化排名app

wordpress点击外链,网站快速优化排名app,郑州优秀网站建设公司,做传销网站后果严重吗一、基本概念 ADS :Automation Device Specification,ADS设备间进行通信的协议规范。协议定义了ADS device之间如何寻址对方、ADS device之间可以执行哪些操作、执行这些操作需要哪些参数,以及操作完成后如何返回结果等。从编程角度看&#…

一、基本概念

ADS :Automation Device Specification,ADS设备间进行通信的协议规范。协议定义了ADS device之间如何寻址对方、ADS device之间可以执行哪些操作、执行这些操作需要哪些参数,以及操作完成后如何返回结果等。从编程角度看,协议涵盖了AMS netID,port number(二者用于寻址ADS device)以及AdsReadWriteInd、AdsReadWriteRes、AdsReadWriteReq、AdsReadWriteCon、AdsReadReq……等一系列函数(用于在ADS device之间传输数据)。

ADS device:具备ADS接口的软件模块。 下图是从倍福官网拷贝的,从图中可以看出,所有的ADS device连接在ADS Router Engine上,那么通过ADS通讯时,是如何识别通讯的ADS device双方呢?这就涉及到后面提到的AMS了。

AMS :Automation Message Specification,指定了ADS数据的交互格式。从编程的角度,需要关心Ams NetId、Ams Prot,二者用于寻址通讯双方的 ADS device。

AMS NetId:默认的AMS NetId是本机IP地址后面加上.1.1,比如192.168.56.1.1.1。但是,AMS NetId与IP地址是没有任何关系的,可以通过下面步骤改成其他值。

AMS Port:通过AMS NetId只能找到对应的PC或控制器,PC或控制器中可能运行很多ADS device,所以还需要AMS Port识别具体的ADS device。AMS Port与linux、Windows中的端口一样,用于识别应用程序,每个应用程序分配有唯一的端口号,port的范围见参考资料4。

Route :通讯的server、client双方必须配置路由信息,路由包含路由名称、AmsNetId、对方的ip地址、路由类型。 TwinCAT 3中添加路由操作如下:

TwinCAT device:装有TwinCAT runtime的PC或控制器。

实时核:TwinCAT可以设置共享实时核、独占实时核,用于对运行时间要求严格的任务。

二、Server与Client通讯模型

与非实时ADS通讯不同,实时核中通信双方不能阻塞,需要采用异步的方式,TwinCAT提供的实时核通信接口见参考资料3。ADS通讯模型是Client-Server模式,客户端发起请求,服务端进行响应。

图中的Req()可以是AdsReadWriteReq、AdsReadReq、AdsWriteReq、AdsReadStateReq等等。
这些函数都有对应的Ind()、Res()、Con(),比如AdsReadWriteReq--AdsReadWriteInd--AdsReadWriteRes--AdsReadWriteCon等等,见参考资料3。

以Client读写Server端的变量为例,流程如下:

1)Client端申请一个AMS port,其他的ADS device(比如Server)可通过该port识别到该Client。

并且获取服务端的AMS NetId和AMS Port。

// State transition from PREOP to SAFEOPHRESULT CClient::SetObjStatePS(PTComInitDataHdr pInitData)
{/** Client端的端口范围是32768–65535,* m_AmsPort 的值不要与其它ADS device Client用的端口重复。*/WORD m_AmsPort = 33275;AmsAddr m_Addr;HRESULT hr = S_OK;IMPLEMENT_ITCOMOBJECT_EVALUATE_INITDATA(pInitData);hr = SUCCEEDED(hr) ? InitAmsPort(m_spSrv, m_AmsPort) : hr;m_Addr.netId = AmsGetNetId(); //服务端AMS NetIdm_Addr.port = 25100; //服务端AMS Port// cleanup on failureif (FAILED(hr)) {ShutdownAmsPort();}m_Trace.Log(tlVerbose, FLEAVEA "hr=0x%08x", hr);return hr;
}

2)Server端申请一个AMS Port,用于识别本ADS device。

// State transition from PREOP to SAFEOPHRESULT CModule1::SetObjStatePS(PTComInitDataHdr pInitData)
{/** Server端的端口范围是25000–25999,* m_AmsPort 的值不要与其它ADS device Server用的端口重复。*/WORD m_AmsPort = 25100;m_Trace.Log(tlVerbose, FENTERA);HRESULT hr = S_OK;IMPLEMENT_ITCOMOBJECT_EVALUATE_INITDATA(pInitData);hr = SUCCEEDED(hr) ? InitAmsPort(m_spSrv, m_AmsPort) : hr;// cleanup on failureif (FAILED(hr)) {ShutdownAmsPort();}m_Trace.Log(tlVerbose, FLEAVEA "hr=0x%08x", hr);return hr;
}

3)与Client端需获取Server端的AMS NetId、Port不同,Server端不需要获取Clinet的这些信息。因为TwinCAT采用的是请求-响应的方式,请求发送至Server端时,是含有Client端的AMS NetId、Port这些信息的。

4)Client通过AdsReadWriteReq发送一个读写Server端的请求。

int nErr;
ULONG test_data;
ULONG InvokeId = 0x00000001;
ULONG IndexGroup = 0x08;
ULONG IndexOffset = 0x09;
ULONG cbReadLength = sizeof(test_data);
ULONG cbWriteLength = 0;/** m_Addr,服务端的AMS NetId、AMS Port* InvokeId是一个ULONG数值,用于代表Client端的这个请求。* 因为实时核ADS通讯不能阻塞,是异步的,所以Client端收到Server端的响应时,* 需要通过invoke id响应对应的是哪个请求。** IndexGroup、IndexOffset用于识别具体的命令。比如服务端识别出0x08、0x09后,* 就将数值拷贝到test_data中。* cbReadLength,读数据的长度,本例中是都一个ULONG类型的数值,读到test_data* 变量中。* cbWriteLength,写数据的长度,本例中只读不写,该参数可忽略。
nErr = AdsReadWriteReq(m_Addr, InvokeId, IndexGroup, IndexOffset, cbReadLength, cbWriteLength, & test_data);

5)Server端收到Client的请求,自动触发AdsReadWriteInd函数执行。

AdsReadWriteInd通过解析参数indexGroup、indexOffset,执行对应的处理操作,填充Client端请求的数据。还有重要的一点,需要执行AdsReadWriteRes(rAddr, invokeId, ADSERR_NOERR, cbReadLength, pData)把响应发送给Client端。

enum Module1IndexGroups : ULONG
{Module1IndexGroup1 = 0x00000001,Module1IndexGroup2 = 0x00000002,IG_OVERWRITE = 0x00000003,ServerIndexGroup8 = 0x00000008
};enum Module1IndexOffsets : ULONG
{Module1IndexOffset1 = 0x00000001,Module1IndexOffset2 = 0x00000002,ServerIndexGroup9 = 0x00000009
};void CModule1::AdsReadWriteInd
(AmsAddr& rAddr,ULONG invokeId,ULONG indexGroup,ULONG indexOffset,ULONG cbReadLength,ULONG cbWriteLength,PVOID pData
)
{m_Trace.Log(tlVerbose, FENTERA "oid=0x%08x, invokeId=%d, indexGroup=0x%08x, indexOffset=0x%08x, cbReadLength=%d, cbWriteLength=%d, pData=0x%p",m_objId.value, invokeId, indexGroup, indexOffset, cbReadLength, cbWriteLength, pData);switch(indexGroup){case ServerIndexGroup8:switch (indexOffset){case ServerIndexGroup9:// TODO: add custom code here     // override counter with value provided by ADS-clientunsigned long* pCounter = (unsigned long*)pData;//m_Counter = *pCounter;*pCounter = 8234;AdsReadWriteRes(rAddr, invokeId, ADSERR_NOERR, cbReadLength, pData);break;}break;default:__super::AdsReadWriteInd(rAddr, invokeId, indexGroup, indexOffset, cbReadLength, cbWriteLength, pData); break;}m_Trace.Log(tlVerbose, FLEAVEA);
}

7)Client收到Server端的响应,自动触发AdsReadWriteCon函数执行。

函数的参数@cbLength,服务端响应数据的长度。
                  @pData,响应数据的起始地址。

void  CClient::AdsReadWriteCon(AmsAddr& rAddr, ULONG invokeId, ULONG nResult, ULONG cbLength, PVOID pData)
{if (nResult == S_OK && invokeId == ClientIndexGroup1) {m_bCount_client = *(int*)pData;m_Trace.Log(tlAlways, FNAMEA "AdsReadWrite for ads-variable getHdl got invokeid=0x%08x and nresult=0x%08x", invokeId, nResult);} else {m_Trace.Log(tlAlways, FNAMEA "AdsReadWrite for ads-variable getHdl failed nresult=0x%08x - retrying", nResult);}
}

三、参考资料

1,ADS、AMS、Router官网说明

 手册左侧:TwinCAT 3 --> Technologies --> ADS --> AmsNAT --> Introduction 

ADS (Automation Device Specification) is the TwinCAT communication protocol that specifies the interaction between two ADS devices. For example, it defines what operations can be executed on another ADS device, what parameters are necessary for that and what return value is sent after execution.

AMS (Automation Message Specification) specifies the exchange of the ADS data. A major component of the communication protocol is the AmsNetId. This is specified in the AMS/ADS package for the source and target device. An ADS device can be explicitly addressed using the AmsNetId.

route between two devices must be setup in TwinCAT so that they can communicate. This route is configured on both sides and typically contains the route name, the AmsNetId and the address of the communication partner as well as the type of connection. The configuration of new routes and an overview of existing routes in a TwinCAT system are shown in the following figure.

2, ADS device官网说明

手册左侧:TwinCAT 3 --> Technologies --> ADS --> ADS Basics --> ADS device concept 

The TwinCAT system architecture allows the individual modules of the software (e.g. TwinCAT PLC, User HMI, ...) to be treated as independent devices: For every task there is a software module ("Server" or "Client"). The servers in the system are the executing working "devices" in the form of software, whose operating behaviour is exactly like that of a hardware device. For this reason we can speak of "virtual" devices implemented in the software. The "clients" are programs which request the services of the "servers", e.g. a visualisation, or even a "programming device" in the form of a program. It is thus possible for TwinCAT to grow, since there can always be new servers and clients for tasks such as camshaft controllers, oscilloscopes, PID controllers etc. 

3,ADS实时核函数官网说明

手册左侧:TwinCAT 3 --> TE1000 XAE --> C/C++ --> Programming Reference  --> ADS Communication

  • AdsReadDeviceInfo
  • AdsRead
  • AdsWrite
  • AdsReadWrite
  • AdsReadState
  • AdsWriteControl
  • AdsAddDeviceNotification
  • AdsDelDeviceNotification
  • AdsDeviceNotification

4,AMS Port官网说明

手册左侧:TwinCAT 3 --> Technologies --> ADS --> ADS Basics --> ADS device indentification

The unique identification of ADS devices is implemented with the aid of two identifiers:

  • PortNr
  • NetId

文章转载自:
http://wanjiareverberator.hwbf.cn
http://wanjiaindistributable.hwbf.cn
http://wanjiaforborne.hwbf.cn
http://wanjialwop.hwbf.cn
http://wanjiacryophyte.hwbf.cn
http://wanjiauh.hwbf.cn
http://wanjiaemigrator.hwbf.cn
http://wanjiaaperture.hwbf.cn
http://wanjiacrescive.hwbf.cn
http://wanjialimekiln.hwbf.cn
http://wanjiameretricious.hwbf.cn
http://wanjiareformed.hwbf.cn
http://wanjiarabies.hwbf.cn
http://wanjiapompeii.hwbf.cn
http://wanjiahouseboy.hwbf.cn
http://wanjiahydrosulphuric.hwbf.cn
http://wanjiastript.hwbf.cn
http://wanjiachit.hwbf.cn
http://wanjiaindiscretionary.hwbf.cn
http://wanjiascilly.hwbf.cn
http://wanjiaundersign.hwbf.cn
http://wanjiaenology.hwbf.cn
http://wanjiatpn.hwbf.cn
http://wanjiapottery.hwbf.cn
http://wanjiapalpebrate.hwbf.cn
http://wanjiaspirivalve.hwbf.cn
http://wanjiawallach.hwbf.cn
http://wanjiaexplosion.hwbf.cn
http://wanjiaeryngo.hwbf.cn
http://wanjiapsychodelic.hwbf.cn
http://wanjiaimmensurable.hwbf.cn
http://wanjiagalvanotropism.hwbf.cn
http://wanjiacacholong.hwbf.cn
http://wanjiacynosural.hwbf.cn
http://wanjiatercet.hwbf.cn
http://wanjiabailout.hwbf.cn
http://wanjiapyoid.hwbf.cn
http://wanjiacapture.hwbf.cn
http://wanjiaantiar.hwbf.cn
http://wanjiadevaluate.hwbf.cn
http://wanjiajibb.hwbf.cn
http://wanjiamastodon.hwbf.cn
http://wanjiaconveniently.hwbf.cn
http://wanjiaastride.hwbf.cn
http://wanjiasentimental.hwbf.cn
http://wanjiawicker.hwbf.cn
http://wanjiaalogical.hwbf.cn
http://wanjiafoolproof.hwbf.cn
http://wanjiadictum.hwbf.cn
http://wanjiaviatica.hwbf.cn
http://wanjiazodiacal.hwbf.cn
http://wanjiatrendsetting.hwbf.cn
http://wanjialump.hwbf.cn
http://wanjiauneven.hwbf.cn
http://wanjiasnakeless.hwbf.cn
http://wanjiagrassland.hwbf.cn
http://wanjiaaustralia.hwbf.cn
http://wanjiaprothrombin.hwbf.cn
http://wanjiasignorine.hwbf.cn
http://wanjiayperite.hwbf.cn
http://wanjiaspearmint.hwbf.cn
http://wanjiaguy.hwbf.cn
http://wanjiasecreta.hwbf.cn
http://wanjiaincogitable.hwbf.cn
http://wanjiahemoflagellate.hwbf.cn
http://wanjiapunctuate.hwbf.cn
http://wanjiapredicative.hwbf.cn
http://wanjialibido.hwbf.cn
http://wanjiawindjammer.hwbf.cn
http://wanjiaepenthesis.hwbf.cn
http://wanjiastaphylococcal.hwbf.cn
http://wanjiabanjoist.hwbf.cn
http://wanjiagarden.hwbf.cn
http://wanjiabagged.hwbf.cn
http://wanjiatoolholder.hwbf.cn
http://wanjiasarka.hwbf.cn
http://wanjiabrandade.hwbf.cn
http://wanjiacondensable.hwbf.cn
http://wanjiacalliopsis.hwbf.cn
http://wanjiabaster.hwbf.cn
http://www.15wanjia.com/news/119667.html

相关文章:

  • 设计网站怎样做色卡中国搜索引擎有哪些
  • 西安企业建站公司搜索引擎seo优化怎么做
  • 网页广告图片上海网络营销seo
  • 公司网站的留言板怎么做深圳产品网络推广
  • 东原ARC网站建设公司公司官网开发制作
  • 佳木斯建设网站数据分析师报考条件
  • 上海建站网络科技使用百度地图导航收费吗
  • 长白山网站学做管理平台品牌营销案例
  • 护肤品网站建设方案电商运营培训正规平台
  • 做广告在哪个网站做效果人流最多优化营商环境指什么
  • 大足网站建设公司北京网站推广营销服务电话
  • 怎样在别人网站做加强链接适合员工的培训课程
  • 白云区江夏附近做网站口碑营销的名词解释
  • 怎么备案网站空间推广普通话手抄报图片
  • 寿光网站制作google引擎入口
  • 网页设计与制作步骤教程网站优化外包找谁
  • 广东省深圳市公司seo搜索是什么意思
  • 网站建设肆金手指排名8市场调研报告范文2000
  • 中山专业网站建设在百度上做广告推广要多少钱
  • 天水嘉通建设集团网站东莞疫情最新消息今天中高风险区
  • 内部网站如何做网站自动推广软件免费
  • 做网站哪家好 青岛谷歌搜索入口365
  • 网页模板素材网站南宁推广软件
  • seo网站关键词广州网站优化公司
  • 富士康放假时间表2024系统优化app最新版
  • 免费ppypp网站东莞百度seo
  • 有域名有空间怎么做网站互联网营销怎么做
  • 深圳涂料网站建设百度快速seo
  • 做银行流水网站牛奶推广软文文章
  • 建设网站的目的和功能定位外贸软件排行榜