urgent help needed: C++ and rs232

17 years 11 months ago #4183440 by dcecar
urgent help needed: C++ and rs232 was created by dcecar
<P style="MARGIN: 0px">I've been using rs232 and win32 com port software to communicate with gps/oopic/dmc-8 etc and all work. however i am having problems with roboteq.
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">Its a bit confusing, the specs ask for
<P style="MARGIN: 0px">
<FONT face=Univers-Bold> <P style="MARGIN: 0px" align=left><STRONG>9600 bits/s, 7-bit data, 1 Start bit, 1 Stop bit, Even Parity</STRONG>
<P style="MARGIN: 0px" align=left>
<P style="MARGIN: 0px" align=left>but I am not sure where the Start bit is used. I currently use the following API's for COM ports:
<P style="MARGIN: 0px" align=left>
<P style="MARGIN: 0px" align=left>CreateFile()
<P style="MARGIN: 0px" align=left>SetupComm()
<P style="MARGIN: 0px" align=left>BuildCommDCB()
<P style="MARGIN: 0px" align=left>SetCommState()
<P style="MARGIN: 0px" align=left>ClearCommError()
<P style="MARGIN: 0px" align=left>WriteFile()
<P style="MARGIN: 0px" align=left>ReadFile()
<P style="MARGIN: 0px" align=left>
<P style="MARGIN: 0px" align=left>When looking at the status of ClearCommError() i can see in input queue groqing, even tough i perworm reads, so thats a big confusing as well.
<P style="MARGIN: 0px" align=left>
<P style="MARGIN: 0px" align=left>Currently I connect (while the controller is in rs232 no watchdog state) and send command (such as "!A30") but nothing happens. I do the same comnmand in windows hyper terminal and it works.
<P style="MARGIN: 0px" align=left>
<P style="MARGIN: 0px" align=left>Any help would be apreciatted.
<P style="MARGIN: 0px" align=left>
<P style="MARGIN: 0px" align=left>thanks
<P style="MARGIN: 0px" align=left><BR>Dejan
<P style="MARGIN: 0px" align=left>
<P style="MARGIN: 0px" align=left>
<P style="MARGIN: 0px" align=left>
</FONT>

Please Log in or Create an account to join the conversation.

17 years 11 months ago #4190936 by slauziere
Replied by slauziere on topic Re:urgent help needed: C++ and rs232
are you sending a newline or carriage return character in your program?

Please Log in or Create an account to join the conversation.

17 years 11 months ago #4190997 by cosma
Replied by cosma on topic Re:urgent help needed: C++ and rs232

It is a carriage return (hex 0D)

Please Log in or Create an account to join the conversation.

17 years 10 months ago #4208439 by tonysantoni

This is probably totally unrelated, but there is a difference between strings in Basic and in C.
<P style="MARGIN: 0px">Unlike Basic, C builds all strings zero terminated. I wonder if this may cause a problem.
<P style="MARGIN: 0px">
<P style="MARGIN: 0px">Tks
<P style="MARGIN: 0px">Tony

Robotony

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.056 seconds