VS 2010 Read A String From The Serial - The Condition "If .. Then" Never Occurs?

Nov 22, 2011

I read a string from the serial and I have to check if it matches another string .the condition "If .. Then" never occurs, I think because of the characters carriage return and various codes are present but not visible ... how can I fix this?

[code]...

View 4 Replies


ADVERTISEMENT

Error Occurs When Closing Serial Port?

Jul 5, 2010

I have developed serial port communication application using vb 2008 with serial port class.

Previously everything was ok. Now a days error occurs when closing serial port.

At the time of closing there is no receiving data .

Error is "The i/o operation has been aborted because of either a thread exit or an application request"

View 11 Replies

VS 2008 Using Serial Port To Read String?

Jun 9, 2009

I have an application in Electronics to communicate with serial port. With using VB I have succesfully read a character using

Serialport1.ReadByte
or
Serialport1.ReadChar

[code].....

View 5 Replies

VS 2010 Serial Read And GUI Update Is Slow?

Jun 17, 2010

I`m trying to write a small program which connects to a serial port at 115kbps and reads a stream of continuous bytes from a microcontroller. The program should then graph these bytes by time. Ideally this all happens in "real time" and as quickly as they can be sent.With a 50ms serial write delay on the micro the VB program keeps up fine, but if I lower the delay any further, say down to 1ms, the update can`t keep up and the serial buffer just grows.I wasn`t expecting the bottleneck to be the PC side so it`s likely my code is doing something wasteful. Or maybe it`s the graphics which are drawing slow?

Private Sub DrawGraph()
Try
Dim y As Integer = m_Y
Do

[code]....

View 8 Replies

Read Serial Port - Visual Basic 2010

Mar 18, 2011

I got an Arduino hooked up to the PC and would like to read the serial port of it. I read the serial port in Visual Basic with com.Readline, but it won't read everything. It looses around 2-3 lines that were sent over the serial port to the Visual Basic code. They get "lost".

[Code]....

View 1 Replies

String Occurs In Another String (textbox) ?

Dec 28, 2009

How can I get how many times a string occurs in a textbox? I thought the find function would return the number of times found but it seems to return the location of it.

View 2 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

VS 2010 : Show Message Box Error If System.componentmodel.win32exception Occurs?

May 16, 2012

I created a simple program which basically launches programs installed on 32-bit system in the C:Program Files directory. I purposely put an .exe line of code in the compiler but that .exe wasn't installed on the system, I was expecting for an error when I tried to click the launch button and I did. NOTE: I already have a beginning If statement and that program is actually installed in the system, works perfectly no errors appearing.

ElseIf lstMultimedia.SelectedItem = "HyperCam" Then Process.Start("C:Program FilesHyperCam 2HyCam2.exe") 'this program doesn't exist in the system"

When the error appeared I looked at it in detail and found it was a system.componentmodel.win32exception type of error, I'm guessing that means a file doesn't exist in the directory I specified therefore the program displays an error.Now what I want to do is display a message box saying along the lines "This program cannot be found in your system" or something like that. But I don't know what the actual syntax/code for it, so far from thinking I have this.

Else : lstMultimedia.SelectedItem = 'no idea what to put here Then MessageBox.Show("This application cannot be found in your system or is installed in a different directory", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If

View 6 Replies

VS 2010 Read A File Into A String?

Apr 24, 2011

I have a .dat file in my resource folder that has 1 line in it. I need to read that 1 line into a string so i can use it in my program. Then I need to write another string into a new .dat file into my resource folder.

View 5 Replies

VS 2010 Read A String Into A Binary File?

Sep 18, 2011

I want to read a string into a binary file. This string is repeated every certain length ... example:

Start Offset: 694
End Offset: 2248591
Long of string: 25
Sequence Length: 110

I want to read the file and add the strings in a listbox.

View 2 Replies

VS 2010 Using HTTPWEBREQUEST To Read A String In A Webpage

Dec 9, 2010

I'd like to be able to set a HttpWebRequest to read teh contents of a text file located on a website (ive seen it done, they use a webrequest and set it to a string, but i can't find it anymore o.O)

View 3 Replies

Declaring String And Condition

Jan 17, 2012

I have a String variable in this page named "a".I wanted the scenario to be.When the page is started "a" will be null.But when the user selected an entry from the DetailView Control "a" will become "have".The following is my code. But i keep getting "a" = null even though i have selected an entry from the detailView control.[code]

View 2 Replies

Barcode App If String Exists Condition

Nov 24, 2010

I bought acheap USB barcode reader so i could play around with some hypothetical situations. I've managed to get a good chunk of stuff worked out, and had alot of fun along the way. But i thought to myself what if the same tag is passed back along the chain due to production defects and requires remaking.

When it returns to the station to be retagged complete, how do i set the condition for it to search to see if the bar code string already exists in the database prior to either adding a new row (if if returns negative) or to append a cell in the table if the search retuens a positive result.

[Code]...

View 2 Replies

VS 2008 How To Convert A String To If Condition

Sep 11, 2010

i want to know how to convert a string to if condition exmample

dim myExpression as string
myExpression = "if a>b then" & _
" MessageBox.Show("beware from dog !")" & _
"end if "

View 3 Replies

VS 2010 Get A String From A Byte Array Previously Read From Memory?

Mar 27, 2011

I'm trying to get a string from a byte array previously read from memory

i can get the string like this

dim mem as string= ASCIIEncoding.ASCII.GetString(memory) or dim mem as string= UTF8Encoding.UTF8.GetString(memory) but when i try to concatenate this with another string i get a strange result dim result as string = "this is you memory string " & mem & " problem string" no matter what comes after mem in the concatenation it seems like it is not there when in fact it is because when i try this (mem has two chars in it) dim result as string = "this is you memory string " & mem(0) & mem(1) & " problem string" problem string appears so what i assume is that there are some vbCrLf chars in the string after reading (or is it from the conversion?)

View 2 Replies

VS 2010 Read Email Store As String Or Text File?

Oct 16, 2011

Is there a class or something I can add to be able to read an email?I really want to be able to make a real email client (like outlook).Is it possible with vb.net?

View 1 Replies

Check If String, Which Receive Via A Serial Port Matches To A String In A Database (access)?

Jun 22, 2010

I got an app, which receives data via a R232 port, convert it to a string and on the other side I got a database, where the strings are saved. How can I find a way to compare the string with all strings in one database column and get back the another stringform the same row in this database. I never programmed a database

View 1 Replies

How To Read Serial Port

Oct 27, 2009

i am new to VB.net and i am writeing a program to read a serial port and if there is any thing in the buffer i want to read the data and put it in a string then clear the buffer

View 1 Replies

How To Read The Serial Port

Jun 22, 2010

Ive got a big problem.I need to read data from the serial portIve used serialport from the toolbox , but dont know how to use it.I used to do it on a Amiga like this

open serial("serial.device".0.2400.0) rem(open port)
repeat GW.w=readserial(0)
if gw>29 and gw<128

[code].....

View 3 Replies

Read HDD Serial In Vista?

Mar 20, 2009

I have a class which reads the serial of the users HDD, basically so I can generate a unique license for that user based on HDD serial and other things.

This works fine in XP where UAC isn't an issue. However, when run on Vista it pops up security warnings and won't continue unless you turn UAC off!

Is there a "safe" way of reading this information without Vista throwing its lunch up?

View 2 Replies

Serial / USB Signal To Read Out?

Mar 11, 2010

I want to get the data coming from a weighing scale (rs232 signal) to a vb.net prgram, to a text box

View 1 Replies

Communications :: Connect And Read From Serial Com?

Sep 22, 2008

my code to read from serial port and store it in a variable?

Public Class Form1
'SerialPort object creation
WithEvents mySerialPort As New IO.Ports.SerialPort

[Code]......

View 1 Replies

How To Read Data From Serial Port

Jan 3, 2010

I am trying to read data from rfid tag using rfid reader. i can connect reader, but cannot get data?

View 4 Replies

Random Text In Serial Read?

Feb 1, 2012

im reading a serial com port (Ardunio FTDI presented as a com anyway). It works fine for a few seconds then randomly I get random text, Ive tried a few different settings but there dosnt seam to be a specific trigger for the randomness.Ive read a few notes about a known buffer overflow issue and checked it in terminal where it's fine. This is my first return to VB in 10? years so im more then alittle rusty but this has me stumped,

Private Sub Timer2_Tick(sender As System.Object, e As System.EventArgs)
Handles Timer2.Tick
Dim LineOfText As String[code].....

View 3 Replies

Read Data From Serial Port?

Apr 2, 2012

I am using a VB.NET(VS2010) to read data from serial port. I have 8-bit data to collect through rs232. This data is represented numbers. What reading method should I use and how to convert it to double format?

View 4 Replies

Read Data From The Serial Port?

Nov 12, 2009

I need to read data from the serial port Ive used serialport from the toolbox , but dont know how to use it. I used to do it on a Amiga like this

open serial("serial.device".0.2400.0) rem(open port)
repeat GW.w=readserial(0)
if gw>29 and gw<128

[Code]....

View 1 Replies

Read From Serial Port In Program?

Sep 6, 2010

I am using Scanpal2 to read data and as per its documentation as follows

View 8 Replies

Read Information From A Serial Port?

Nov 2, 2009

I have a teperature PCB that reports the temp back via serial port. I can open Hyper Terminal and receive all the data I want - so I know the unit is working... but I want to create a VB app so I can use the data received. When I run the program I get this error:

System.TimeoutException: The operation has timed out.
at System.IO.Ports.SerialStream.Read(Byte[] array, Int32 offset, Int32 count, Int32 timeout)
at System.IO.Ports.SerialStream.Read(Byte[] array, Int32 offset, Int32 count)
at System.IO.Ports.SerialPort.InternalRead(Char[] buffer, Int32 offset, Int32 count, Int32 timeout, Boolean countMultiByteCharsAsOne)

[Code]...

View 3 Replies

Read SERIAL PORT In Vs2008?

Oct 27, 2010

I working on modbus software. I am able to communicate with the modbus slave. The only problem with me is after i write the message on the serial port , i read the serial port for data after say 100ms and i use "system.threading.thread.sleep(100)". This freezes my program for a while. Can you please help me build the logic for reading the serial port after say n no. of seconds without using "system.threading.thread.sleep". I am new to vb.net. I am using .net 3.5sp1 and vs2008.

View 6 Replies

Read Text From Serial Port

Oct 13, 2009

i cannot read data from my serial port..i am using HYPERTERMINAL on my other computer(computer 2)..i can send data from my computer(computer 1) and it showed on computer 2..but when i type things into my HYPERTERMINAL in computer 2, the Visual Basic program cannot read it??this is my code:

[Code]...

View 6 Replies







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