.Net work with Com port?

0 like 0 dislike
5 views
I can suggest a piece of code .Net to raise the voltage on any pins of Com-port(RS232) for a period of time in 10sec? Thank you very much.
by | 5 views

3 Answers

0 like 0 dislike
my two cents:
to work with com-port .net since 2.0 has a wonderful System namespace.IO.Ports (Oh how I rejoiced when he appeared in 2.0 before this had to be subverted)
\r
as already correctly wrote — working voltage com port is +-12V. and +12V is a logic 0 and -12V is a logic 1. i.e. physically +5 can only be obtained using external iron:
\r
Option1: I recommend to look in the direction of chips max232 or equivalent adm232 is a standard level Converter, is often used by electronics manufacturers of cell phone so do a lot who.
\r
option 2: collect DAC of a single capacitor and resistor and to implement PWM on any leg.
\r
now about what you can manage.
directly manage in the com-port is only two tones: DTR and RTS. in .net.system.io.ports they are set approximately such code:
\r
SerialPort sp1 = new SerialPort("COM1");
sp1.Open();
sp1.DtrEnable = false;
sp1.RtsEnable = true;
\r
but if strongly to be perverted and to think a head, to play with the port settings (such as stop-start bits and parity) and is constantly sending data to the port it is possible to achieve more control and foot TX (special perversion had to do the PWM on the TX leg ;)
\r
here about something like that.
by
0 like 0 dislike
software and +5V exactly — nothing. he has a voltage changing from +5..+15 for "0" and -5..-15 for "1". including catches you there is likely something in the area (±)7..8V
view diagrams online(google: rs232 5v), which will give you a smooth 5v, and then search for softwae decision as to the pin to give the time 1. (however, afaik, you will still get "saw", because, depending on the frequency will still drop to "logincache unclear" (+3v)). in General, no additional schema does well
by
0 like 0 dislike
there you can manage only 2-3 pins, and it's a non-standard port mode, it can support only built-in ports (now it seems that even not all). IMHO it is better to take the cheapest Tignes or peak, it is the cable com-com and do it all without perversion. in the normal mode to work with com port is not harder than the file, except that you will need to configure the timeouts and configuration
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
3 answers
110,608 questions
257,186 answers
0 comments
28,875 users