📄 mbusrtumasterprotocol.pas
字号:
(**
* @internal
* @file MbusRtuMasterProtocol.pas
*
* @if NOTICE
*
* $Id: MbusRtuMasterProtocol.pas,v 1.6 2005/07/14 05:22:47 henrik Exp $
*
* Copyright (c) 2003-2005 FOCUS Software Engineering Pty Ltd, Australia.
* All rights reserved. <www.focus-sw.com>
*
* USE OF THIS SOFTWARE IS GOVERNED BY THE TERMS AND CONDITIONS OF A
* SEPARATE LICENSE STATEMENT AND LIMITED WARRANTY.
*
* IN PARTICULAR, YOU WILL INDEMNIFY AND HOLD FOCUS SOFTWARE ENGINEERING,
* ITS RELATED COMPANIES AND ITS SUPPLIERS, HARMLESS FROM AND AGAINST ANY
* CLAIMS OR LIABILITIES ARISING OUT OF THE USE, REPRODUCTION, OR
* DISTRIBUTION OF YOUR PROGRAMS, INCLUDING ANY CLAIMS OR LIABILITIES
* ARISING OUT OF OR RESULTING FROM THE USE, MODIFICATION, OR DISTRIBUTION
* OF PROGRAMS OR FILES CREATED FROM, BASED ON, AND/OR DERIVED FROM THIS
* SOURCE CODE FILE.
*
* @endif
*)
unit MbusRtuMasterProtocol;
(*****************************************************************************
* Interface
*****************************************************************************)
interface
uses
Classes,
MbusMasterFunctions,
MbusSerialMasterProtocol;
(*****************************************************************************
* TMbusRtuMasterProtocol class declaration
*****************************************************************************)
(**
* @brief Modbus RTU Master Protocol class
*
* This class realizes the Modbus RTU master protocol. It provides
* functions to open and to close serial port as well as data and control
* functions which can be used at any time after the protocol has been
* opened. The data and control functions are organized different
* conformance classes. For a more detailed description of the data and
* control functions see section @ref mbusmaster.
*
* It is possible to instantiate multiple instances of this class for
* establishing multiple connections on different serial ports (They should
* be executed in separate threads).
*
* @ingroup mbusmasterserial
* @version 1.1
* @see mbusmaster
* @see TMbusSerialMasterProtocol, TMbusMasterFunctions
*)
type
TMbusRtuMasterProtocol = class(TMbusSerialMasterProtocol)
public
constructor Create(aOwner: TComponent); override;
end;
procedure Register;
(*****************************************************************************
* Implementation
*****************************************************************************)
implementation
(*****************************************************************************
* DLL stub functions
*****************************************************************************)
function mbusMaster_createRtuProtocol: pointer;
stdcall; external 'libmbusmaster.dll' name '_mbusMaster_createRtuProtocol@0';
(*****************************************************************************
* TMbusRtuMasterProtocol class implementation
*****************************************************************************)
(**
* Constructs a TMbusRtuMasterProtocol object and initialises its data.
*
* @exception EOutOfResources Creation of class failed
*)
constructor TMbusRtuMasterProtocol.Create(aOwner: TComponent);
begin
inherited Create(aOwner);
mbusHdl := mbusMaster_createRtuProtocol;
if mbusHdl = nil then
raise EOutOfResources.Create('Instanciation of protocol object failed!');
end;
(**
* Registers component
*)
procedure Register;
begin
RegisterComponents('FieldTalk', [TMbusRtuMasterProtocol]);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -