Click here to Skip to main content
15,925,868 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Paint a rectangle Pin
The ANZAC11-Nov-07 15:07
The ANZAC11-Nov-07 15:07 
GeneralRe: Paint a rectangle Pin
Luc Pattyn11-Nov-07 15:15
sitebuilderLuc Pattyn11-Nov-07 15:15 
GeneralRe: Paint a rectangle Pin
The ANZAC11-Nov-07 15:17
The ANZAC11-Nov-07 15:17 
QuestionCystal Report Pin
Assaf8210-Nov-07 22:38
Assaf8210-Nov-07 22:38 
AnswerRe: Cystal Report Pin
AliAmjad10-Nov-07 23:24
AliAmjad10-Nov-07 23:24 
Questionmake a switch with serial port Pin
nasser5910-Nov-07 8:51
nasser5910-Nov-07 8:51 
AnswerRe: make a switch with serial port Pin
Fu Manchu10-Nov-07 13:23
Fu Manchu10-Nov-07 13:23 
AnswerRe: make a switch with serial port [modified] Pin
Luc Pattyn10-Nov-07 14:38
sitebuilderLuc Pattyn10-Nov-07 14:38 
Hi,

a serial port has two data lines (one input, one output) that carry the data bits in a
serial fashion; it also has some control lines, some of them are inputs, other outputs.
Look for names such as DTR, DCD, RING, RTS, ...

1. If what you need is the app controlling some output:

Once you opened the serial port, you can control the state of those control pins that are outputs.

Warning: the voltages on those pins COULD be anywhere between plus and minus 15V with
respect to the ground pin (GND); and should switch at least between plus and minus 5V.
Also the load you are allowed to connect is limited (don't know the numbers by heart).

So you could connect an LED (with appropriate series resistor, to limit current to
say 15 milliamps) between a control output and GND, and turn it on/off by setting the
corresponding property. If you need to control a higher current you will need either
a relay or some electronics.

2. If what you need is the app responding to some input:

once you opened the serial port, your app can observe (or get PinChanged events) from any of
those control pins that are inputs.

Warning: the voltages you apply to those input pins MUST be between plus and minus
15V (with respect to GND) in order to not damage the hardware, and outside minus and plus
3V to be unambiguous.



For more info on serial ports, there are a couple of articles on CP, such as this one.[^]

Smile | :)


-- modified at 20:57 Saturday 10th November, 2007

Luc Pattyn [Forum Guidelines] [My Articles]


this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google


QuestionHow to manipulate disk quota using vb 6? Pin
gblue0710-Nov-07 6:09
gblue0710-Nov-07 6:09 
QuestionString to Object Question Pin
Fahad Sadah10-Nov-07 5:37
Fahad Sadah10-Nov-07 5:37 
AnswerRe: String to Object Question Pin
AliAmjad10-Nov-07 5:44
AliAmjad10-Nov-07 5:44 
GeneralRe: String to Object Question Pin
Colin Angus Mackay10-Nov-07 10:46
Colin Angus Mackay10-Nov-07 10:46 
GeneralRe: String to Object Question Pin
AliAmjad10-Nov-07 22:21
AliAmjad10-Nov-07 22:21 
GeneralRe: String to Object Question Pin
Fahad Sadah10-Nov-07 23:00
Fahad Sadah10-Nov-07 23:00 
GeneralRe: String to Object Question Pin
AliAmjad10-Nov-07 23:38
AliAmjad10-Nov-07 23:38 
GeneralRe: String to Object Question Pin
Colin Angus Mackay11-Nov-07 0:30
Colin Angus Mackay11-Nov-07 0:30 
GeneralRe: String to Object Question Pin
AliAmjad11-Nov-07 1:29
AliAmjad11-Nov-07 1:29 
GeneralRe: String to Object Question Pin
Colin Angus Mackay11-Nov-07 3:00
Colin Angus Mackay11-Nov-07 3:00 
GeneralRe: String to Object Question Pin
AliAmjad11-Nov-07 4:55
AliAmjad11-Nov-07 4:55 
AnswerRe: String to Object Question Pin
nlarson1110-Nov-07 7:27
nlarson1110-Nov-07 7:27 
GeneralRe: String to Object Question Pin
Fahad Sadah10-Nov-07 23:01
Fahad Sadah10-Nov-07 23:01 
GeneralRe: String to Object Question Pin
Colin Angus Mackay11-Nov-07 0:34
Colin Angus Mackay11-Nov-07 0:34 
QuestionRecording the screen Pin
Zaegra10-Nov-07 2:04
Zaegra10-Nov-07 2:04 
AnswerRe: Recording the screen Pin
Colin Angus Mackay10-Nov-07 2:11
Colin Angus Mackay10-Nov-07 2:11 
QuestionVB2005! DataTable Sorting Pin
NasirLCCI200710-Nov-07 1:12
NasirLCCI200710-Nov-07 1:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.