13.07.2015 Views

User manual - ICP DAS USA

User manual - ICP DAS USA

User manual - ICP DAS USA

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

• Send_Receive_CmdDescription:This function is used to sends a command string to RS-485 network and receives theresponse from RS-485 network. If the wChkSum=1, this function automatically adds thetwo checksum bytes into the command string and also check the checksum status whenreceiving response from the modules. Note that the end of sending string is added [0x0D]to mean the termination of every command.Syntax:[ C ]WORD Send_Receive_Cmd (char port, char szCmd[ ], char szResult[ ],WORD wTimeOut, WORD wChksum, WORD *wT)Parameter:port : [Input] 1=COM1, 2=COM2, 3=COM3..., 255=COM255.szCmd: [Input] Sending command stringszResult : [Input] Receiving the response string from the moduleswTimeOut :: [Input] Communicating timeout setting, the unit=1mswChkSum :: [Input] 0=Disable, 1=Enable*wT: [Output] Total time of send/receive interval, unit=1 msReturn Value:0 is for SuccessNot 0 is for FailureExample:char m_port =1;DWORD m_baudrate=115200;WORD m_timeout=100;WORD m_chksum=0;WORD m_wT;char m_szSend[40], m_szReceive[40];int RetVal;m_szSend[0] = '$';m_szSend[1] = '0';m_szSend[2] = '0';m_szSend[3] = 'M';LinPAC-8x4x SDK:44

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!