Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
mbframe.h
Package: FreeModBus.rar [view]
Upload User: kongshuqi
Upload Date: 2013-10-09
Package Size: 59k
Code Size: 3k
Category:
Communication
Development Platform:
Visual C++
- /*
- * FreeModbus Libary: A portable Modbus implementation for Modbus ASCII/RTU.
- * Copyright (C) 2006 Christian Walter <wolti@sil.at>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * File: $Id: mbframe.h,v 1.8 2006/06/25 00:12:28 wolti Exp $
- */
- #ifndef _MB_FRAME_H
- #define _MB_FRAME_H
- #ifdef __cplusplus
- PR_BEGIN_EXTERN_C
- #endif
- /*!
- * Constants which defines the format of a modbus frame. The example is
- * shown for a Modbus RTU/ASCII frame. Note that the Modbus PDU is not
- * dependent on the underlying transport.
- *
- * <code>
- * <------------------------ MODBUS SERIAL LINE PDU (1) ------------------->
- * <----------- MODBUS PDU (1') ---------------->
- * +-----------+---------------+----------------------------+-------------+
- * | Address | Function Code | Data | CRC/LRC |
- * +-----------+---------------+----------------------------+-------------+
- * | | | |
- * (2) (3/2') (3') (4)
- *
- * (1) ... MB_SER_PDU_SIZE_MAX = 256
- * (2) ... MB_SER_PDU_ADDR_OFF = 0
- * (3) ... MB_SER_PDU_PDU_OFF = 1
- * (4) ... MB_SER_PDU_SIZE_CRC = 2
- *
- * (1') ... MB_PDU_SIZE_MAX = 253
- * (2') ... MB_PDU_FUNC_OFF = 0
- * (3') ... MB_PDU_DATA_OFF = 1
- * </code>
- */
- /* ----------------------- Defines ------------------------------------------*/
- #define MB_PDU_SIZE_MAX 253 /*!< Maximum size of a PDU. */
- #define MB_PDU_SIZE_MIN 1 /*!< Function Code */
- #define MB_PDU_FUNC_OFF 0 /*!< Offset of function code in PDU. */
- #define MB_PDU_DATA_OFF 1 /*!< Offset for response data in PDU. */
- /* ----------------------- Prototypes 0-------------------------------------*/
- typedef void ( *pvMBFrameStart ) ( void );
- typedef void ( *pvMBFrameStop ) ( void );
- typedef eMBErrorCode( *peMBFrameReceive ) ( UCHAR * pucRcvAddress,
- UCHAR ** pucFrame,
- USHORT * pusLength );
- typedef eMBErrorCode( *peMBFrameSend ) ( UCHAR slaveAddress,
- const UCHAR * pucFrame,
- USHORT usLength );
- typedef void( *pvMBFrameClose ) ( void );
- #ifdef __cplusplus
- PR_END_EXTERN_C
- #endif
- #endif