VS 2008 - Warning - Serialport.encoding

Jul 7, 2009

My program has been running fine for months and still is, but I now have this warning, (which must have shown up since upgrading to VB2008 from 2005 a month ago).

It regards the serial port encoding setup and reads as follows -- serialport1.Encoding = encoding.GetEncoding(1252) 'for char > 127

Warning 1Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated. Perhaps there was an update on this with 2008 and it's now redundant or something?

View 4 Replies


ADVERTISEMENT

SerialPort Encoding For Acco And Ecco?

Jan 11, 2010

In the other thread I posted the following code, and the output from the debug. Since then I haven't been able to get into the thread. I think some of the special characters may have been the cause for me not to be able to open the thread. @acco - Sorry for the misunderstanding. If you use the SerialPort.Read (buffer as byte...) method only you do not need the encoder set on the port, as this code shows.The code was tested by attaching my serial cable to my breakout box that had pins 2 & 3 crossed, so what I sent I received. This code is just quick and dirty.

'Send all possible byte combos to a loopback
Imports System.Text, System.IO, System.Threading
Public Class Form1

[code]....

View 1 Replies

VS 2008 PDA SerialPort?

Jun 23, 2010

I have wrote this program (for PDA), to connect a PDA to the PC via RS232.It only works half way.

If I send anything from the pda to the pc, I receive data correctly.If I send anything from the pc, then the pda hangs up.Can anybody tell me what I'm doing wrong?

Also, how do I make sure the port on PDA is closed when quitting the application?

[Code]...

View 1 Replies

EnCoding Message To DDE Client Using System.Text.Encoding.ASCII.GetBytes (message)?

Oct 28, 2009

I am sending a DDE message to a client using System.Text.Encoding.ASCII.GetBytes(item) . However, before the message is actually sent, I would like to get the message coded where if the item="Ask" then item=Ask (string variable) and so on. The code is:

Protected Overrides Function OnRequest(ByVal conversation As DdeConversation, ByVal item As String, ByVal format As Integer) As RequestResult
' Return data to the client only if the format is CF_TEXT

[code]....

View 3 Replies

VB 2008 On XP Exception With Serialport?

Mar 14, 2009

I am trying to access a printer via the serial port in VB Express 2008. I wrote a small prog with buttons on the form to exercise the escape codes in a Windows Vista 32 laptop with a USB to serial adapter. Only 3 codes worked, BEL, reset and a printer specific command. Also, when i try to receive data, it justs times out. So, I tried to move to a WinXP machine with real serial ports. The program now has an illegal argument exception and the message is to the effect that the name of the port for the property portName does not start with COM/com. Which is very puzzling because I did verify the portname and it is com1.Is this a known issue or am I doing something wrong? The form works on Vista but not in XP.

[Code]...

View 8 Replies

VS 2008 SerialPort Hang-up?

Jun 23, 2010

I am trying to send and receive data using the SerialPort component. I am sending data to an Texas Instruments MSP430 which simply echos the sent character. I wanted my VB solution to read characters from a file, send a single character, and wait until the echoed character is received before sending another.

I have been fairly successful thus far but I have run into a little catch. When I attempt to send large files (323505+ characters) my MSP430 just hangs there and will not receive any more characters. My VB app return to VS '08 with timeout errors (timeout set to 1 minute).

I wanted to post my VB code here to see if the problem is from my VB app. I will be posting this problem on the IT usergroup to sort out anything on the MCU end. Here is the pastbin of the data write and the data receive subs:[URl]..

View 2 Replies

VS 2008 Using Serialport On 2 Different Forms?

Aug 25, 2009

I'm using one form to make contact with the serial port with the next

Imports System.IO.Ports
Imports Microsoft
Public Class Menu

[Code].....

View 2 Replies

VS 2008 IO.Serialport Does Not Receive Any Data

Apr 6, 2009

I want to use IO.ports.serialport to receive ASCII data from an instrument (A Luxmeter for those interested). So far, i've been unable to read any single byte from the instrument using the IO.ports.serialport.A terminal window shows the datastream just fine, and I've used MScommlib to read the data without problems. I just had other problems with the latter, so I thought I'd give this IO.ports.serialport a try.The code runs fine, no errors. It just doesn't receive anything.Bytestoread stays 0 forever.I distilled the code to it's bare essence. What am I missing? Is it something obvious, or did I completely misunderstand the whole concept? (Which is not unlikely..)I did check the obvious, of course: settings, baudrate, cable is connected, instrument is sending, etc.[code]

View 6 Replies

[2008] SerialPort Blue Screen?

Jan 22, 2009

I was attempting to clean up my serial port example that is in the code bank. I had decided to use a modem, thinking that a lot of computers still had them. By using the loopback feature of the modem I am able to simulate / emulate various features of the serial port.All was going well, and then I got a Blue Screen with this error after running for 10 minutes or so:DRIVER_IRQL_NOT_LESS_OR_EQUALSTOP 0x000000d1 etc.I then went back to using my GPS receiver, which sends messages constantly to a serial port. This test ran for several hours(4). It received messages correctly during the entire test.I then created a new, not as complex, version and it also receives the Blue Screen. I have made sure that the modem drivers are up to date, searched for the error, etc. My gut is telling me that it is the modem driver. I have attached the project. This is the scaled back version, but it uses the same functionality.

View 7 Replies

VS 2008 Encoding Strings?

Apr 2, 2009

I'm not sure of the name of the function i'm after but im trying to turn:

http://
into
http%3A%2F%2F

for example, is there a function i can use for this at all? i'm not to sure what to search .

View 3 Replies

VS 2008 Creating Dynamic SerialPort Controls

May 31, 2009

I need to create some serial port controlls manually. My program reads through a config file, and it if comes across an entry called COMPORT then I need to create a contol to talk to this port. The entries in the ini file might be

COMPORT=COM1
COMPORT=COM3
COMPORT=COM7

So here is my problem! I'd like to create the variable control name with part of the com port number, so I can always refer back to it.
EG.

Dim strVar as sring = "COM1"
Dim CName+strVar As New System.IO.Ports.SerialPort

View 1 Replies

VS 2008 Get Response From Serialport To Update Property?

Feb 19, 2011

There is a problem in my project. It has a class with several properties. When I set the property, it send command to device through serialport. But the problem is when I get the property, it need to send request command to device, and device return value back. How can I update the property?

View 2 Replies

VS 2008 SerialPort Custom NewLine Character?

May 21, 2010

I have this sample code...

Private Sub DataReceived( _
ByVal sender As Object, _
ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) _

[code]....

this displays in a text box the received data from a serial port. And it works like a charm but the data received has custom start and end of line characters. A line begins with chr(&H2) and ends with chr(&H3). What i want is on the text box those characters to be hidden and the chr(&H3) to start a new line.

View 5 Replies

VS 2008 Can't Resolve Warning But Code Still Works

May 30, 2010

"Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated".I have this message showing up that references this code in the keyup event:[code]I am just testing the trapping of keys right now. The code still works but I am uncomfortable with an unresolved warning.

View 3 Replies

VS 2008 With Character + (Encoding String To ISO-8859-1)

Dec 2, 2009

I have problems sending sms using API. I need to sens sms encoded ISO-8859 The problem is encoding to ISO. Not runs

[Code]...

View 2 Replies

SerialPort Events Won't Fire On Windows Server 2008 Using .NET 2.0 Application

Jul 9, 2010

I have a program that reads data from a scanner via the serial port.This program works fine on Windows XP.We have a terminal server set up running Windows Server 2008.I run HyperTerminal on our test terminal, it connects and reads the scanner data fine through COM1.I run my app on that same test terminal and get nothing when I scan.My app connects to COM1 without errors and disconnects without errors.BUT, the DataRecieved event is NEVER getting fired.Neither is the ErrorReceived event.I have played with the Handshaking, with the RecievedBytesThreshhold and pretty much every setup setting I found.Set it up exactly like the settings on Hyperterminal.I have even tried starting a timer on a different thread to call ReadByte every second to try to KICK this thing into doing SOMETHING.Nothing has worked.

I have been trying to fix this for an entire day now.Added events to my class trying to see EVERYTHING that is going on. All I know is, it connects to the port and it disconnects from the port correctly but nothing happens in between.No data when I scan.No event fired at all between connecting to and disconnecting from the port.I have also downloaded other's simple serial communications applications.Nothing in .NET works.[code]

View 1 Replies

"Security Warning For {app Name} - Visual Studio 2008?

Mar 6, 2009

Hi All,Out of the blue VS 2008 has started showing a security warning dialog every time I create a new project or open an existing one as follows:"The {application name} project file has been customized and could present a security risk by executing custom build steps when opened in Microsoft Visual Studio. If this project came from an untrustworthy source, it could cause damage to your computer or compromise your private information."Two options given are:1) Load Project for Browsing2) Load Project NormallyA 'More Details' button opens a message box with:"An item referring to the file "" was found in the project file "C:UsersAdministratorAppDataLocalTemporary ProjectsWindowsApplication1WindowsApplication1.vbproj". Since this file is located in a system directory, root directory or network share it could be harmful to write to this file."1) I havent changed any settings since before getting this error and have kept all directories the same2) file locations are in "C:UsersAdministratorDocumentsVisual Studio 2008" - with full permissions3) Vista UAC is turned off4) I am using the Administrator login5) I tried Tools>Options>Projects and Solutions>General - and un-checked "Warn user when the project location is not trusted" -

View 14 Replies

VS 2008 - Picturebox Image File Open Warning

Aug 31, 2011

am trying to replace a image in a picturebox with a new image. I am getting the warning that the file is open (locked). It works a few times and it bomb's out with the warning. How can i unlock the file? I am disposing the current image and setting it to Nothing. [Code]

View 2 Replies

VS 2008 Color Outline On Text When Using Transparency? (56k Warning)

Jun 10, 2009

I used my forms TransparencyKey property to make the form background invisible, but to keep the controls 100% visible. But, when I add a label onto the form, a border or outline shows up around the text (doesn't matter which color I do it with). My friend says that this isn't fixable and he said that it doesn't happen in VB6. I'm tempted to remake the project in VB6, but Windows 7 is being released soon and compatibility is a must.

What about C#? Does the issue occur as well? If not I'll just go with that.

View 3 Replies

VS 2008 Warning : ExecuteNonQuery: Connection Property Has Not Been Initialized

Nov 26, 2010

I want connect to dbf file.
________________________________________________________
Imports System.Data
Imports System.Data.OleDb
Imports System.Data.Odbc

[code].....

The warning is: ExecuteNonQuery: Connection property has not been initialized.

View 4 Replies

VS 2008 - TexBox Encoding - How To Read Hebrew Letters

Apr 29, 2009

I tried to figure how can I read a text from a text file that is written in hebrew to a TextBox. I searched google for 3 hours and find nothing. I am getting a junk text into the TextBox. This is the code for reading the text file:

Dim txtReader As TextReader = New StreamReader(Me.txtPath.Text)
Me.RichTextBox1.Text = txtReader.ReadToEnd()
txtReader.Close()

How can I read hebrew letters?

View 6 Replies

VS 2008 : Warning - 'functionDealWithHiddenFields' Doesn't Return A Value On All Code Paths

Nov 21, 2009

i get a warning " 'functionDealWithHiddenFields' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used."

Example function:

vb.net
Function functionDealWithHiddenFields(ByVal HTML As String, ByVal numHiddenFields As Integer, ByVal X As Integer)
Try

[code]....

The functions still work correctly (as far as i can tell) what would i need to do to the above function to remedy that warning?

View 5 Replies

Get Caller ID From Serialport

Apr 23, 2011

I am trying to read caller id from a internal modem. modem is caller id enable and it works in hyper terminal. but when i try from vb.net it only shows 'RING'. here is my full code

[Code]...

View 4 Replies

No Timeout For Serialport?

Dec 16, 2011

I am using VB 2005 and need to trap a serial port timeout. I use a standard try/catch block, but if no characters arrive the code still hangs at the ReadByte call. Here is the code:

Try
SerialPort.ReadTimeout = 200
' read timeout of 200 mSecs
thisByte = SerialPort.ReadByte()

[code]....

View 5 Replies

USB SerialPort Oddities .Net 4.0?

Jul 12, 2011

Recently while trying to help someone with an issue using USB SerialPort's I discovered sometheing interesting when the ports Handshake was set to RequestToSend. My setup COMx <---> BreakOutBox <---> COMy COMx and COMy are on the same PC. The breakout box is used to create a null modem, pins 2 & 3 crossed, pin 20 to pin 6.When the handshake was set to RequestToSend every Write resulted in Carrier Detect and Ring being raised. Is this just my adapter or are all USB SerialPorts like this?Serial Port Random Microsoft® Community Contributor 2011

View 2 Replies

Asp.net - Serialport Communication .net 4.0 From A Webpage?

Sep 23, 2011

Looking for serial port communication using ASP.NET 4.0. I have a cardwriter/reader from IDTECH which talks through a comport. Is there any way to accomplish with .net through the web.

I read things but most of the topics on speaking about .net 2.0 and I was not sure if they created something to handle this in .net 4.0

View 2 Replies

Bug In Serialport Control When Using E - 8 - 2 Parameters?

Jun 16, 2011

We have been debugging a problem with serial communications with an embedded device on 115200 baud, Even parity, 8 databits and 2 stopbits. The problem: a lot of extra 0x00 are sometimes received from the serialport.

1) We build a real basic sample program that only handles the data exchange. It was completely build according the serial-port-vb.doc from msdn. It was build in vb.net 2010. So this was the most basic setup possible on the PC side. This simple tool clearly shows the datareceived event spitting out extra bytes.

2) We used a scope to look at the hardware bits/levels. No problems / differences seen between good and bad messages. No extra bytes visible that the serialport event send to our programm.

3) We tapped the serial communication and received no wrong data on the tapping system but still on the .net tool. Again the serialport datareceived event gave us many extra 0x00 bytes.

So our only possible conclusion is that there is a problem in the serialport component from .net. My question: Are there any know issues? Can I get in contact with a microsoft engineer?

View 9 Replies

Check When Serialport Is REALLY Connected?

Mar 16, 2009

I want to send some data through a serialport (USB) permanently and got a problem once the USB interface crashes. Sometimes it just happens, but if I ask the PC "serialport2.isopen ()" I will get a TRUE, even though the USB cable was uplugged. How can I check if a connection is still available. CDHolding wasnt working either. I am using VB 2008 Express

View 7 Replies

Communications :: Use The SerialPort In VB Express?

Jan 27, 2009

how to use the SerialPort in Visual Basic Express?

I have this in the Serial Port Data Recieved event

Code:
SerialText = SerialText & SerialPort1.ReadChar
TextBox1.Text = SerialText

I get : Cross-thread operation not valid: Control 'TextBox1' accessed from a thread other than the thread it was created on. As soon as the event is triggered.

I'd like to display the recieved info in a textbox and transmitt info as well, but I don't know how...

View 4 Replies

Odd SerialPort Names Which Do Not Work

Jan 7, 2011

i am coding a tool which is able to connect GPS devices over the IO.Ports.SerialPort function in .NET..Everything works fine, but to list all available COM interfaces it looks like: [code] its impossible to connect to a device which is called COM3°. If i simply try to connect manually to COM3 it works perfect. [code]

View 3 Replies







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