亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? readme

?? 很好的Modbus協(xié)義庫棧
??
字號:
=============================================================================                               LibModbus 0.0.1	               05/08/2001  ==                                                                          ==           This software is Copyright (C) 2001 by Laurent LOPES.          ==      Use this software at your own risk. I am not responsible for        ==            anything this software may do to your computer.               ==     This software falls under the GNU Public License. Please read        ==                  the COPYING file for more information                   =================================================================================================================== Author====================================== Author: Laurent LOPESe-mail: pes@free.frhomepage: pes.free.fr          ====================================== Requirements======================================   libpthread====================================== Install======================================  Compilation: make  General install: make install  Removal: make uninstall====================================== Features======================================	This library is made to dial with master and slave Modbus(R) protocol. If you want more information about Modbus protocol, please see the web page :http://www.modicon.com/techpubs/toc7.html	This program is free software and is provided under terms of the GNU Public License. That's mean you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. See the GNU Library General Public License for more details in the COPYING file.====================================== Getting started======================================In this document value with 0x before indicate value in hexadecimal like in C.This library is working only in RTU mode and not in ASCII mode. So, you must to configure every time 8 data bits. RTU mode is better than ASCII mode and I use it every time.A RTU modbus packet look like :	Slave address	1 byte	Function code	1 byte	Data	   	N bytes	CRC16		2 bytesLibModbus don't know all modbus standard function, because I never use bits functions :)Known functions are :code     		function03 (0x03)		read n bytes04 (0x04)		read n bytes06 (0x06)		write 1 byte07 (0x07)		read software status08 (0x08)		line test16 (0x0a)		write n bytesLibModbus us the GNU thread library. This library is generally provided with all Linux distributions.======================================Programming the LibModbus======================================1. Open & Close======================================Before using master and slave functions you need to initialise the serial port with the function :	int Mb_open_device(char device[], 			int speed, 			int parity,			int data_bits_length,			int stop_bits_length);- device is a string who contain the device to open : /dev/ttyS0 for COM1,   /dev/ttyS1 for COM2, etc. - speed indicate the speed in baud rate. Each values are : 50, 75, 110, 134,   150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600,   115200, 230400. If you set another value, the function  use automatically   9600 bauds.- parity is the parity off the frame. 0 indicate don't use parity, 1 indicate   EVEN parity and -1 indicate ODD parity.- data_bits_length indicate the length of the data bits. You can set 7 or   8 bits but in modbus RTU mode only 8 bits work.- data_bits_stop indicate how many bits to send at the end of the frame.   You can set 1 or 2 bits.The serial port is open in bidirectional asynchronous mode. Mb_open_device() save oldest parameters of the serial port to restore them when dial is terminate.For more information about serial port configuration please read man pages : man 2 open, man 2 read, man 2 write and the serial programming HOWTO.At the end of your program you can close and restore the oldest parameters with :	void Mb_close_device(int device);- device indicate the device descriptor returned by the Mb_open_device()  function.2. Master======================================Before send a packet you need to configure it. There is a struct made for it : Mbm_trame. The declaration of the Mbm_trame is declared as below :		struct {			int device;			int slave;			int function;			int address;			int length;			int timeout;		} Mbm_trame;- device indicate the device descriptor returned by Mb_open_device().- slave indicate the slave to call.- function indicate the function to send.- address indicate the address for functions 0x03, 0x04, 0x06, 0x0a. For 0x07   and 0x08 functions, this value isn't use.- length indicate how many data to read or to write to the slave.   This setting is only use for 0x03, 0x04, 0x0a modbus functions.When Mbm_trame done, you can call send the request with 	int Mb_master(Mbm_trame packet,		int data_in[],		int data_out[],		void *ptr_function_send,		void *ptr_function_receive);- packet is the struct Mbm_trame set above- data_in[] is data to send for writing functions. 		  Modbus function 0x06 (send one byte) send only data_in[0].            Modbus function 0x0a (send n bytes) send from data_in[0] to            data_in[packet.length-1] byte.- data_out[] is data answered by the slave on reading function like 0x03,             0x04,0x07. In 0x03 and 0x04 modbus functions data read are             stored from data_out[0] to data_out[packet.length-1] byte.             For the 0x07 function the slave statue is stored in             data_out[0].- ptr_function_send is a function called when master send a data on the                    serial port. If you don't want to call a function set                    NULL. There is a predefined function to print the                    character sent : Mb_snd_print(). See below to know                    more about it.- ptr_function_receive is a function called when master receive a data                       from the serial port. If you don't want to call a                       function set NULL. There is a predefined function                       to print the character received : Mb_rcv_print().                       See below to know more about it.The Mb_master() function compute alone the packet to send, according to the  setting above. The function send the packet and wait the slave answer during the timeout time. If the slave answer before the end of the timeout time, the master function check the slave answered packet, and in the case there isn't failure write data in data_out[] and return the value 0. If you make an error in the setting off the Mbm_trame struct the function return -1 and send nothing.If there is noise on the line, or the slave answer bad data, or the control of the crc16 in the slave packet is wrong, the function return -2 and store nothing in data_out[].If this isn't the right slave who answered, the function return -4 and do nothing with packet received.If the slave don"t answer before the end of the timeout, master function return -3.3. Slave======================================Using slave function is easier as master. The slave function work with a modbus database in 16 bits data defined by the libmodbus : int *Mbs_data;Before using slave function you need to allocate memory area to this pointer with malloc(). For example if you want a database of 1000 byte write at the beginning of your program :    Mbs_data = (int *) malloc( 1000 * sizeof(int));                               ----                                 ^                                 |____ size of your modbus data map.Now you can launch the slave function with :	void Mb_slave(int device,		int slave,		void *ptr_function_send,		void *ptr_function_receive,		void *ptr_function_end);- device indicate the device descriptor returned by Mb_open_device().- slave indicate the slave number.- ptr_function_send is a function called when slave send a data on the                    serial port. If you don't want to call a function set                    NULL. There is a predefined function to print the                    character sent : Mb_snd_print(). See below to know                    more about it.- ptr_function_receive is a function called when slave receive a data from                       the serial port. If you don't want to call a                       function set NULL. There is a predefined function                       to print the character received : Mb_rcv_print().                       See below to know more about it.- ptr_function_end is a function called when slave finish to send answer                   to the master. If you don't want to call a function set                   NULL.The slave function wait data from the serial port. When master send a byte equal to his slave number, the slave read all the packet, check the crc16 and if all is right write or read modbus datamap(Mbs_data[]) according to the master request, compute and send answer.This function make a thread for running and to wait data from the serial port in an another task. That way calling Mb_slave() is very quick and the main program continue his way. So you can work with the modbus datamap. It's of course possible to write and read in Mbs_data[] during the execution of the Mbs_slave() function.You can know the pid of the slave function. It's stored in a integer defined by the libmodbus : int Mbs_pid;To stop the slave function you can call :	void Mb_slave_stop(void);This function stop the slave function and clean all threads. After this function you can recall the Mb_slave() without problems. Be careful ! Don't launch several Mb_slave() function in the same time, because there will be a mix between data of both functions and cause wrong data and also bugs.4. Misc.======================================int Mb_verbose;To debug your program - and the library :) - you can switch on Mb_verbose to 1.This integer is defined by the libmodbus. Set to 1 indicate master and slave function to write everything about the communication on the standard output (usually your screen).If you don't use this integer master and slave are automatically without verbose.int Mb_status;If you use slave function with the 0x07 modbus function, slave return status of your program. This status is defined by the libmodbus in a 16 bit variable.You can store every thing that you want in this data between 0 and 65535.You can know the version of the libmodbus calling the function :		char *Mb_version(void);Maybe one day there will be newest version...Function pointer :When you launch master or slave you can indicate function to call when receive or send a data. In the libmodbus there is one function predefined for each action :		void Mb_rcv_print(unsigned char c);This function print in the standard output : "receiving byte ->" and the character in hexadecimal and decimal mode.		void Mb_snd_print(unsigned char c);This function print in the standard output : "sending byte ->" and the character in hexadecimal and decimal mode.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩中文字幕一区二区| 欧美日本一区二区三区四区 | 日韩限制级电影在线观看| 国产精品一区二区在线播放| 亚洲综合一二三区| 国产精品久久久久久久久久久免费看 | 日韩欧美一二区| 91免费小视频| 粉嫩蜜臀av国产精品网站| 亚洲18色成人| 亚洲美女偷拍久久| 欧美色中文字幕| 成人av在线观| 国产精品亚洲第一区在线暖暖韩国 | 国产成人一区在线| 国产精品每日更新| 色狠狠一区二区三区香蕉| 亚洲第一主播视频| 国产亚洲综合在线| 欧美中文一区二区三区| 九九视频精品免费| 亚洲免费av观看| 精品入口麻豆88视频| 成人a免费在线看| 日本在线不卡一区| 国产精品蜜臀在线观看| 欧美久久高跟鞋激| 国产伦精品一区二区三区视频青涩| 亚洲欧美日韩国产综合在线| 日韩丝袜美女视频| av一本久道久久综合久久鬼色| 亚洲国产日韩精品| 国产精品女主播av| 91精品国产综合久久福利软件 | 日本不卡中文字幕| 国产精品网站在线| 在线不卡中文字幕| www.亚洲色图.com| 麻豆精品国产传媒mv男同| 亚洲欧洲av在线| 欧美精品一区二区三区蜜桃| 欧洲激情一区二区| 成人午夜电影久久影院| 美腿丝袜亚洲色图| 午夜精品福利一区二区蜜股av | 91精品国产色综合久久| 91麻豆产精品久久久久久| 国产精品中文有码| 日本成人在线看| 洋洋av久久久久久久一区| 国产精品毛片久久久久久久| 日韩欧美在线不卡| 欧美日韩成人在线| 在线视频综合导航| 成年人国产精品| 国产久卡久卡久卡久卡视频精品| 丝袜美腿高跟呻吟高潮一区| 亚洲黄网站在线观看| 最新久久zyz资源站| 国产亚洲一区二区三区在线观看| 7878成人国产在线观看| 欧美三级韩国三级日本三斤| 色婷婷亚洲综合| 一本大道av伊人久久综合| 成人一区二区三区中文字幕| 韩国成人精品a∨在线观看| 久久爱www久久做| 奇米精品一区二区三区四区| 午夜视频在线观看一区二区| 亚洲综合一区二区三区| 亚洲日本在线看| 亚洲成av人片一区二区梦乃| 亚洲欧美日韩国产综合在线| 亚洲欧美日韩人成在线播放| 亚洲视频狠狠干| 亚洲精品中文在线影院| 亚洲免费av观看| 亚洲国产欧美日韩另类综合 | 久久国产人妖系列| 久久精品99久久久| 久88久久88久久久| 国产精品影音先锋| 国产成人午夜精品5599| 福利电影一区二区| jlzzjlzz欧美大全| 色欧美88888久久久久久影院| 一本一本大道香蕉久在线精品| 99国产欧美另类久久久精品 | 欧美天堂一区二区三区| 欧美影院精品一区| 在线成人免费视频| 精品国产凹凸成av人导航| 久久久久国产精品麻豆ai换脸| 国产清纯白嫩初高生在线观看91 | 久久国产欧美日韩精品| 国产一区二区导航在线播放| 成人性生交大片免费看视频在线| 成人免费毛片aaaaa**| 日本韩国欧美国产| 777色狠狠一区二区三区| 日韩久久精品一区| 中文久久乱码一区二区| 亚洲午夜激情av| 精品一区二区三区在线观看| 成人午夜精品在线| 欧美日韩国产乱码电影| 日韩欧美色电影| 中文字幕在线不卡国产视频| 午夜精品久久久| 国产91在线观看丝袜| 欧美xxxxx牲另类人与| 国产女人水真多18毛片18精品视频| 久久精品日产第一区二区三区高清版 | 日韩久久精品一区| 中文字幕视频一区二区三区久| 亚洲午夜在线电影| 国产传媒欧美日韩成人| 欧美日韩一区高清| 国产日韩欧美a| 亚洲成人av电影在线| 国产麻豆成人精品| 欧美日韩一卡二卡三卡 | 亚洲一区二区三区四区五区黄| 久久国产精品99久久人人澡| eeuss鲁一区二区三区| 日韩欧美一级精品久久| 中文字幕亚洲电影| 精品一区二区免费| 欧洲亚洲国产日韩| 国产精品天美传媒| 另类专区欧美蜜桃臀第一页| 日本韩国一区二区三区| 欧美国产日韩精品免费观看| 天天操天天综合网| 91丨九色丨蝌蚪富婆spa| wwww国产精品欧美| 日韩精品五月天| 日本高清免费不卡视频| 久久精品欧美日韩精品| 奇米四色…亚洲| 欧美日韩成人激情| 一区二区国产视频| 99精品视频一区| 中文字幕欧美国产| 国产一区视频在线看| 91麻豆精品国产自产在线| 亚洲欧美日韩国产综合在线| 成人丝袜视频网| 国产视频一区二区三区在线观看| 日本vs亚洲vs韩国一区三区| 欧美色区777第一页| 亚洲精品中文字幕乱码三区| 成人高清免费观看| 国产日产欧美精品一区二区三区| 久久精品99国产精品日本| 欧美精品一卡两卡| 性久久久久久久| 欧美日韩电影在线播放| 亚洲香肠在线观看| 欧美日韩在线亚洲一区蜜芽| 亚洲一区二区三区三| 欧洲视频一区二区| 亚洲成人激情综合网| 欧美日韩午夜影院| 视频在线在亚洲| 91精品免费观看| 久久成人免费网站| 精品国产乱码久久久久久浪潮| 青青草97国产精品免费观看 | 中文字幕在线观看一区二区| 成人午夜电影久久影院| 国产精品乱人伦一区二区| 福利一区在线观看| 日本一区二区不卡视频| 91亚洲精品久久久蜜桃网站 | 成人h版在线观看| 中文字幕日韩一区| 91论坛在线播放| 亚洲第一主播视频| 欧美电视剧在线看免费| 国产精品伊人色| 国产精品乱码久久久久久| 91美女在线视频| 亚洲成av人片在线观看无码| 日韩一区和二区| 国产在线观看免费一区| 中文字幕乱码日本亚洲一区二区| 成人黄色软件下载| 亚洲综合免费观看高清在线观看| 欧美日韩国产影片| 久久精品国产亚洲5555| 欧美国产成人精品| 在线看国产一区二区| 日韩高清国产一区在线| 国产日韩影视精品| 91在线porny国产在线看| 日韩欧美亚洲国产另类| 成人av在线网| 日韩高清一区二区| 国产精品美女www爽爽爽|