激情综合丁香-激情综合六月-激情综合婷婷亚洲图片-激情综合图区-激情综合网五月


���}������ͨӍ���̆��}

  ����67573���Pע�^����    
����ѣ��x�����������҆᣿
bingdongcha
1�� ��Ϣ | ���� | �]��


�Ӻ��� �l����
����ͨӍ���̆��}  �l������ Post By��5/21/2013 10:30:00 PM   [ֻ��ԓ����]

DWORD WINAPI CCESerial::ReceiveThreadFunc(LPVOID lparam)
{
CCESerial *lpSerial = (CCESerial*)lparam;
DWORD     dwEvtMask, dwReadError;
COMSTAT  cmStat;
ULONG     nWillLen;


SetCommMask( lpSerial->m_hSer, EV_RXCHAR|EV_ERR  );
for( ; ; )
{
printf( "WRITE WRITE WRITE WRITE CHAR  \r\n");
/************************************************************************************************
// if( WaitCommEvent( lpSerial->m_hSer, &dwEvtMask, NULL ) )
// {
// SetCommMask( lpSerial->m_hSer, EV_RXCHAR|EV_ERR );
// // get how many data available in receive buffer
// if( dwEvtMask & EV_RXCHAR )
// {
// ClearCommError( lpSerial->m_hSer, &dwReadError, &cmStat ); //ȡ���Ք����L����Ϣ
// nWillLen = cmStat.cbInQue;
// if( nWillLen <=0 )
// continue;
//
// lpSerial->m_lDatLen = 0;
// ReadFile( lpSerial->m_hSer, lpSerial->DatBuf, nWillLen, &lpSerial->m_lDatLen, 0 );
//
// if( lpSerial->m_lDatLen>0 )
// {
// // �{�û��{����̎�����յ��Ĕ���
// lpSerial->OnReceive( );
// }
// }
// else if( dwEvtMask & EV_ERR )
// {
// // ���e�`��־
// ClearCommError( lpSerial->m_hSer, &dwReadError, &cmStat );
// lpSerial->OnError( );
// }
//
// }
//
// if( WaitForSingleObject( lpSerial->m_hKillRxThreadEvent, 0 ) == WAIT_OBJECT_0)
// {
// SetEvent( lpSerial->m_hReceiveCloseEvent );
// break;
// }
*************************************************************************************************/
}
return 0;
}


��߅�@������  ����ѭ�h��ӡ�����ǰ�עጵIJ��ִ��_��ֻ���\��һ�δ�ӡ�������Ǿ���ֻ�\����һ�Ρ�
��if( WaitCommEvent( lpSerial->m_hSer, &dwEvtMask, NULL ) )�O�Ô��c����ͣ��Ҳ���܆β��\�С����β�Ҳֱ�Ӿ͆����ˡ�
�Ǻ�WaitCommEvent( lpSerial->m_hSer, &dwEvtMask, NULL ) �@���������Pϵô����

���ڴ��_�r������ͨ�ŷ�ʽ-��������ʽ���_�ġ�
m_hComm = CreateFile( szPort, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0); // ����ͨ�ŷ�ʽ-��������ʽ

�����и��õķ������F�ھ��̃Ȍ��F�հl��������Ҫ����ѭ�hʽͨӍҎ�s��

[���N���ѽ���������2013-5-21 22:39:56��݋�^]

  �������� | ���� | �؏� �ص�픲�
����ѣ��x�����������҆᣿
lqk
2�� ��Ϣ | ���� | �]��


�Ӻ��� �l����
  �l������ Post By��5/22/2013 9:41:00 AM   [ֻ��ԓ����]

WINCE��֧���دBI/Oģʽ�����Բ���ʹ��FILE_FLAG_VOERLAPPED������
WaitCommEvent���������ȴ��������ա�
ͨӍҎ�sһ���й̶��ĸ�ʽ����Ҫ����ͨӍҎ�s�����Ք����ڱ��ؾ���̎����Ȼ��������Ք����ăȺˣ��������đ���

  �������� | ���� | �؏� �ص�픲�
����ѣ��x�����������҆᣿
bingdongcha
3�� ��Ϣ | ���� | �]��


�Ӻ��� �l����
  �l������ Post By��5/24/2013 11:27:00 AM   [ֻ��ԓ����]

�F�����@�ӌ��F�ģ��Ѵ��a�N������ͯЬ�����Խ��b�����B�������¡����^�m������
���Ҏ�sѭ�h�l��CDT���ģ����ڛ]�����دBI/Oģʽ�����̆���ǰ�Ȱl��һ���ֹ����|�lEV_TXEMPTY�¼����Ժ�Ϳ���ѭ�h�l���ˣ������Д�����r��Ҳ���Խ���̎����
����һ��Sleep();�����������ĕ��п��D������Sleep();�@������һֱ���\�У���֪���L�r�g�\�Ќ����������Ƿ����Ӱ푡����r�yԇ�]��Ӱ푣����԰�Sleep();����ˡ�
DWORD WINAPI CDTSend(PVOID lparam)
{
PVOID lpflag;
lpflag = lparam;



DWORD dwEvtMask, dwReadError;
COMSTAT cmStat;
ULONG nWillLen;
unsigned char buf = 0xff;

BOOL bReadStatus;
cdt_tx0.OpenPort(CDTA_Port,CDTA_Bate,CDTA_Pn,8,1);
SetCommMask(cdt_tx0.m_hComm, EV_RXCHAR|EV_ERR|EV_TXEMPTY);
cdt_tx0.WritePort(&buf,1);
while(TRUE)
{
// �������ڕr�g һֱ�ȴ��¼��l����
if(WaitCommEvent(cdt_tx0.m_hComm, &dwEvtMask, NULL))
{
SetCommMask(cdt_tx0.m_hComm, EV_RXCHAR|EV_ERR|EV_TXEMPTY);
if( dwEvtMask & EV_RXCHAR )
{
printf( "CDT_TX0 RECV RECV SUCCESS  \r\n");
ClearCommError( cdt_tx0.m_hComm, &dwReadError, &cmStat ); //ȡ���Ք����L����Ϣ
nWillLen = cmStat.cbInQue; // cbInQue����ʾ���վ��_�^�д惦�Ĵ�ReadFile�xȡ���ֹ�����
// cbOutQue����ʾ�l�;��_�^�д惦�Ĵ��l�͵��ֹ�����
if( nWillLen <=0 )
continue;

cdt_tx0.RecvLen = 0;
bReadStatus = ReadFile(cdt_tx0.m_hComm, cdt_tx0.AcceBuf, nWillLen, &cdt_tx0.RecvLen, NULL);
if(cdt_tx0.RecvLen > 0)
cdt_tx0.Acces(cdt_tx0.AcceBuf,cdt_tx0.RecvLen);
}
if(dwEvtMask & EV_TXEMPTY)
{
cdt_tx0.WritePort(cdt_tx0.SendBuf,cdt_tx0.SendLen);
}
else if(dwEvtMask & EV_ERR)
{
// ���e�`��־
ClearCommError(cdt_tx0.m_hComm, &dwReadError, &cmStat);
}

}
// Sleep(99); // ���̒���r�g99MS  �{�ȕr�g1MS  ���������\�Еr�g100MS
}
return 0;

}

  �������� | ���� | �؏� �ص�픲�
����ѣ��x�����������҆᣿
lqk
4�� ��Ϣ | ���� | �]��


�Ӻ��� �l����
  �l������ Post By��5/24/2013 1:12:00 PM   [ֻ��ԓ����]

�����Ľ��պͰl����ȫ�����Ƀɂ����́��քe��ɣ����҂��Wվ����һƪ����RS485�����ϵ�yDL645�f�hҎ�s�Č��F����http://www.huochepiao123.com.cn/article/article2009326.html����������һ�����Ӆ�����
�����ҪԴ�a��Ո�����]�䡣

  �������� | ���� | �؏� �ص�픲�
����ѣ��x�����������҆᣿
bingdongcha
5�� ��Ϣ | ���� | �]��


�Ӻ��� �l����
  �l������ Post By��5/24/2013 3:35:00 PM   [ֻ��ԓ����]

�҂�Ҳ��645Ҏ�s��
gyangchina@163.com�@���ҵ��]�䣬���x����Դ�a��
�f�ָ��x����

  �������� | ���� | �؏� �ص�픲�
����ѣ��x�����������҆᣿
lqk
6�� ��Ϣ | ���� | �]��


�Ӻ��� �l����
  �l������ Post By��5/24/2013 5:16:00 PM   [ֻ��ԓ����]

�����Ѱl�����]�䣬Ո���ա�

  �������� | ���� | �؏� �ص�픲�

�������

����ͨӍ���̆��}

������
            ��C�a�� ��C�a,�������?Ո�c��ˢ����C�a
���ݣ�
字号
��վ֩���ģ�壺 һ���ػ�¼����Ƶ���| ���һ��aëƬ��ѹۿ�ŷ����Ƭ| �պ���Ʒһ| yy6080�þ����޾�Ʒ| �������߻�ɫ| ����һ��ӰԺ| ��Ƶ�������߹ۿ���Ʒ��Ƶ| ³˿Ƭһ����������| ���������Ʒ��������| ��ˬ�ִ̼���ŷ��ëƬ| ������Ļһ������������ѿ�| ɫ��Ƶ��ѹ����ۿ�| ����11һ12����ŮëƬ| ������Ʒ99һ����������| ���þþ��ۺ�| ������ҹ������������| ����������Ƶ| �����Ҳ���| ���Ⱦ�Ʒ���˵�����������Ƶ| ��ѹۿ���ɫ������Ƶ| �㽶��Ƶ91| �����㽶��Ʒ��Ƶ| ���޾�Ʒ��Ƶ���߹ۿ����| һ����Ƶ��ѹۿ�| �й�һ���ػƴ�ƬëƬ| ��Ѹ�����������| ����һ��91| �������߹ۿ���| ���˿����ձ��| 99�þ��ۺϺݺ��ۺϾþ�һ��| ����ŷ���ձ����޾�Ʒһ4��| �պ���Ʒ�þþþ�ӰԺ| ���޾�Ʒ�þþžž�Ʒ| һ����������ŷ���պ�����| 99�þþþ�Ʒ��ѹۿ�����| �պ�18���߹ۿ���ַ| ���ִ��ֳ��ִ������ˬ�ձ�| ����������˾þü���911| ����91��Ƶ��| ����11һ12����ŮëƬ| ���� ŷ�� �ղ�����|