Serial Port Doen't Appear To 'Activate' With VB Like Hyperterm Or Putty..?

QuattroDave

New member
Joined
Aug 18, 2009
Messages
3
Programming Experience
1-3
Hiya Guys,

I'm trying to write a bit of code to communicate with a serial port coin mech. The problem i have is that the coin mech works fine when used with Putty or Hyperterm but i do not appear to be able to 'activate' the serial port with my VB code...

Putty & Hyperterm settings:-

Serial Port: COM1
Speed: 1200
Data Bits: 8
Stop Bits: 1
Parity: None
FlowControl: XON/XOFF

Code (VB Studio Express 2005) :-

Public Sub New(ByVal synchronisingObject As ISynchronizeInvoke)
ComPortUsed = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\Software\NJB", "COMUSED", Nothing)
PricePerTrack = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\Software\NJB", "PRICETRACK", Nothing)
Me.synchronisingObject = synchronisingObject
'Create and open SerialPort here.
Port = New SerialPort("COM1", 1200, Parity.None, 8, StopBits.One)
If Port.IsOpen = False Then
Port.Open()
End If
End Sub

When i open the hypertem or putty session the coinmech's active light immediatly comes on and i am able to send and recieve data. When the port is opened with the code nothing happens.... I'm at a complete loss any help or pointers would be greatly apreciated....

Many thanks in advance

Dave
 
Hiya,

Just to finish this up, i eventually worked it out.... I wasn't handshaking with the coin mech. 1 line of code and its all working as it should!!!

Dave
 
VB.NET:
Port.Handshake = Handshake.XOnXOff
 
Back
Top