00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
AC 81 1A 92 1E 26 20 21 C6 30 60 39 52 8D 7D 8F
90 18 19 1C 1D 22 13 14 DC 22 61 3A 53 9D 7E 78
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
If you notice all of the data came thru fine except for in the range
between 0x7F and 0xA0. The above data is consistent i.e. I always get
0xAC when expecting 0x80. Using a Port monitor (Portmon
http://www.sysinternals.com) I saw that the data on the two ports were
what was to be expected. This makes me believe that the problem is
somewhere in one of the settings of the control or the somewhere in the
COleVariant that I pass it. here is some of the code I used in Visual
C++ 6.0
file://Set up the serial port located in OnInitDialog
m_MSComm.SetCommPort(2);
m_MSComm.SetSettings("38400,N,8,1");
m_MSComm.SetInputMode(0); file://comInputModeText
m_MSComm.SetHandshaking(0); file://no Handshaking
m_MSComm.SetInBufferSize(1024); file://Set Inbuffer to 1024
m_MSComm.SetOutBufferSize(512); file://Set Outbuffer to 512
m_MSComm.SetInputLen(1); file://Set InputLength to 1
m_MSComm.SetRThreshold(1); file://Set Recive Threshold to 1
m_MSComm.SetSThreshold(1); file://Set Send Threshold to 1
m_MSComm.SetDTREnable(FALSE); file://Set DTR OFF
m_MSComm.SetRTSEnable(TRUE); file://Set RTS ON
m_MSComm.SetPortOpen(TRUE); file://Set Port open
file://Here is the OnMSComm routine
file://m_RcvdData is the member variable attached to the main editbox
void CLoggerEmulatorDlg::OnOnCommMscomm()
{
unsigned char cTemp;
COleVariant cvTemp;
CString csTemp;
int i;
while(m_MSComm.GetInBufferCount()>0)
{
UpdateData(TRUE);
while(m_MSComm.GetInBufferCount()>0)
{
cvTemp = m_MSComm.GetInput(); file://returns a Variant
cTemp = (unsigned char )(*cvTemp.bstrVal);//look at variant.bstrVal
i = 0;
if (cTemp == 0x7F)
{
i = 0;
}
csTemp.Format("%2.2X ",cTemp);
m_RcvdData = m_RcvdData + csTemp;
}
m_RcvdData = m_RcvdData + CString("\r\n");
UpdateData(FALSE);
}//end while
}
The GetInput member function will return a variant. Which i store in a
COleVariant variable. This i use to extract the Byte that I am
expecting. InLength is set to 1 and InputMode is set to text.
any help you can get i will apreciate. I have run out of ideas of where
to look for my fault.
Thanks Jacob Scarpaci
You mention
file://comInputModeText
and the bytes are OK for the actual ascii stuff 0-7F
Is there a way of setting the control to handle 'binary'?
Warren
-JS
anenxboy1 <scar...@email.uc.edu> wrote in message
news:ne0k5.37780$t%4.22...@typhoon.kc.rr.com...