Toolkit for asynchronous DLLs with RTE interface.doc

上传人:心*** 文档编号:1039120 上传时间:2018-11-22 格式:DOC 页数:3 大小:143KB
下载 相关 举报
Toolkit for asynchronous DLLs with RTE interface.doc_第1页
第1页 / 共3页
Toolkit for asynchronous DLLs with RTE interface.doc_第2页
第2页 / 共3页
Toolkit for asynchronous DLLs with RTE interface.doc_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

1、Description of the interface for asynchronous calls of functions located in DLLsfrom IEC-Program (PLC-program)1. Intruduction1.1. OverviewThe realtimeextension of 3S-company for WindowsNT4.0 consists of a kernel-part and an applicationpart. The kernelpart is a krnelmodedriver, which works as a tasks

2、cheduler and a PLC. With the programmingsystem CoDeSys, tasks can be programmed and configured to work in realtime. Within these tasks, realtime-dedicated functions can be managed. This means, for example, no Windows-API-calls are possible, IOs are updated by direct hardwareaccess and so on.The appl

3、icationpart is implemented as systemservice, means here we can do all the things, which need Windows-API-calls, like networking and others.Now there is a need to start these jobs from the PLC (running in the kernel, in our realtimetasks). So we implemented an interface, which allows us to call funct

4、ions within DLLs.In the IEC-Program (CoDeSys) the call to a library-functionblock leads to a call of a DLL-function in usermode (Windows-API).The work of the DLL-function is done in the context of an own thread for each call. So more than one call can be active at a time and all the calls are contro

5、lled by timeouts and exceptionhandlers.1.2. Which DLLs are loadedUsed DLLs are made visible to the system by registry-entries:InHKEY_LOCAL_MACHINESoftware3S Smart Software SolutionsCodesys SPRTPLCExternal DLLsthere must exist a value for each DLL that should be used. The form is:Valuename: Dllx, whe

6、re x is a number starting from 0.Value: The filename of the DLL, with or without (if located in system32) path.All these Dlls (no matter how many) are loaded to memory with Start system, and unloaded with Stop system.Example for an entry:Dll0 d:WorkspaceAsynchDllAsynchDll.dll2. The interface and the

7、 toolkitAll the functions in a DLL can be called through the library functionblock DllCall aufgerufen werden.The parameters are : bEnable At a rising edge the job is started.szFunktionName The name of the function to be called.ulSizeIn Size of the inputbuffer in bytes.ulSizeOut Size of the outputbuf

8、fer in bytes.pAdrIn address of the inputdata (address of a structure in IEC.)pAdrOut address of outputdata (address of a structure in IEC.)The returnvalue of iStatus is one of:STATUS_NOTENABLED,STATUS_PROCESSING,STATUS_READY,STATUS_ERROR,STATUS_TIMEOUT,STATUS_EXCEPTION,STATUS_USERTERMINATEDThe funct

9、ionblock must be called cyclic, to make changes of enable visible to the PLC and give the PLC the possibility to set the current state.The functionblock is part of the library DllCall.lib.The library DllCall.lib is based on the library SysLibSystemCall.lib, which must be included manually into the p

10、rogram.The functions within the DLL, must fit the following prototype:typedef BOOL (_cdecl *PFCUSTOMDLLFUNCTION)(char* pBufferIn, int iSizeIn, char* pBufferOut, int iSizeOut);The returnvalue maintains the states STATUS_ERROR (returnvalue FALSE) or STATUS_READY of DllCall.The communication between the PLC and the DLL is implemented with sharedmemory-channels and is limited to 100bytes (total) input- and outputdata.The name of the function must not be longer than 80 bytes.

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 实用文档资料库 > 策划方案

Copyright © 2018-2021 Wenke99.com All rights reserved

工信部备案号浙ICP备20026746号-2  

公安局备案号:浙公网安备33038302330469号

本站为C2C交文档易平台,即用户上传的文档直接卖给下载用户,本站只是网络服务中间平台,所有原创文档下载所得归上传人所有,若您发现上传作品侵犯了您的权利,请立刻联系网站客服并提供证据,平台将在3个工作日内予以改正。