Serial Help-Basic4ppc-WIndows

jeterry

Member
Licensed User
Longtime 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
 

RandomCoder

Well-Known Member
Licensed User
Longtime 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... https://www.dropbox.com/s/xx653jyx20n0vsw/B4PPC 4.05 Manual for PDA.pdf?dl=0
 

agraham

Expert
Licensed User
Longtime 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.
 

Attachments

  • SerialEx1.1.zip
    28.2 KB · Views: 233

jeterry

Member
Licensed User
Longtime 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.


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.
 

agraham

Expert
Licensed User
Longtime 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?
 

jeterry

Member
Licensed User
Longtime 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?

Here is a link to the DEX cable and the rs232 cup that attaches to the intermec handheld.-http://www.ebay.com/itm/New-Intermec-CN50-CN51-Series-Dex-Adapter-w-cable-852-923-001-/251976049416?pt=LH_DefaultDomain_0&hash=item3aaaf16308

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
 

agraham

Expert
Licensed User
Longtime 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?
 

jeterry

Member
Licensed User
Longtime 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?

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.
 

agraham

Expert
Licensed User
Longtime User
This was a assumption on my part ... 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.
That looks like the software "query/response via data packets" that I mentioned above and not a hardware RTS/CTS handshake.

Question is it possible to send data bits that would emulate sending RTS and receiving CTS?
No. If the hardware is not there you can't do anything about it.
 
Top