VS 2005 Use MSCOMM For Monitoring Serial Ports For Voltage Change?

Jul 22, 2009

I'm wondering how I could monitor a serial port for a voltage change or contact closure and have an event triggered when there is a detection.

View 1 Replies


ADVERTISEMENT

Update Combobox When Available Serial Ports Change

Dec 17, 2010

I want to know if there is a way to refresh a combo box when a new serial port becomes available.[code]

View 2 Replies

Serial Port Programming (voltage)

Apr 6, 2011

I have been trying to come up with a code to send voltage signals to a serial port using Visual Studio 2010, I found many codes online but since i am not familiar with visual basic, I do not understand any of them.

View 8 Replies

VS 2008 Getting Voltage From RS232 / Allow Dial Voltmeter To Point According To Voltage Level

Dec 2, 2009

my circuit board is connected to a power supply(those laboratory DC power supply used in schools) and the circuit is connected to the computer via a RS232 Serial cable port.Through the serial cable port, a voltage level is sensed and is displayed on the "Voltage Level in Volts(V)" i am able to display a Dial Voltmeter with a needle. -- Coding for the dial voltmeter with needle is also attached for reference, just in case if it is needed.But currently, the dial voltmeter's needle does not point according to what is shown on the textbox. Therefore, i need guidance on how to allow the dial voltmeter's needle to point according to what is shown on the textbox. [code]

View 13 Replies

Getting Voltage From RS232 & Allow Dial Voltmeter To Point According To Voltage Level

Dec 3, 2009

Basically, my circuit board is connected to a power supply(those laboratory DC power supply used in schools) and the circuit is connected to the computer via a RS232 Serial cable port. Thru the serial cable port, a voltage level is sensed and is displayed on the "Voltage Level in Volts(V)" -- See attach image

>> But currently, the dial voltmeter's needle does not point according to what is shown on the textbox.

>> Therefore, i need guidance on how to allow the dial voltmeter's needle to point according to what is shown on the textbox.

[[ Dial Voltmeter with needle ]]

Code:Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint

[CODE]...

View 4 Replies

Communication With Serial And TCP / IP Ports

Feb 19, 2009

What is the best way of communicating with Serial ports and TCP/IP communcation using vb.net?Using visual studio .net can we make it easier?? Can anyone send me sample application of communications?If I write a program communicating with my hardware using Searial port or TCP/IP, will the program be slow?? Are there any programming techniques working with communication ports?

View 1 Replies

Access A Serial And Parallel Ports?

Dec 20, 2010

is there any other way to access a serial port using visual basic.net 2010? i followed the steps in this site, How to access serial and parallel ports by using Visual Basic .NET but i just got this output Open the serial port. Send the attention command to the modem. Wait for data to come back to the serial port...

[Code]...

View 2 Replies

Make An Array Of Serial Ports In Vb?

Jun 6, 2011

I'm fairly new to Visual Basic (VB), but I've already got running code to access all my serial port. The problem is I want to load multiple serial ports into an array and loop through them in my functions. The program allows me to create ports(), but fails when I try to populate it.

Dim ports As IO.Ports.SerialPorts()
ports(0) = SerialPort1

Where SerialPort1 is an object I draged from the Visual Studio toolbox.

View 2 Replies

Using Serial Ports With The New Port Class?

Apr 24, 2010

I'm learning the serial port programming. So, I study the code samples from MSDN - VB101SamplesBCL2 http:[url].....While ran the solution of "UsingTheSerialPort", It shows error: It highlights one sentence textBox2.Text = SerialPort1.ReadLine() -- Line 40 ,and says :

"InvalidOperationException was unhandled - Cross-thread operation not valid: Control 'textBox2' accessed from a thread other than the thread it was created on."

View 1 Replies

Serial Port Data Monitoring?

Jun 4, 2012

I've searched in the forum thread for my needs, and I couldn't find any. So here is my problem. I need to monitor the data passing trough serial communication, between local serial port and some device with an application written in vb.netThe idea is to see the data without opening the port.For example I want to start the program, choose the serial port that I want to monitor, and then to start some other application that opens the serial port, and start to send data. Another device "answers", and I want to see the the sent and received data from the first program, and the process that opens the port.I thought that I can use the serial port event "DataReceived", but actually nothing happens. I think my approach is wrong. CHere is my code:

Imports System.IO
Public Class Form2
Private WithEvents sp As Ports.SerialPort

[code].....

View 6 Replies

Return Positive Voltage Or Negative Voltage?

Sep 14, 2009

I have this light sensor circuit that will return positive voltage or negative voltage. I want to plug it into the 9-pin D-Sub port on my computer. I already have a male connector. How do I connect the circuit to the D-Sub connector, and how do I read the value and convert it to a Boolean in a program? How do I set up the cables? It only returns one 1 or 0 value. Is it possible, even?

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

Read Data From Two Serial Ports At Same Time?

Aug 8, 2009

I am still new in programming. I am an electrical engineer. I have to read the time from GPS from one serial port apend this time to a data got from other device serially.

View 1 Replies

Sending Multiple Commands To A Serial Ports?

Aug 24, 2010

I am creating an application to configure some modems through the serial port. I have no problem sending a single string of data to the serial port and displaying the immediate response to a rich text box. I have 2 problems

1st: how to update the rich text box for any delayed response from the modem

2nd: how to react to the response from the modem, in other words I want to send the next command based on the response from the modem witch is usually "OK"

This is what my code looks like currently to send ans receive data from the serial port. (sport1 is my serial port and display is my rich text box)

sPort1.Write("AT+WOPEN=1" + Environment.NewLine)
With Display
.AppendText(sPort1.ReadExisting())

[Code].....

View 1 Replies

VS 2005 : Increase The Voltage Level Of A PC?

Jan 21, 2010

i want to increase the voltage level of the electricity?

View 8 Replies

Using Serial Ports - Take The Communication From The Software And Redistribute It To THREE Eurotherm 3216 Controllers?

Sep 7, 2009

I'm reasonably proficient with VB but never had any expirence with communicating with hardware. I have a piece of software that communicates with a Eurotherm 3216 process controller via RS232, but its use is fairly restricted what it can do.What I want to be able to do is take the communication from the software and redistribute it to THREE Eurotherm 3216 controllers, so my software would intercept the comms and effectively emulate the Eurotherm.

View 5 Replies

VS 2008 Create An Array Of Serial Ports - Deleting Dynamic Object

Jun 29, 2009

I have the following code to create an array of serial ports.

[Code]...

View 5 Replies

Write A Code For Serial Ports Without Sucess But The Code Does Not Throw An Error ?

Feb 20, 2011

what is wrong with my code and I get no feedback from my button click event, i have imported. ( code Below) and i have tied differrent combinations of the code without sucess.maybe add extra to my code for the list to show open Port or closed ports.

Imports System.Management
Imports System.Management.ManagementObjectSearcher
Imports System.Management.ManagementNamedValueCollection[code].....

View 9 Replies

Check On Serial Ports Is "breaking" USB Modem?

May 31, 2011

I am using the following code to enumerate through com ports to determine if the attached modems are in use.When I get to my usb modem, it returns the correct "PostIsAvailable" status, but then it kind of locks up the modem and I get the following error when I try to manually query the modem I get: "The modem failed to respond. Make sure it is properly connected and turned on. If it is an internal modem, or is connected, verify that the interupt for the port is properly set."I either have to manually requery the modem or unplug/plug it again.This code works fine on my external serial modem, but not the USB modem.

Public Function PortIsAvailable(ByVal port As String) As Boolean
Dim TempPort As New SerialPort
TempPort.PortName = port [code]......

View 5 Replies

VS 2008 - Get The Caption Property Of Serial Ports Available On Computer - Error "A First Chance Exception Of Type 'System.InvalidCastException"

Nov 12, 2009

In my project I'm trying to get the caption property of serial ports available on computer. But when I run this code below I get "A first chance exception of type 'System.InvalidCastException' occurred in Microsoft.VisualBasic.dll" exception. I tried putting "Option Strict On" and then I'm getting build error saying it disallows Late binding.

[Code]...

View 5 Replies

VS 2005 - Experiment With COM Ports?

Mar 4, 2010

I want to experiment with COM ports but I'm stuck trying to figure out the COM port on my laptop. When I run the following program:

[code]...

PCI expansion card with my wireless internet card in there the hp manuals also say that my laptop should have a PS/2 mouse or keyboard slot but i dont see it anywhere. what ports could "COM3" be refering to?

View 6 Replies

Change The .BaudRate Property Of A System.IO.Ports.SerialPort While It's Already Connected?

Nov 18, 2010

For whatever odd reason, we have a legacy data recorder device that runs at 9600 baud. Except when it needs to transfer its recorded data to a PC, in which case it switches to 57600 baud.

The old VB6 code worked, although it had its own set of problems of course.

The routine is this: Do several COMMAND/RESPONSE routines to populate a list of available records, listed by timestamp, at 9600 baud. Once a timestamp or several are selected, display a file save dialog. At the moment that dialog is closed, send a command to the device to tell it "hey we're going to warp", sleep for 100ms, then set the baud rate property of the persistent COM1 connection to 57600, before beginning to process XMODEM data and do the progress bar dance.

The problem I'm having is that it doesn't appear that the data received is ever really kosher as far as the byte marshaling is concerned. Which makes me wonder just how well SerialPort is at dynamically changing bauds on the fly. The VB6 version used MSComm.

I've even attempted to just use MSComm through the compatibility layer but "CTL_E is not supported" which makes it sound like it's incapable of doing XMODEM. (?)

View 1 Replies

Load The Available Serial Ports - Load Their Names As Seen In The "device Manager"?

Oct 23, 2010

i am using the below code in VB.Net to load the available serial ports :

COMsComboBox.Items.Clear()
Dim i As Integer
For i = 1 To My.Computer.Ports.SerialPortNames.Count
COMsComboBox.Items.Add(My.Computer.Ports.SerialPor tNames(i - 1))
Next

i also want to load their names as seen in the "device manager",

View 1 Replies

How To Change Serial Port Settings

Feb 17, 2009

I made serial COM1 work by default settings in serial port properties. If I want to change to another port,e.g. COM2 as well as change other settings (baud rate, data its, etc.), how to re-open this new port?

View 2 Replies

How To Change Which Serial Comport Is Being Used In Code

Nov 20, 2010

im currently working on a program which prints serial text to an aplication like note pad. the problem im having is that i cant figure out how to change which serial comport is being used in code. i want the user to chose the comport with a check box.keep in mind that COM1 in my code is what i called my check box. here is my curent code:

Public Class Form1
Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
Shell(OpenFileDialog1.FileName, 1)

[code]....

View 1 Replies

Dc Motor Using Mscomm

Jan 28, 2010

how do i control 1 dc motor using the mscomm activex and the rs232 (serial)port ? how to change the direction of the motor using code ?if possible give me the full walk through

View 13 Replies

MSComm Command In .net?

May 20, 2011

i'm confusing on the MSComm command..coz in .Net, it wasn't declared. as an example for a simple interface, how should i convert this to VB.net? here's the simple interface in VB6..

Dim sData As String
Dim lHighByte As Long
Dim lLowByte As Long

[code]....

View 4 Replies

Audio Announcement Of Voltage?

Nov 28, 2009

I was wondering if will it be possible to do the following :1) When a specific voltage is sense and is displayed on the textbox, is there any codes to allow the audio announcement of the voltage ?(a) As voltage levels will usually be in decimal, like for example, (1.23 V) it may be difficult to allow the audio announcement of exact voltages

View 12 Replies

Measure Voltage And Current?

Apr 13, 2012

get sample code by using NI-6009 to measure voltage(Vrms) and Curent (Irms) . Before this i'm trying to make code with using example in National Instrument VB2010.But i still can't display the right values of voltage(Vrms) and Current (Irms) from waveform that I used.The data comes from data acquisition grid in source array i used to plot sinus waveform.But the problem is I don't know how to measure voltage(Vrms) and Curent (Irms) from that waveform. I am also don't know how to start programming between NI-6009 DAQ Card and Visual Basic 2010 Express.

View 1 Replies

VS 2008 Conversion Of Voltage To LUX?

Dec 4, 2009

I need some guidance again =)Its regarding the conversion of voltage level to equivalent LUX.As mentioned in prev. few threads, if you have seen it, basically, my circuit board is connected to a solar panel and is connected to a power supply (those laboratory DC power supply used in schools).The whole thing is connected to the computer via a RS232 Serial cable port. Thru the serial cable port, a voltage level is sensed from the Solar Panel and is displayed on the "Voltage Level in Volts(V)" See attach image

Currently, i need guidance on how to convert the Voltage Level into equivalent LUX.I googled and found from this website >> [URL]../324003.page and it states that Lux = 1333 * Vo , so does it mean that i just type:TextBoxLux.text = TextBoxVoltage.Text * 1333 I'm not sure if this is the correct method to convert voltage level from the solar panel into equivalent LUX. If this method is wrong, please correct me.

[Defination of LUX: The lux (symbol: lx) is the SI unit of illuminance and luminous emittance. It is used in photometry as a measure of the intensity, as perceived by the human eye, of light that hits or passes through a surface]

View 5 Replies







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