Serial Help-Basic4ppc-WIndows

Discussion in 'Questions (Windows Mobile)' started by jeterry, May 30, 2015.

  1. jeterry

    jeterry Member Licensed User

    I am trying send data to a serial device and I need to send a ready to send command (RTS) and then wait for a clear to send command (CTS) .

    The help isn't clear on the process. I have add these two items to the serial port set - Serial.RTSEnable = True and Serial.CTSHandshaking = True

    here is the code:
    Serial.BitRate = 9600 'baud rate
    Serial.CommPort = 1
    Serial.Timeout = 500
    Serial.MaxInputLen = 300
    Serial.RTSEnable = True
    Serial.CTSHandshaking = True
    Serial.EnableOnComm = True
    Serial.PortOpen = True

    My question is= How do I send a RTS to the serial device and how will I know when the device has sent me a CTS signal.

    Thanks for any help
  2. RandomCoder

    RandomCoder Well-Known Member Licensed User

    I don't know where the official documentation is for B4PPC any more having just had an unsuccessful scout round for some. Anyhow please see attached which is a manual I have stored on my own system, hopefully it will help. Looks to me like you need to set the Serial.DTR = True and then wait for the event to be raised from Serial data arriving at the port.

    File is too large, please use this link instead... 4.05 Manual for PDA.pdf?dl=0
  3. agraham

    agraham Expert Licensed User

    You don't say which library you are using but here is the archive for my SerialEx library which fixes several problems with the original Serial library, including monitoring pin changes. Details in the help in the archive.

    To detect CTS changes set EnableOnPinChanged = True and in the OnPinChanged test the state of the CTS property. You could also use a Timer instead.

    Attached Files:

  4. jeterry

    jeterry Member Licensed User

    Thanks for the reply, I am using the original serial library. I also failed to mention this is a DEX communication device. The device only has three wires, RXD, TXD and Ground, pins 2,3 and 5 on a DB9 connector. The DEX communication device is just a serial connector, using a 1/4" RCA phone jack, you plug into a retail stores DEX receiver and then transmit a invoice to the store.

    I can transmit the data via a null modem cable and see the data being sent to a terminal software program, so I know that works. The problem is, I need to send a ready to send command (RTS) and then wait for the store to send a CTS signal.

    So I am at a loss as to how to proceed. So if someone would provide me with some help I would gladly pay the for their time.

    Again thanks agraham for the reply.
  5. agraham

    agraham Expert Licensed User

    I assume your setup is a PC or Windows Mobile device with a fully specified DB9 serial port attaching to this DEX thingy that only has a reduced interface.

    I further therefore assume that the requirement for the RTS/DTS must therefore be at the PC or device. Why is this as the software at that end must be entirely under your control? However if this is not the case can you not just wire RTS to CTS, possibly using a breakout box, so the PC/device sees CTS immediately it asserts RTS?
  6. jeterry

    jeterry Member Licensed User

    Here is a link to the DEX cable and the rs232 cup that attaches to the intermec handheld.-

    The handheld is also shown in this persons ebay ad. The OS is windows mobile 5

    I have no control of what the device is plugging into as that's at the store level and under their software control. What I need to do is send RTS and wait for the store to send the CTS signal, once reecived I can then transmit the my data.

    Will using RTSEnable start the RTS process or do I have to do something else. Assuming this is all I have to do. Next would be what value will CTS, per serial library help, have when it is received. Is it numeric value or true or false value. In either case can I just do a while loop until the value is received.

    Thanks for your time agraham
  7. agraham

    agraham Expert Licensed User

    I'm missing something here! RTS and CTS are hardware pins and they apparently do not exist at the store end as that jack can only handle the two data pins and ground so I don't see how the store can receive an RTS and assert a CTS in response. Are you sure you are not confusing the hardware pins with some sort of query/response via data packets.

    Where does this apparent requirement for RTS/CTS come from. Is it documented anywhere?
  8. jeterry

    jeterry Member Licensed User

    This was a assumption on my part, in that I was test a software package that will DEX, a demo package from Intermec, and when the software started the DEX transmission it stated it was sending a ready to send request and then waiting for a response from the store before sending the data. And that's where I got the information.

    There is no pre data packs being sent to my knowledge.

    As for as any documentation goes no. They tell you how the data is to be structured, but they don't tell you the communication part, at lease not that I can find from the three grocery chains, I am dealing with. I guess that I will try to get with the hardware people and find out what is going on.

    Question is it possible to send data bits that would emulate sending RTS and receiving CTS?

    Thanks again for your time.
  9. agraham

    agraham Expert Licensed User

    That looks like the software "query/response via data packets" that I mentioned above and not a hardware RTS/CTS handshake.

    No. If the hardware is not there you can't do anything about it.