Confused regarding Serial

enonod

Well-Known Member
Licensed User
Longtime User
Having been away for some considerable time I have not kept pace and am trying to catch up. I read about replacement of Serial2 with the Ex version, tried that by using the two seperate dll's, it didn't work.
I read the Serial2 help and it says it is required, so I looked at the file (library) dates and the Ex version is 1-2 days later.
I tried Serial2 and it worked.
The 'updated since' sticky did not help, it is out of date.

Can somebody please explain the current situation please, has serial2 incorporated the Ex version, or viceversa (probably not) or are they different?

Thank you.
 

agraham

Expert
Licensed User
Longtime User
"Updated since" only referred to the Basic4ppc distribution - not the additional libraries.

SerialDesktop and SerialDevice are the original official serial port libraries. SerialDesktop requires DBComm.dll to be in the project directory but it is not added as a component. Apparently DBComm.dll does not work well under .NET 2.0 and these libraries are obsolete.

Serial2 is the official replacement for the original libraries. The same dll works on both device and desktop, does not require DBComm.dll but does require .NET 2.0 or later as it uses the .NET serial port which is only present in .NET 2.0 or later. Unfortunately this library has limitations in dealing with binary data.

SerialEx is not an official Basic4ppc library but is a strict superset of and replacement for Serial2. It exposes the full capability of the underlying .NET serial port and deals properly with binary data. I recommend that you use this library.
 

enonod

Well-Known Member
Licensed User
Longtime User
Thank you for your help and the explanation which is now quite clear.
Perhaps you could assist further. I am using Acer n310 VGA device. I have used the little test program I posted elsewhere yesterday that you responded to.
I have a 26 pin connector on the device to which I have attached a wire for RTS and run the program.
I am convinced that I am on the correct pin, but I get no response from the connected wire.
I have tried settings for both com1 and 2.
The program seems OK in all other respects.
My suspicion is that I am not addressing the correct com port in hardware but there seems to be no information in WM5 Settings for turning on a com port.
When I connect to ActiveSync via bluetooth, com3 virtual is setup.
When I use bluetooth GPS I select a random port and it seems to set up a virtual port.
I am lost with getting the real hardware port working.
Can you help please?

Sub Globals
'Declare the global variables here.
End Sub

Sub App_Start
PortEx.New2(1, 9600, "N", 8, 1)
PortEx.PortOpen=True
Form1.Show
End Sub

Sub Switch_Click
PortEx.RTSEnable = Not( PortEx.RTSEnable)
End Sub

Sub Exit_Click
PortEx.PortOpen=False
End Sub
 

agraham

Expert
Licensed User
Longtime User
Last edited:

enonod

Well-Known Member
Licensed User
Longtime User
I thank you for the clue, which I will follow up (at my own risk).
 

mjcoon

Well-Known Member
Licensed User
I have a 26 pin connector on the device to which I have attached a wire for RTS and run the program.
I am convinced that I am on the correct pin, but I get no response from the connected wire.

I also have a 26-pin connector and the pin-outs, which I have used to connect the data pins for connecting to a serial GPS. (Using both NMEA and Garmin protocol.)

I see (looking back at the code) that I set CTSHandshaking = False because there are no signalling connections. I don't know, or remember, if this made any difference but it would seem a Good Idea in your case since you want to take control of the signal lines.

The other problem is knowing whether your pin-outs assume that you are a host or terminal. This swaps the meaning of RTS and CTS and of DTR and DSR (and of course TD and RD!).

If I use the "official" cable that I bought for my device to connect to the GPS I have to use a "null modem" cable to swap the connections (because it is meant for connecting to a host PC) whereas my own mome-made plug (which has a 2.5mm stereo socket built-in) does not need it.

HTH, Mike.
 

enonod

Well-Known Member
Licensed User
Longtime User
As an addendum to this, people might like to know that AllPinouts - Connectors, Cables and Adapters Pinouts shows the connector as the reverse to the link you gave me. That of course makes it difficult to decide, as that is the one I used.
If the [1] marked on my plug is anything to go by (which is adjacent to the gnd pins) it would suggest that the link you gave shows the wrong pinout. The remaining wires for USB on my plug seem to bear this out, though not conclusive.
It is also the case that the pis have odd & even sides, but because the adjacent pins are joined, it is uncertain which side is odd/even, except for this little [1] which might not even be a pin marker.

So be cautious! I don't know a way to be sure, if anybody does please post.
 
Top