Está en la página 1de 23

Interfacing Embedded System with Computer Software Using VB.

Presented by :- Sulaiman Salim AL Habsi

Why VB.NET ????????
• New implementation of classic VB on .NET framework . • Object Oriented Programming Language . • Very close to human language . • Not case sensitive . • Easier Graphical User Interface (GUI).

.Data types and Declaration • • • • • • • int  Integer string  String double  Double char  Char bool  Boolean Dim [variable name] As [data type]. Do not use semicolon !!!!! .

statement • Loop • Do Until (condition) • -statement • loop .Function and Loops • While loop • Do While (condition) • .

Functions and loops • For loop • • • • For [variable name]=init To [max] -statement Next For each (google) .

Function • Public Sub functionName(ByRef f As Integer) • End Sub .

Function • Public Function R_function(ByVal h As String) As String • • Return "String" End Function .

DLL • • • • Use ready code Intermediate language for all .NET frame work Add to the project Import to the class .

• If you are behind a web proxy you’ll need to but proxy setting .URL request • URL request are used request a html document from a web server . .

ReadLine() End While .OpenRead New StreamReader(stream) While Not isr.How to make a URL requist • • • • • • • • Imports System.IO New webClient New stream = webClient.Net Imports System.EndOfStream str += isr.

port) • proxy. “pass".Credentials = cr • Dim stoper As Boolean = True • proxy. “domain") • New WebProxy(“proxyserver".BypassProxyOnLocal = True .Proxy setting • New NetworkCredential(“username".

We need an other solution • Timer is on of the solution of the problem • If your thread task is done then you cant start the thread again . • Some object already have threads • VB does not allow accessing thread form an other thread .Thread • Thread: making the program doing more than one task at the same time .

How to create a thread • • • • Imports Threading ‘ outside the class Dim myThread As Thread myThread = new Thead(addressOf myInfitTask) myThread.start() .

make a other button to request SQU web site in the same time . • 4.Example • • • • Make a http request to Google web site .display the head tag only .modify the code in 3 so you use less redundancy .display full html in a text field 2. . 1. 3.

Serial communication in ES • Atmel AVR microcontrollers .

.Serial communication • Send bits in serial • Less wiring and asynchronous and synchronous • Baud rate is number of bits per second =(F_CPU/16*baud)-1 • voltage level in microcontroller is different from computer (use Max232).


even) UMSEL /URSEL : put to Zero.7.6. odd .8)bits USBS: number of stop bit UPM0/1:parity (none.UBRR : set baud rate UDR : transmit receive data RCX: Data receive complete UDRE:Ready for transition U2X : double the transition baud rate RXEN: Enable Receive Data TXEN: Enable Transmit Data UCPOL: Using the USART as synchronous or a synchronous UCSZ0/1:select the Size Of data(5. .


.io.Serial port object • • • • • • • • Imports system.ports Define connection configurations Using with Read the buffer using timer Change the ports form the system Some GSM modems use virtual serial port Using AT command to control GSM Modem You can put some of the configuration during the creation of the object.

Create and configure serial port • • • • • • • • • • Imports System.StopBits = StopBits.Parity = Parity.Ports Dim serialport As new SerialPort With serialport .DataBits = 8 .Open() End With .One .PortName = “COM1" .None .IO.BaudRate = 9600 .

example • Write a program in VB.12/embedded) that receive a message (number from a web server and display it in a BCD 7 segments in the testing board) use the URL (http://172.

If you are enemy of Proprietary software • You can use shell script to access your computer hard ware and web servers . • You can use a GSM/GPRS modem to direct access the internet with out the need for • You can user javacomm library to access you computer hard ware and make URL request . • Smart phone already have application to handle web events and send notifications . • You can follow the new project www. • Or any other Opensource languages like python .