Click here to Skip to main content
15,924,036 members
Home / Discussions / C#
   

C#

 
GeneralWindows Services Pin
RFickling10-Jul-04 7:07
RFickling10-Jul-04 7:07 
GeneralRe: Windows Services Pin
Mike Dimmick10-Jul-04 8:35
Mike Dimmick10-Jul-04 8:35 
GeneralProblems converting my C++ code to C# Pin
DieFuSiON10-Jul-04 6:39
DieFuSiON10-Jul-04 6:39 
GeneralRe: Problems converting my C++ code to C# Pin
DieFuSiON10-Jul-04 6:40
DieFuSiON10-Jul-04 6:40 
GeneralRe: Problems converting my C++ code to C# Pin
Werdna10-Jul-04 11:12
Werdna10-Jul-04 11:12 
GeneralRe: Problems converting my C++ code to C# Pin
Nick Parker10-Jul-04 18:40
protectorNick Parker10-Jul-04 18:40 
GeneralRe: Problems converting my C++ code to C# Pin
DieFuSiON11-Jul-04 0:46
DieFuSiON11-Jul-04 0:46 
GeneralSerial Communication Problems... Pin
Randy2410-Jul-04 5:17
Randy2410-Jul-04 5:17 
Hello Pps

I implemented a serial communication on a Pocket Pc. I used code out of a msdn article (http://support.microsoft.com/default.aspx?scid=kb;en-us;823179)
to reach my goal........

The target is to send a special bytecode to a microprocessor, which should look like this:

Code + carrige return + checkbyte

ASCII: z004\r<
Byte: 7A 30 30 34 0D 60

Now the program actually runs. Confused | :confused: BUT the COM don't send exactlly what
the program is telling it. So the microprocessor always receive an additional line feed and the data look like this:

7A 30 30 34 0D 0A 60
**
I tried many differently DCB attitudes, but it didn't work.

The DCB struct i used look like this:

public struct DCB <br />
{<br />
      // *** fBitField ***<br />
      // fBinary                 1       binary mode, no EOF check<br />
      // fParity                 2       enable parity checking<br />
      // fOutxCtsFlow            3       CTS output flow control<br />
      // fOutxDsrFlow            4       DSR output flow control<br />
      // fDtrControl             5       DTR flow control type (2 bits)<br />
      // fDsrSensitivity         7       DSR sensitivity<br />
      // fTXContinueOnXoff       8       XOFF continues Tx<br />
      // fOutX                   9       XON/XOFF out flow control<br />
      // fInX                   10       XON/XOFF in flow control<br />
      // fErrorChar             11       enable error replacement<br />
      // fNull                  12       enable null stripping<br />
      // fRtsControl            13       RTS flow control (2 bits)<br />
      // fAbortOnError          15       abort reads/writes on error<br />
      // fDummy2                16       reserved <br />
      // 0000 0100 0000 0011 -> 0x0803<br />
<br />
      public int DCBlength;<br />
      public int BaudRate;<br />
      public int fBitField;<br />
      public Int16 wReserved;<br />
      public Int16 XonLim;<br />
      public Int16 XoffLim;<br />
      public byte ByteSize;<br />
      public byte Parity;<br />
      public byte StopBits;<br />
      public byte XonChar;<br />
      public byte XoffChar;<br />
      public byte ErrorChar;<br />
      public byte EofChar;<br />
      public byte EvtChar;<br />
      public Int16 wReserved2;<br />
}


And the settings

//----- Get existing comm port configuration<br />
intResult = GetCommState(intHandle, ref lpDCB);<br />
<br />
//----- Set required comm port configuration<br />
lpDCB.BaudRate = 1200;<br />
lpDCB.fBitField = 0x0803;<br />
lpDCB.XonLim = 0;<br />
lpDCB.XoffLim = 0;<br />
lpDCB.ByteSize = 7;<br />
lpDCB.Parity = 2;<br />
lpDCB.StopBits = 0;<br />
lpDCB.XonChar = 48; <br />
<br />
intResult = SetCommState(intHandle, ref lpDCB);


So I don't know how to continue..??????????

Thanks for help and excuse my bad english

Andreas
GeneralRe: Serial Communication Problems... Pin
Mike Dimmick10-Jul-04 8:39
Mike Dimmick10-Jul-04 8:39 
GeneralRe: Serial Communication Problems... Pin
Randy2412-Jul-04 7:53
Randy2412-Jul-04 7:53 
Generalpinvoke and winmm.dll Pin
Oldmate10-Jul-04 4:35
Oldmate10-Jul-04 4:35 
Generallogin code Pin
Member 12278839-Jul-04 23:57
Member 12278839-Jul-04 23:57 
GeneralRe: login code Pin
Michael P Butler10-Jul-04 0:24
Michael P Butler10-Jul-04 0:24 
GeneralRe: login code Pin
Member 122788310-Jul-04 0:26
Member 122788310-Jul-04 0:26 
GeneralRe: login code Pin
Michael P Butler10-Jul-04 0:33
Michael P Butler10-Jul-04 0:33 
GeneralWMI Access - Help Pin
wakkerjack9-Jul-04 23:28
wakkerjack9-Jul-04 23:28 
QuestionIn StringBuilder copied from richTextBox fast way to findout end of line ? Pin
evdoxos9-Jul-04 23:23
evdoxos9-Jul-04 23:23 
AnswerRe: In StringBuilder copied from richTextBox fast way to findout end of line ? Pin
mav.northwind9-Jul-04 23:42
mav.northwind9-Jul-04 23:42 
GeneralRe: In StringBuilder copied from richTextBox fast way to findout end of line ? Pin
evdoxos10-Jul-04 0:34
evdoxos10-Jul-04 0:34 
GeneralRe: In StringBuilder copied from richTextBox fast way to findout end of line ? Pin
mav.northwind10-Jul-04 5:22
mav.northwind10-Jul-04 5:22 
AnswerRe: In StringBuilder copied from richTextBox fast way to findout end of line ? Pin
leppie10-Jul-04 1:05
leppie10-Jul-04 1:05 
AnswerRe: In StringBuilder copied from richTextBox fast way to findout end of line ? Pin
partyganger10-Jul-04 4:09
partyganger10-Jul-04 4:09 
GeneralRe: In StringBuilder copied from richTextBox fast way to findout end of line ? Pin
evdoxos10-Jul-04 7:23
evdoxos10-Jul-04 7:23 
Questionhow to make Date function Pin
Anonymous9-Jul-04 20:26
Anonymous9-Jul-04 20:26 
AnswerRe: how to make Date function Pin
mav.northwind9-Jul-04 23:36
mav.northwind9-Jul-04 23:36 

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.