RS485VBSource

所属分类:串口编程
开发工具:Visual Basic
文件大小:100KB
下载次数:40
上传日期:2007-02-14 03:52:09
上 传 者hanplay
说明:  Serial Port Complete, Programming and Circuits for RS-232 and RS-485 Links and Networks
(Serial Port Complete, Programming and Circuits for RS-232 and RS-485 Links and Networks)

文件列表:
249564 (0, 2011-02-18)
249564\qb (0, 2011-02-18)
249564\qb\qbnetsl.bas (9148, 1998-02-17)
249564\schemat (0, 2011-02-18)
249564\schemat\485net.pdf (78696, 1998-08-24)
249564\stamp (0, 2011-02-18)
249564\stamp\STAMPSL1.BS2 (3122, 1998-02-24)
249564\stamp\STAMPSL2.BS2 (2858, 1998-04-29)
249564\vb (0, 2011-02-18)
249564\vb\485net (0, 2011-02-18)
249564\vb\485net\485net.vbp (989, 1998-04-27)
249564\vb\485net\frmMain.frm (25803, 1998-03-15)
249564\vb\485net\frmMain.frx (196, 1998-03-15)
249564\vb\485net\Nodes.frm (14672, 1998-02-22)
249564\vb\template (0, 2011-02-18)
249564\vb\template\DataFile.frm (4754, 1998-02-17)
249564\vb\template\frmSetup.frm (4864, 1998-04-12)
249564\vb\template\MiscCalc.bas (3534, 1998-03-14)
249564\vb\template\serport.bas (15602, 1998-04-27)

This is the readme file for 485net.zip, which contains a schematic diagram and code for an RS-485 network with a master PC and up to seven slave nodes. The slaves may be Basic Stamp IIs or PCs. The master polls each slave at requested intervals, sends and receives data with each poll, and displays (and optionally stores) the result. The program code includes comments to explain what's happening and why, but some familiarity with Basic Stamps, Visual-Basic programming, and RS-485 interfacing is helpful! If you have questions, suggestions, or other comments about this project, please send them to me by email at jan@lvr.com. Jan Axelson *** Contents of 485net.zip: Schematic diagram of the network connections, in PDF format. Visual Basic 5 code for the master node. Basic Stamp II code for slaves. Quick Basic code for PC slaves. *** Copying the Files For faster and more convenient access, you may copy the files on the floppy to a hard disk. The simplest way to do this is to copy the entire contents, including the subdirectories, to any subdirectory (folder) on your hard disk. The schematic The schematic shows the connections required for a master PC with an RS-232 port, a slave PC with an RS-232 port, and Basic Stamp II slaves. A network may have any combination of PC and Basic-Stamp slaves: all Stamps, all PCs, or a mix. As the schematic shows, the Basic Stamp IIs may use either pins 1 and 2 (Sout and Sin) or any other port bits for network communications. For debugging, I recommend using other port bits because they enable you to connect pins 1 and 2 to a spare PC, which can display debug messages. The Visual-Basic code The code for the master node requires the Professional or Enterprise edition of Visual Basic 5 or higher. (The Learning edition doesn't include the MSComm custom control for serial communications.) The code has been tested under Windows 95. It should also run under Windows NT and Windows ***. The \vb\485net directory contains the project 485net.vbp, which you may load into Visual Basic 5's programming environment. From there, you may run the program, modify it, create an .exe file, or use the code in any way you wish. The project's .vbp file lists the files used by the project. The project's subdirectory contains the project's startup form and other files unique to that project. The project also uses general-purpose files in the \vb\template subdirectory. The general-purpose code includes several routines not used by this application. If you load the projects from the floppy, or if you copy the floppy's contents to hard disk as described above, all project files will be in the expected locations. If a file is in a different location from that specified in the .vbp file, you may load the file in the VB environment by selecting Project, then Add Form or Add Module. To save any new file locations in the .vbp file, select File, Save Project. Another option is to use a text editor to change the file locations in the .vbp file. When you run the application, use the menu options to configure the application for your port number, bit rate, number of nodes and addresses, and whether or not you want to save data to a file. The Basic Stamp II code There are two versions of the Basic Stamp II code. Stampsl2.bs2 is for use when Sout and Sin are the network connection; stampsl1.bs2 is for use with other port bits. Each Stamp must have a unique network address set in its program code. The QuickBasic code I've also included DOS QuickBasic code for use with PC slaves. Each PC slave also must have a unique network address. *** This application is excerpted from the following book: Serial Port Complete, Programming and Circuits for RS-232 and RS-485 Links and Networks by Jan Axelson Published by Lakeview Research ISBN 0-9650819-2-3 Copyright 19***, 306 pages, $39.95. Lakeview Research contact info: Lakeview Research 2209 Winnebago St. Madison, WI 53704 Phone: 608-241-5824 Fax: 608-241-5848 Web: http://www.lvr.com Email: jan@lvr.com Rules for Use All of the files on this disk are provided for your use. You may use any or all portions of the files in your programs and distribute such programs without payment of royalties, if you agree to the following disclaimer: The information, computer programs, documentation, and other material on this disk are provided "as is," without warranty of any kind, expressed or implied, including without limitation any warranty concerning the accuracy, adequacy, or completeness of the material or the results obtained from using the material. Neither the publisher nor the author shall be responsible for any claims attributable to errors, omissions, or other inaccuracies in the material on this disk. In no event shall the publisher or author be liable for direct, indirect, special, incidental, or consequential damages in connection with, or arising out of, the construction, performance, or other use of the materials contained herein. *** File Descriptions, arranged by computer type and programming language readme.txt This file Schematic diagram \schemat\rs485net.pdf Visual Basic 5 files General purpose \vb\template \datafile.frm \frmSetup.frm \MiscCalc.frm \serport.bas Network master node \vb\485net \485net.vbp \frmMain.frm \frmMain.frx \nodes.frm Basic Stamp II programs Network slave node, using port bits for serial I/O. \stamp\stampsl1.bs2 Network slave node, using Sin and Sout for serial I/O. \stamp\stampsl2.bs2 QuickBasic program for DOS Network slave \qb\qbnetsl.bas Alphabetical Directory and File List: readme.txt \qb \qbnetsl.bas \stamp \stampsl1.bs2 \stampsl2.bs2 \vb \485net \485net.vbp \frmMain.frm \frmMain.frx \nodes.frm \template \datafile.frm \frmSetup.frm \MiscCalc.frm \serport.bas

近期下载者

相关文件


收藏者