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

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

?? readme

?? modbus linux libiary!
??
字號(hào):
=============================================================================                               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
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一本一本久久a久久精品综合麻豆| 麻豆精品视频在线观看视频| 国产一区在线观看麻豆| 在线视频国内一区二区| 国产亚洲福利社区一区| 日本怡春院一区二区| 日本道精品一区二区三区| 国产日韩欧美麻豆| 男女男精品网站| 欧美日韩情趣电影| 亚洲摸摸操操av| 国产91丝袜在线观看| 精品三级av在线| 日本美女视频一区二区| 欧美伊人精品成人久久综合97 | 欧美一区二区三区性视频| 一区二区三区久久| voyeur盗摄精品| 久久久久88色偷偷免费| 麻豆91免费看| 51午夜精品国产| 丝袜亚洲精品中文字幕一区| 欧美亚洲尤物久久| 亚洲欧美另类久久久精品2019| 成人涩涩免费视频| 久久久久国产精品厨房| 精东粉嫩av免费一区二区三区| 欧美精品乱人伦久久久久久| 亚洲一区二区三区四区在线 | 99久久夜色精品国产网站| 精品国产乱码久久久久久影片| 视频一区二区三区入口| 欧美日韩国产经典色站一区二区三区| 亚洲黄色尤物视频| 色妹子一区二区| 亚洲精品成人a在线观看| 色综合欧美在线| 亚洲激情成人在线| 色播五月激情综合网| 一区二区三区高清| 91福利在线免费观看| 一区二区高清免费观看影视大全 | 国产福利一区在线| 久久久精品综合| 成人午夜短视频| 中文字幕在线不卡一区二区三区| 福利一区二区在线| 国产精品国模大尺度视频| 97精品国产露脸对白| 亚洲婷婷在线视频| 一本色道久久综合亚洲91| 伊人婷婷欧美激情| 欧美日韩你懂得| 麻豆91免费看| 国产三级一区二区| 91网页版在线| 亚洲高清免费观看| 91精品国产aⅴ一区二区| 老汉av免费一区二区三区| 久久亚洲一区二区三区明星换脸| 国产盗摄女厕一区二区三区| 中文字幕精品—区二区四季| 91麻豆免费观看| 亚洲成年人影院| 久久综合丝袜日本网| 高清成人在线观看| 亚洲一区在线视频| 日韩免费视频一区| 岛国精品在线观看| 一区二区三区**美女毛片| 欧美一区二区三区影视| 国产成人av一区| 一区二区三区鲁丝不卡| 日韩丝袜情趣美女图片| 国产aⅴ精品一区二区三区色成熟| ...av二区三区久久精品| 欧美精品在欧美一区二区少妇| 久久99精品视频| 国产精品福利电影一区二区三区四区| 欧美在线观看视频一区二区| 日本va欧美va欧美va精品| 亚洲国产精品激情在线观看| 欧洲国内综合视频| 久久99久久99精品免视看婷婷| 中文字幕久久午夜不卡| 欧美日韩色综合| 国产成人精品三级麻豆| 亚洲国产另类精品专区| 久久久精品2019中文字幕之3| 色综合久久99| 国内精品国产三级国产a久久| 亚洲精品成人a在线观看| 精品欧美一区二区在线观看| 国产伦精品一区二区三区在线观看| 亚洲柠檬福利资源导航| 日韩精品一区二区三区视频在线观看| 成人18视频日本| 麻豆一区二区99久久久久| 亚洲女与黑人做爰| 久久亚洲私人国产精品va媚药| 在线观看日韩高清av| 国产一区福利在线| 亚洲高清免费观看高清完整版在线观看| 久久久亚洲精华液精华液精华液| 欧美色图天堂网| 高清不卡一区二区| 麻豆91免费观看| 亚洲国产视频一区| 国产精品免费久久| 欧美变态tickle挠乳网站| 国产午夜亚洲精品午夜鲁丝片| 欧美日韩五月天| 99riav久久精品riav| 久久99国产精品久久99| 亚洲 欧美综合在线网络| 国产精品不卡一区| 久久新电视剧免费观看| 在线不卡中文字幕| 在线观看网站黄不卡| eeuss鲁片一区二区三区在线观看| 久久国产精品无码网站| 亚洲成人动漫精品| 亚洲免费在线观看| 国产精品国产三级国产a| 精品国产免费人成在线观看| 欧美精品第1页| 欧美性生活影院| 99久久99久久精品免费观看| 国产成人免费在线视频| 美女视频免费一区| 日本欧美在线观看| 亚洲国产视频直播| 一二三区精品视频| 成人免费在线视频观看| 国产欧美一二三区| 久久精品人人做人人爽人人| 亚洲精品一区二区三区四区高清| 51久久夜色精品国产麻豆| 欧美日韩亚洲不卡| 欧美系列亚洲系列| 欧美怡红院视频| 欧美亚洲一区三区| 欧美性受xxxx黑人xyx性爽| 91成人网在线| 97精品电影院| 色999日韩国产欧美一区二区| 91丨porny丨国产| 91视频一区二区三区| jizzjizzjizz欧美| 色综合久久88色综合天天6| 色呦呦日韩精品| 91福利国产精品| 欧美三级中文字幕| 欧美二区在线观看| 欧美一级艳片视频免费观看| 欧美一区二区三区四区五区 | 在线不卡一区二区| 欧美一区二区在线视频| 91精品国产黑色紧身裤美女| 91麻豆精品国产自产在线观看一区| 在线不卡a资源高清| 日韩午夜三级在线| 精品国产乱码久久久久久图片 | 国产精品久久久久久久久免费桃花| 久久精品视频在线看| 国产精品乱人伦| 亚洲少妇中出一区| 一区二区三区国产| 日韩高清在线一区| 狠狠色丁香婷婷综合| 国产成人在线电影| 91视视频在线观看入口直接观看www | 亚洲午夜电影网| 天天影视涩香欲综合网| 另类人妖一区二区av| 国产精品一区二区黑丝| 99vv1com这只有精品| 欧美日韩国产乱码电影| 欧美mv和日韩mv的网站| 国产日产欧美精品一区二区三区| 中文字幕色av一区二区三区| 亚洲激情综合网| 免费观看在线综合色| 国产福利一区二区三区视频在线| 成人18精品视频| 欧美日韩高清一区二区三区| 精品国产一区二区三区不卡 | 亚洲国产精品精华液ab| 一区二区三区在线高清| 日韩国产精品久久| 国产高清亚洲一区| 在线免费不卡电影| 欧美成人一区二区三区片免费| 国产免费成人在线视频| 亚洲一区二区三区四区在线| 精品一区二区三区蜜桃| 一本到一区二区三区| 日韩一区二区三| 国产精品美女一区二区三区| 图片区日韩欧美亚洲|