Amazines Free Article Archive
www.amazines.com - Monday, December 23, 2024
Read about the most recent changes and happenings at Amazines.com
Log into your account or register as a new author. Start submitting your articles right now!
Search our database for articles.
Subscribe to receive articles emailed straight to your email account. You may choose multiple categories.
View our newest articles submitted by our authors.
View our most top rated articles rated by our visitors.
* Please note that this is NOT the ARTICLE manager
Add a new EZINE, or manage your EZINE submission.
Add fresh, free web content to your site such as newest articles, web tools, and quotes with a single piece of code!
Home What's New? Submit/Manage Articles Latest Posts Top Rated Article Search
Google
Subscriptions Manage Ezines
CATEGORIES
 Article Archive
 Advertising (133574)
 Advice (161671)
 Affiliate Programs (34799)
 Art and Culture (73858)
 Automotive (145718)
 Blogs (75618)
 Boating (9851)
 Books (17224)
 Buddhism (4130)
 Business (1330880)
 Business News (426454)
 Business Opportunities (366524)
 Camping (10973)
 Career (72795)
 Christianity (15852)
 Collecting (11638)
 Communication (115089)
 Computers (241958)
 Construction (38967)
 Consumer (49954)
 Cooking (17080)
 Copywriting (6733)
 Crafts (18203)
 Cuisine (7549)
 Current Affairs (20322)
 Dating (45910)
 EBooks (19703)
 E-Commerce (48272)
 Education (185530)
 Electronics (83525)
 Email (6438)
 Entertainment (159862)
 Environment (28995)
 Ezine (3040)
 Ezine Publishing (5454)
 Ezine Sites (1551)
 Family & Parenting (111009)
 Fashion & Cosmetics (196613)
 Female Entrepreneurs (11853)
 Feng Shui (134)
 Finance & Investment (310622)
 Fitness (106492)
 Food & Beverages (63057)
 Free Web Resources (7941)
 Gambling (30227)
 Gardening (25202)
 Government (10519)
 Health (630169)
 Hinduism (2206)
 Hobbies (44083)
 Home Business (91743)
 Home Improvement (251239)
 Home Repair (46252)
 Humor (4727)
 Import - Export (5460)
 Insurance (45104)
 Interior Design (29619)
 International Property (3488)
 Internet (191027)
 Internet Marketing (146690)
 Investment (22861)
 Islam (1161)
 Judaism (1352)
 Law (80500)
 Link Popularity (4596)
 Manufacturing (20927)
 Marketing (99325)
 MLM (14140)
 Motivation (18236)
 Music (27000)
 New to the Internet (9498)
 Non-Profit Organizations (4048)
 Online Shopping (129741)
 Organizing (7813)
 Party Ideas (11855)
 Pets (38165)
 Poetry (2229)
 Press Release (12691)
 Public Speaking (5643)
 Publishing (7566)
 Quotes (2407)
 Real Estate (126830)
 Recreation & Leisure (95495)
 Relationships (87677)
 Research (16182)
 Sales (80357)
 Science & Technology (110298)
 Search Engines (23521)
 Self Improvement (153317)
 Seniors (6222)
 Sexuality (36012)
 Small Business (49336)
 Software (83053)
 Spiritual (23535)
 Sports (116155)
 Tax (7664)
 Telecommuting (34070)
 Travel & Tourism (308286)
 UK Property Investment (3123)
 Video Games (13382)
 Web Traffic (11794)
 Website Design (56938)
 Website Promotion (36665)
 World News (1000+)
 Writing (35845)
Author Spotlight
VINCENT BOSSLEY

Vincent Bossley is a publisher and sailor living on the Northern Beaches of Sydney Australia. He has...more
SHOEB SIDDIQUE

From the time of study, i had a keen interest in acquiring knowledge by surfing on the Internet. Mea...more
RODRIGO DARZI

Pai da Júlia e do Pedro. Especialista em Marketing Digital, com MBA em e-Business pela FGV. Formado ...more
DAVID PAYNE

Technology without a doubt has made things easier for us. However, that being said, it has also comp...more
K HO

Affiliate marketer - I enjoy the challenge of what the internet has to offer. It has given me the o...more


Based on VC + + for bottle machine computer control system of serial communication by big tree





Article Author Biography
Based on VC + + for bottle machine computer control system of serial communication by
Article Posted: 07/30/2010
Article Views: 51
Articles Written: 1033
Word Count: 1119
Article Votes: 0
AddThis Social Bookmark Button

Based on VC + + for bottle machine computer control system of serial communication


 
Business,Business News,Business Opportunities
Introduction Bottle machine computer control system's basic function is to control the various machine bottle machine movement, to work in accordance with set procedures. In order to achieve the host and the next bit plane between the control operations and data management, through the serial port connection with data acquisition and control functions of the lower position, and then by the operator through the operation of PC management software to operate the command passed to the lower machine to complete the kind of control and management, therefore, serial Communicate Technology is the bottle machine computer control system development one of the key technologies.


VC environment in the bottle machine computer control system, the PC host computer's communication program, its serial communication programming method there are three: Using VC + + provides MSComm control to realize serial communication, based on a a serial communication C + + classes, based on serial communications API. For simple serial port, the first two are relatively easy to achieve, is also more convenient to use, simple control. However, for the more complex serial port, it is not flexible enough. The serial programming method based API is a powerful, controls more freedom and flexibility, you can write effective and powerful communication process. On the lower machine, because the storage capacity is limited, if you want to store large amounts of data will produce loss phenomenon, the data stored in PC database, you can make up for this issue. Because VC + + offers a variety of database access technologies such as ODBC, O LED B, ADO, etc., which are based on OLEDB, ADO technology to access interface, it inherits the advantages of the technique OLEDB, OLEDB interface and made package, and defines the ADO object, it can be simplified program development, and technology-based ADO applications can be accessed through a consistent interface to a variety of data, but also conducive to the migration and expansion program.


Analysis based on the above considerations, the author focuses on the VC + +, how to use the API functions and ADO database programming technology to achieve real-time data acquisition, while real-time data saved to the database, thus completing the bottle machine computer control system between the host and the lower computer and display data in real-time operation of specific methods.


Serial communication function using WindowsAPI In the Windows environment, the serial port is part of system resources, when the data from the CPU through the serial port to send out, the byte data is converted to serial bit; in receiving data, the serial bit further will be converted to byte data. Application to use the serial port to communicate, we must make use of resources to the operating system before the application (open serial port), but also set the serial communication address, baud rate, parity, data bits and stop bits and other related configuration, communication Upon completion, it must release the resources (close serial port).


Open the serial port Serial communication procedure to call CreatFile () function since the function's return value is a handle. Can then use the other port operations. Once the port is open, you can automatically assign a send / receive buffer, of course, can also transfer SetComm () function to change the send / receive buffer size.


1.2 serial configuration Serial port to open is successful. Then the serial port should be initialized to configure the serial port communication parameters such as baud rate, data bits, stop bits, parity bit and so on. Modify these parameters using the device control block DCB (DeviceControlBlock). DCB is a complex structure of the data, nearly 30 members; However, a 3-line serial communication is, DCB structure of most of the parameters can not, just set such as baud rate, data bits, stop bit, parity bit, and several other key parameters can be normal work. Windows also provide GetCommState () function to obtain the serial interface of the current configuration, it can be used SetCommState () to re-configure the serial interface of the various parameters.


1.3 serial read / write operations
Win32API through the program can use the ReadFile () function to read data from the serial port, or use the WriteFile () function to write data to the serial port. If the serial interface communication error (such as the occurrence of terminal error, parity error, etc.), I / O operation will be terminated. At this point, if the procedure is necessary to further the implementation of the serial interface I / O operations, you must call ClearCommError () function to restore the serial interface.


ClearCommError () function has two functions: First, clear the error condition; the second is to identify the serial interface communication status. In addition, the serial interface, the system providing a group of communication events and the corresponding handler. Windows system can be monitored in the process occurred in the serial interface of this group of events, therefore, the application does not check port in the state where you can know when certain conditions occur. Using these events, the application will not need to receive bytes and continuous detection of the port, thus saving CPU time.


Close serial port The program finished, back when Windows environment, typically the serial port should be closed to other uses. Can use the function C10seHandle (HandlehObject) to stop all serial input and output, parameter hObject is the CreateFile function returns, the mark serial communication handle.


2 VC + + in the database using ADO
Initialize OLE / COM library environment Create a standard MFCAppWizard (exe) application, but also in the application class InitInstance function initialize the OLE / COM libraries (because ADO library is a COMDLL library), its code is as follows:


The introduction of ADO library Before using ADO, you must project stdafx. h file # import directly into sign to lead AADO library files, so the compiler can be built correctly. The code is as follows:


2.3 for database operation using smart pointers
ADO library contains three smart pointers: _ConnectionPtr, _CommandPtr, _RecordsetPtr. One _ConnectionPtr often used to open and close a database connection. For the purpose of library connections, can first create an instance of the pointer, and then Open to open a database connection. Below to connect to the database db. mdb example to illustrate:


_ConnectionPtr ConnectPtr; ConnectPtr. CreateInstance ("ADODB.Connection ");// create an instance of the pointer


ConnectPtr-> Open ("P

I am China Manufacturers writer, reports some information about metal lunch boxes , sink mat.

Related Articles - metal lunch boxes, sink mat,

Email this Article to a Friend!

Receive Articles like this one direct to your email box!
Subscribe for free today!

 Rate This Article  
Completely useless, should be removed from directory.
Minimal useful information.
Decent and informative.
Great article, very informative and helpful.
A 'Must Read'.

 

Do you Agree or Disagree? Have a Comment? POST IT!

 Reader Opinions 
Submit your comments and they will be posted here.
Make this comment or to the Author only:
Name:
Email:
*Your email will NOT be posted. This is for administrative purposes only.
Comments: *Your Comments WILL be posted to the AUTHOR ONLY if you select PRIVATE and to this PUBLIC PAGE if you select PUBLIC, so write accordingly.
 
Please enter the code in the image:



 Author Login 
LOGIN
Register for Author Account

 

Advertiser Login

 

ADVERTISE HERE NOW!
   Limited Time $60 Offer!
   90  Days-1.5 Million Views  

 

Great Paranormal Romance


TIM FAY

After 60-plus years of living, I am just trying to pass down some of the information that I have lea...more
LAURA JEEVES

At LeadGenerators, we specialise in content-led Online Marketing Strategies for our clients in the t...more
ADRIAN JOELE

I have been involved in nutrition and weight management for over 12 years and I like to share my kn...more
STEVERT MCKENZIE

Stevert Mckenzie, Travel Enthusiast. ...more
GENE MYERS

Author of four books and two screenplays; frequent magazine contributor. I have four other books "in...more
DONNIE LEWIS

I'm an avid consumer of a smoothie a day living, herbs, vitamins and daily dose of exercise. I'm 60...more
ALEX BELSEY

I am the editor of QUAY Magazine, a B2B publication based in the South West of the UK. I am also the...more
SUSAN FRIESEN

Located in the lower mainland of B.C., Susan Friesen is a visionary brand strategist, entrepreneur, ...more
STEPHEN BYE

Steve Bye is currently a fiction writer, who published his first novel, ‘Looking Forward Through the...more
STEVE BURGESS

Steve Burgess is a freelance technology writer, a practicing computer forensics specialist as the pr...more

HomeLinksAbout UsContact UsTerms of UsePrivacy PolicyFAQResources
Copyright © 2024, All rights reserved.
Some pages may contain portions of text relating to certain topics obtained from wikipedia.org under the GNU FDL license