High Tech Services is a systems integrators in North Carolina NC for industrial, laboratory, factory automation, controls, monitoring, quality and information systems   Home   Products   Contents   Search   Contacts

ASP.NET asp dot net

Bar Codes

Books

C # sharp

CE.NET Compact Framework

Communications

Computers

Control Engines

Data Acquisition

Databases

Enclosures

ERP Framework

Factory Automation

History

Image Analysis

Infrastructure

Inputs Outputs I/O

Machine Vision

mechanical & machine design

microscopy

Miscellaneous

Motion Control

Motors & Drives

.NET

Networks

OPC OLE Process Control

Operator Interfaces

PDA Pocket PC Windows Mobile

Peripherals

process control

Power & Grounding

Products

Programmable Controllers

Quality Control

Radio Frequency RF Tags

Reference

Robots

Safety

SCADA

Signal Conditioning

Soft PLCs

Systems Architecture

Tools & Equipment

Training

Tutorials

Vertical Applications

Visual basic

 

VB, C#, ASP.NET, Pocket PC, & CE.NET for Industrial, Laboratory, & Manufacturing Automation

Example Programs

 

visual basic vb .net C# csharp asp vb6 free example source code tutorial factory laboratory industrial manufacturing automation systems

Sorry if things look a little out of sync around here.  There are a lot of improvements going on. 

We finally changed web hosts to a Windows based server with FrontPage 2002 extensions and .NET -- so that you can run the ASP.NET versions of the applications on-line.  Needless to say, running ASP.NET on our local servers is much easier than getting everything set-up on a web host.  Bear with us while we try to get all the problems worked out with our web host.  In the meantime, you can still download the source code, compile (build) it, and run it -- you just can't run it on-line. 

We are upgrading all of our sample code to VB.NET and C# and will keep the VB6 code for people that have not migrated yet.  Another reason for having the VB6, VB.NET, and C# code available is to help people learning .NET to see the changes. 

For you lite fans, we are also adding code for PocketPC and CE.NET.  Using all of these versions will definitely effect our programming guidelines to try to stay compatible across all platforms. 

 

What are we trying to do and how best to do it?

There are three primary functions the software we write performs: control, monitoring, and distribution of information.  Note that we don't advocate using ASP.NET for control.  Depending upon the application -- ASP.NET is probably not the best solution for monitoring either.  For distribution of information -- if you want a web based configuration -- then ASP.NET is definitely a good choice.  We still prefer VB.NET or C# for control and monitoring.  We like VB.NET or C# for distribution of information also.  We like the capabilities of a VB.NET or C# rich / fat / intelligent client instead of a poor / lean / dumb browser. 

There is a lot of overhead involved with ASP.NET and getting real-time, consistent response time is a challenge.  However, as a reporting tool of process data -- ASP.NET definitely make sense.  The main reason we are showing ASP.NET here is so that you can see the examples without having to download the code, unzip it, load it into Visual Studio, build the solution, and then run it.  Using ASP.NET -- you should be able to run the examples on-line. 

 

Commenting Conventions

Coding conventions (standards) are a great thing to have so that every piece of code looks familiar.  To some extent every company has their own coding standards.  For example, we are not big on having a huge block of comments at the start of every function that tell you what the function name and passed variable names already tell you.  But some other companies still insist on this.  This practice started many years ago when function and variable names were limited to eight characters and therefore usually cryptic. 

We prefer "self documenting code" and save comments for information that is not obvious.  For example:

Public Sub SendCommandToRobot(byval strRobotCommand as string)

You could waste a lot of time and space writing comments that:

  • This is a subroutine
  • The name of this subroutine is SendCommandToRobot
  • The purpose of this subroutine is to send commands to the robot
  • This subroutine takes one argument
  • The argument passed to this subroutine is a string
  • The argument passed to this subroutine is the command you want to sent to the robot

But none of these comments would tell another programmer anything new -- in other words, we are wasting everyone's time by writing comments that tell you the same thing as what was "self documented". 

A comment that would be important here is something like:

' This subroutine enters robot commands into a queue of commands going to the robot

in which case, we probably should have named our subroutine  "PutRobotCommandIntoQueue". 

visual basic vb .net C# csharp asp vb6 free example source code tutorial factory laboratory industrial manufacturing automation systems

Coding Conventions

Note that when you receive VB 6 they hit you over the head with coding conventions.  Coding conventions are an excellent idea.  Hopefully, all of our VB6 example code follows our published VB6 coding conventions (do as we say -- not as we do). 

Many of the VB.NET and C# books are good as far as teaching the language -- but their coding conventions range from inconsistent to terrible!  In a rush to get the first books out, most of the books were written several years ago with only the beta versions of .NET and little support.  So it was a lot tougher then. 

For VB.NET and C# we are adopting the coding standards from GotDotNet's FxCop and Microsoft's .NET Framework Design Guidelines.  Surprise, surprise.  Most of the coding conventions that we had been using are out the window.  So please excuse us until we get around to using the coding conventions.  We don't want to discourage using the new coding conventions.  It's just that after writing hundreds of programs and hundreds of thousands of lines of code with other conventions -- it takes a while to convert.  However, we are grateful for GotDotNet's FxCop program that greatly facilitates that transition. 

We found one other link for VB.NET coding standards. 

 

Download Options

There are several versions of each example program:

  1. VB version 6 (when available for old applications -- we are not developing new applications in VB6)
  2. VB.NET
  3. C# -- the new .NET programming language
  4. ASP.NET
  5. PocketPC / CE.NET

 

Support on Message Board / Discussion Group

We want to share all of our knowledge and source code in order to stimulate ideas and discussions and make everyone a better automation programmer.  We hope that you will share your knowledge and source code as well.  But we can't stay in business by spending all of our time helping people for free.  (This "free" business model was tested by many dot com companies and we saw how well that turned out).  Therefore, we set up a message board (discussion group) so that you can post questions and we or others can answer those questions.  Please click on the "Message Board" button in the left column.  Hopefully the message board will foster more discussions and examples.  

 

Source Code User Assumptions

  • You have finished reading Jeff Weigant's book and are at least an intermediate VB or C# programmer.  We are not in the business to teach beginning programmers how to program because there are plenty of websites out there that already do a good job of that. 
  • These examples were created with Visual Basic version 6, VB.NET, and C# professional editions.  
  • We have used various versions of ADO from 2.5 to ADO.NET. 
  • Our .NET code was most likely written with Visual Studio 2003 -- so it will not open in VS 2002. 

visual basic vb .net C# csharp asp vb6 free example source code tutorial factory laboratory industrial manufacturing automation systems

Example 1 

Test to make sure you have a basic understanding of VB / C#.  We're not trying to be mean -- but this is not an introduction to VB / C#.  There are many other great websites that cater to beginning VB and C# programmers -- so we will not duplicate that here.  If you are a beginner we suggest you go to our books page.  

This website is for intermediate to advanced users of Visual Basic C# for automation.  We assume that you already have a good understanding of programming in VB or C#.  If you can not throw buttons and text boxes on a form and tie them together without having to think, then most likely you will not be able to understand writing reports to Excel using objects or loading recipes using ADO.  

However, if you are a persistent and smart beginner then you can probably go through advanced topics, compare them to other information and learn a lot.  If you are a beginner may we suggest that you still go through and view the example programs so that you get an overview of what VB / C# can do.  

 

Example 2

Displaying status of automation devices.  

 

Example 3

Congratulations on your first job as material handling manager and your first material handling sortation project. 

 

Example 4

Selecting file names.  

 

Example 5

A Tale of Two Timers -- beware of the problems presented here.  

 

Excel Examples

Reading and writing to Excel

visual basic vb .net C# csharp asp vb6 free example source code tutorial factory laboratory industrial manufacturing automation systems

ADO Examples

ADO -- reading and writing databases for configuration data, recipes, and other data.  

 

Waste Water Treatment Example

Congratulations on your new job as plant manager at the waster water (sewage) treatment plant.  

 

Serial Communications Examples

RS232, RS422, RS485

 

Ethernet and Winsock

TCP/IP, client / server, windows sockets over Ethernet

 

HTS PDA Tools

Based on our reference data, HTS PDA Tools is a collection of our favorite calculators and tools for Pocket PC devices. 

 

 

We try to offer a fair and balanced opinion on every page of our website.  We would appreciate more information from other users to express their opinions which we will then incorporate.  If you have questions or comments please post them on our message board (see button in left hand column) so that others can read and benefit. 

visual basic vb .net C# csharp asp vb6 free example source code tutorial factory laboratory industrial manufacturing automation systems

Click here to find out how High Tech Services can help you implement this technology. 

Copyright © 1984-2005 CompanyLongName HTS, Cary, Raleigh, RTP, North Carolina, NC.  All Rights Reserved.  All trademarks are the property of their owners. Prices and specifications subject to change without notice.