void __fastcall TForm1::SendData(BYTE iData)
{
DWORD *buf = (DWORD *)buffer;
DWORD dwError,dWAddr;
ULONG iReadNum;
if ( PLX9054[0].hDevice != INVALID_HANDLE_VALUE ){
ULONG nRead = 0;
ULONG i;
*buf = 0x1700 + iData;
nRead = PLX9054[0].P9054_WriteBlockLocal ( 0, buf, 4, 3);
Sleep(0);
*buf = 0x1300 + iData;
nRead = PLX9054[0].P9054_WriteBlockLocal ( 0, buf, 4, 3);
Sleep(0);
*buf = 0x1200 + iData;
nRead = PLX9054[0].P9054_WriteBlockLocal ( 0, buf, 4, 3);
Sleep(0);
}
void __fastcall TForm1::SendCommand(BYTE iData)
{
DWORD *buf = (DWORD *)buffer;
DWORD dwError,dWAddr;
ULONG iReadNum;
if ( PLX9054[0].hDevice != INVALID_HANDLE_VALUE )
{
ULONG nRead = 0;
ULONG i;
*buf = 0x1f00 + iData;
nRead = PLX9054[0].P9054_WriteBlockLocal ( 0, buf, 4, 3);
Sleep(1);
*buf = 0x1B00 + iData;
nRead = PLX9054[0].P9054_WriteBlockLocal ( 0, buf, 4, 3);
Sleep(1);
*buf = 0x1A00 + iData;
nRead = PLX9054[0].P9054_WriteBlockLocal ( 0, buf, 4, 3);
Sleep(2);
} |