VS 2008 - Program In Vb To Serial In Data From My Microcontroller

May 18, 2010

I have written a program in vb to serial in data from my microcontroller and it is working good except for one thing. When I try to send the number 26 to vb it just reads a blank I dont know what is going on? The data that I am reading is being converted to int16, and I am using Encoding 28591 and have also tried Encoding 1252. I have also tried a new microcontroller with no success. I dont know if this is a VB problem or a microcontroller program problem.

Dim ReceiveBuffer As String
Dim portname1 As String = "Com5" ' Serial in through this port
Dim portspeed1 As Integer = 19200
Dim WithEvents COMPort As New System.IO.Ports.SerialPort

[CODE]...

View 13 Replies


ADVERTISEMENT

Serial Port To Read Data From Microcontroller?

Aug 9, 2010

<!-- /* Font Definitions */ @font-face {font-family:Wingdings; panose-1:5 0 0 0 0 0 0 0 0 0; mso-font-charset:2; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:0 268435456 0 0 -2147483648 0;} @font-face {font-family:"Cambria
Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-

[code]....

View 9 Replies

HSD 32 Bit Data Bus To Serial Converter Via A Microcontroller - Data Sniffer To Read The Data Bus (32Bit)

Sep 3, 2008

Im working on a HSD 32 bit data bus to serial converter via a microcontroller. Now first I want to make a sort of data sniffer to read the data bus (32Bit) .All on the controller side is working and the stream of bytes are coming in via RS232 as 4 bytes in HEX like FD,A5,45,8B . I already converted the bytes in Dec and ASCII to determine what is passed true the bus and how fast and stuff.. Now that is all correct and working very well if the LSB (least significant bit) of the 32 data bus is Data line 0 and the MSB (most significant bit) is Data line 31 but if that is not the case I need to invert the 32Bits (like as I would invert the connector on the bus) . How do I best do this using the 4 bytes I send from the micro controller.

Example:

(MSB) 01001000 01100101 01101100 01110000 (LSB)
HEX= 48 65 6C 70
DEC= 72,101,108,112
ASCII= H E L P

I need to invert it with a button to:

(MSB) 00001110 00110110 10100110 00010010 (LSB)
HEX= 0E 36 A6 12
DEC= 14,54,166,18
ASCII= (SO) 6 : (DC2)

View 3 Replies

Write An Application For Receiving Data (ascii Characters) From Microcontroller Through The Serial Port In Three Separate Parts

Jul 18, 2009

I need to write an application for receiving data (ascii characters) from microcontroller through the serial port in three separate parts. I've created three RichTextBoxes, but I do not know which commands I need to type. In first textbox I need to receive one byte... next six bytes need to be placed in second text box, and finally last seven bytes need to be placed in third textbox.

View 11 Replies

Communications :: RS232-USB Converter - Send Data To Microcontroller

Mar 13, 2009

I have a problem regarding rs232-usb converter... I'm using toshiba laptop. The problem i faced is i can receive data from my microcontroller to VB but i cant send data to microcontroller... However, when i use the same VB code and same converter, i try at my friend laptop (other brand), it works... May i konw is there any other setting i need to set for my laptop??

View 3 Replies

Send Data On Serial Port And Detecte It In Same Program?

Feb 24, 2011

I am supposed to make a software for data logging via serial port but the hardware is expected to be delayed and iam required to continue with the programming of the software. What i need is that by some mechanism i want to send data on serial port (COM port) and after delay of some mili seconds i want to detect that data. I actually want to do this because i want to create environment like my software i intercepting COM port and on receiving data it captures the data values on port and record them to database. I have done most the work, the only thing left which i want is as above how i will send data on COM port (this was to actually to be done by hardware) and detect it in my program (same program from which data was sent). Please guide from where should i start.

View 3 Replies

VS 2008 Serial Data - Make Sure The Correct Data Is Received?

Jun 28, 2009

I am using Visual Basic express to create a serial interface to a multi-room audio controller. I have started by creating a form that can connect to the controller and I can receive data from the Controller and display Zone status, volume etc in corresponding texts box thaks to help from Stanav and Tassa in my previous thread.

My next problem is to do with receiving lots of data from the serial port and my application getting out of sync. This is mainly caused by turning the volum control as each time it is turned a little bit the controller sends out the new status of the Zone being effected

eg
****Turning Volume knob on Zone 1***
Status returned from Controller:
#Z01PWRON,SRC3,VOL05<CR>

[Code].....

View 7 Replies

Pass Serial Data From Serial Data Received Event

Dec 13, 2009

I'm trying to pass a data packet from the serial data received event.The code can capture the data without any issues.I'm spinning my wheels on getting the data packet out of the thread for further processing.[code]

View 4 Replies

Error In Serial Port Data Capture Program In Visual Studios 2010?

Apr 11, 2012

I'm trying to make a rs232 serial data logging program, that accepts a 12 bit hex RFID tagID from an RFID module. My end objective is to save this RFID tagID into a database and assigned to a person for a personnel management system.I had to use button3 to add the value of the variable 'msg' into textbox1 because I was getting the following error "Cross-thread operation not valid: Control 'TextBox1' accessed from a thread other than the thread it was created on". It is a temporary workaround.When I do press button3, I get the incomplete hex number, instead of "4C00A2C82A0C", I get "A2C82A0C", and sometimes I get random digits like 1,A,C etc etc.

Public Sub OpenPort()
Try
If SerialPort1.IsOpen Then
SerialPort1.Close()

[code]....

View 4 Replies

VS 2008 Add Serial Protection To Program?

Aug 19, 2009

Are there any programs that I can use to add "Serial Protection" to my program?

View 2 Replies

Open Two Or More Serial Ports In One VB 2008 Program?

Apr 20, 2009

able to open and utilize a single serial port within with my VB 2008 program (i.e., set port parameters, open&close port, send&receive data via port, etc.), but I want to open two or more serial ports concurrently within my VB 2008 program so that I can read data from one port, say COM1, make decisions and calculations based on that data, and send instructions out through another port, say COM2.

View 1 Replies

VS 2008 Serial Port Program Hogging CPU?

Feb 18, 2011

i have the following code which runs ok, but it hogs upto 95% of the CPU.program outline: a timer tick event = 1000ms scans through 30 readlines of data on the comport for a specific line of hex, and then extracts information from the next line and converts it to decimal for viewing on the screen.i've only included the main part of the code to try and keep it simple.

Public Class Form1
Private WithEvents serial As New IO.Ports.SerialPort
Public grab As String
Public cardIndex As Integer

[code]....

View 9 Replies

VS 2008 Serial Data To A Text Box?

Aug 21, 2010

I have a PIC program written in PicBASIC pro that sends out variables in word (ie 260, 458 etc). I would like to write a simple one form application that displays these variables in a box like this (just a mocked up image)In my search for VB code examples on how to use the serial port I came across one basic but functional example

Imports System.IO
Imports System.IO.Ports
Imports System.Net
Imports System.Data

[code]....

This is correct as there is only one variable that contains data at the moment (Temperatures(2) ), so the values are 0,0,261,0 for the first line. the increase in temperature was reflected in subsequent readings as it went up to 26.6C and then 26.8C.However I am now stumped... I don't know how I can adapt the code to brake the data up into the 4 variable and place them in to 4 different text boxes.

View 2 Replies

VS 2008 Serial GUI Data Manipulation

Apr 26, 2010

I have been using Dick Grier's example to attempt to attempt to read data coming from a project.I first have to read 16 bytes for an RFID tag. I have that working and am able to extract the unique ID code and display it (cut out for length).The project samples voltage on an ADC and transmits 120 samples ranging from 0 to 255.I am attempting to buffer in the 120 samples, convert the scaled voltages (195 Vp or so (115% of Vnom)), and calculate Vrms.When I attempt to calculate and display the information, nothing is displayed.[code]

View 5 Replies

VS 2008 Get Data From USB UART, But Not USB-to-Serial Adaptor?

May 27, 2011

I have written a sketch for Arduino that sends serial data to my VB.Net app. Works great using the included USB port on the board. I need more distance, so I installed a MAX232. This is interesting. I get proper data in TeraTerm for both com ports (the Arduino USB comes up as a com port). I get proper data in my VB app from the Arduino USB (com) port. I get nothing from the MAX232 circuit on the other com port in my VB app. Why would both work in TeraTerm, but only the USB cable on the Arduino, not my MAX232 circuit in my application?

View 2 Replies

VS 2008 Serial Port - Data Type?

Aug 22, 2009

seems to be quite easy but i'm stuck I'm reading a hex string from serial port (f.e. 20FD05C4), but can't read it proper in VS:/ . I've been trying with serialPort.ReadExisting(), serialPort.Read, etc

Is there any way to just read that String or convert it easyly bin/hex ?

View 8 Replies

[2008] Show A Processing Message For Opening Serial Port After Program Running?

Feb 12, 2009

In Form1 there are a lot of boxes like checkbox, label....I want to show a processing message for opening serial port after program running. So I created Form2 specifically showing "Opening Port...". So in Form1_Load() I used Form2.Show(). However this message showed behind of Form1. I think this was executed before all the other tool boxes loading. So where should I put Form2.Show()?

View 2 Replies

VS 2008 Reading And Writing Data To A Serial Port

May 25, 2009

reading and writing data to a serial port. the settings for the port are correct (from manual of device):

[Code]...

View 1 Replies

VS 2008 How To Make Serial Data Base That Application Can Connect To

Aug 26, 2009

Can anyone tell me how to make a serial data base that my application can connect to?

View 9 Replies

VS 2008 Application To Reject Serial And Count How Many Times Entered In A Wrong Serial

May 16, 2009

I made my program and now I just need to add in the serial and trial part of the application. I know the application must connect to the host and go to a txtfile. How would i do the trial and serial. Also If the serial is already activated I want the application to reject that Serial and Count how many times they entered in a wrong serial.

View 2 Replies

Make A Program With First Form To Enter The Serial If Correct Just Continue To Form2 If Incorrect Just A Popup Say Like "Serial Incorrect"?

Aug 13, 2010

i just want to make a program with first form to enter the serial if correct just continue to form2 if incorrect just a popup say like "Serial Incorrect" how i can make it ?

View 2 Replies

How To Use Usb Microcontroller On Vb

Jul 28, 2009

i am talking about this [URL] device

1 what namespace referce do i add ?

2 what imports statement do i use ?

3 how do i make output input commands ?

View 9 Replies

Reading Serial Port Read Data From Serial Port?

Aug 16, 2011

i am a absolute beginner and i want to use vb to receive data from micro controller through serial port using rs232 standards, i found this code to receive the data serially, can any one tell me where should i paste this code, so that the data received will be displayed in message box.Private Sub DataReceived(ByVal sender As System.Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) HandlesSerialPort1.DataReceived

[Code]...

View 9 Replies

Activate Robotic Parts Using A Pic Microcontroller With Vb?

Sep 21, 2009

i want to activate robotic parts using a pic microcontroller with vb.basically i want to use the thechniques shawn in this video :

[URL]

here are my questions :

1 what activex do i add ?

2 are there any references i need to add ?

3 are there any imports statements i need to add ?

4 are there classes i can add ?

5 what commands do i use for output ?

6 what commands do i use for input ?

7 can you recomend a specific microcontroller ?

8 how do i add hardware to the device ?

9 what commands do i need to add so the software doesn't glitch ?

View 37 Replies

VB 2003 - Handling Data - Transmitting Data From A Comm Device Via Serial Port

Nov 10, 2009

I'm currently working on a project where I am transmitting data from a comm device via the serial port and resorting the raw data (in binary) to its respective ascii values. The problem I'm facing is determining the most efficient method to accomplish my goal. Essentially, I have 68 bytes coming in, the first and second bytes represent the page and packet number and the data itself ranges from 3 to 64, the remaining for my checksum.

What I am needing to do is, grab 50 consecutive bytes per variable in my array, and that is where I'm confused. I have easily pulled my 3-64 bytes and stored that data to a string. I just don't know the most efficient method to accomplish my goal. Should I write directly to file all my data, as there are like 8 pages, of 128 packet data. [Code] I can capture the the first 50 by using a for-loop easily, but what would be the preferred method to track what data chunk I've taken? The more I think about it, I think I may just want to write to file, all my data, and then just take them back to back in 50 byte chunks. Is that the most efficient method?

View 3 Replies

Displaying 8-bit Numbers From A Microcontroller In Real Time If Possible?

Apr 26, 2010

I've already wrote a simple program for connecting to a serial port that can send data to the microcontroller, do some basic arithmatic and transmit it back to my Form. This was just to see if I could set up the conection.I have a PIC Microcontroller giving an 8-bit number thats is taken from an external sensor device.What I want to do now is to present this data from the microcontroller in a textbox as a number either in real time (as the sensor output changes) or if not possible, on request (using a button).

View 15 Replies

VB 2008 Check For Data And Make The Program Stay There Until The Data Is Input?

Aug 3, 2010

I have a program for school project that has input fields for Name, Address, City, State and Zip. I need to error check so that the fields are not empty.I have used If statements that check to see if the fields are empty and shows a message box if they are but if I leave the whole form empty and click the button that activates it, all the if statements go- one by one instead of pausing for the user to input the required data.How do I check for data and make the program stay there until the data is input? I have tried TRY/CATCH but it won't catch this type of error.

this is the

'This program computes customer's bills at the pizza shop for all combinations of
'crusts, toppings, sizes and discounts
Option Strict On
Public Class PizzaForm

[code].....

View 10 Replies

Downloading Application Code Throught CANUSB Into Microcontroller?

Dec 12, 2011

Hi, I'm trying to develop a VB GUI that allows the user to download assemler code (Hex file) into microcontroller via a LAWICEL CANUSB.

I can now send signle message(8 Bytes.: example t1F0200081122334455667788, with ID:0x1F02000, DLC: 8 Bytes and Data:1122334455667788)

[Code]...

View 11 Replies

Win32 API A Good Approach For Use With USB Communication Between VB2005 And A Microcontroller With USB Capability?

Feb 17, 2011

Is Win32 API a good approach for use with USB communication between VB2005 and a microcontroller with USB capability? If so where can I find these APIs?

View 2 Replies

Data Not Going To Serial Port As One Data String?

May 25, 2009

I have to send the user-input data to the serial port. From the serial port the Modbus controller reads the data in Modbus/RTU mode.Now consider the following:Private WithEvents sp as serialport Now when I send sp.Write "192" to the serial port, I was that the complete data go as one data packet. Instead what I find that when this data is sent to a hardware controller, I find that the serial port first transmits 1, then 9 and then 2. Because of this my modbus does not recognize this data and throws and error. I tried sending "12" and again i find that it goes as "1" and then "2". Is there any way to send the data as one data packet so that my modbus can read "192" as one data packet value and not as 3 data packets of 1, 9, and 2?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved