Bill Acceptor Programming

abo0badr

Member
Joined
Nov 22, 2012
Messages
9
Programming Experience
3-5
I have just a Microcoin GBA ST2 Bill Acceptor that is interfaced through RS232. The Company gave me an emulator that I can try my Device with, but My problem is I should not use it for my on-design System,

I need help on how to power-up the validator/acceptor using COM Port commands in vb.net,
Since it is disabled when I supply power to the acceptor, only through the Emulator of the company I can make it enabled.

I was wondering if somebody can help with this problem, how to power-up the bill Validator using the .net project..Because my system is created in VB.Net.

Please any one with experience in connecting the bill acceptors please give a comment,,,

Thanks in advance
 
Maybe read the manual that came with it that explains the initialization procedure? If it is good old RS232, there is likely a combination of lines you need to toggle to reset/poweron the device. In doubt just look at the service manual or schematic.
 
Maybe read the manual that came with it that explains the initialization procedure? If it is good old RS232, there is likely a combination of lines you need to toggle to reset/poweron the device. In doubt just look at the service manual or schematic.

yeah there is actually a combination of lines like :

Message #Sent to ValidatorReceived from validatorStatusEvent
102 08 10 1F 10 00 03 1702 08 20 01 00 01 00 03 02 03 2AIDLPower Up
202 08 11 1F 10 00 03 1602 08 21 01 10 01 00 03 02 03 3BIDLPower Up
302 08 10 1F 10 00 03 1702 08 20 01 10 00 00 03 02 03 3BIDL


But I don't really know how to figure it out. I tried sending to the validator using the Hyperterminal.exe or Terminal.exe but nothing happens. it is still IDLE or Not Enabled/Standby.

Can you give me some hints or the way I would make it run?

Thank you so much
 
That is binary data, you cannot send this through hyperterminal, but you might through another proper terminal that supports entering data in hex. Or through VB... The only hints i can give you is read the manual again and again until you understand it.
 
The problem is I am a newbie in .Net
I only can understand a little. Can you just give me some sample codes that I can start with? or follow?
it is not included in the manual if how am I going to power it up or something like that.

Actually the company gave me an emulator to test the validator, it is running in good condition, but it is in .EXE, and my problem is how am I going to activate or enable it.
when it comes to the detecting of the Bill maybe I can do some work with that, but the main problem for now is how to enable it using those hexadecimal codes. :(
 
You don't have to enable anything just send those 8 bytes over at the correct baud rate.
just like that? I send them and it will power up? but how am I going to send a HEX??I have not yet tried to use sending over the COM port..Just the receiving part :D
 
I tried to make a program that will send the command lines to the validator but it does not do anything, maybe my code is wrong? can you please just comment on my code if what is wrong there? Thanks. here is my code

VB.NET:
Public Class Form1    Dim WithEvents myComPort As New System.IO.Ports.SerialPort
    Dim counter As Integer




    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        counter = 0
        If Not myComPort.IsOpen Then
            Try
                myComPort.BaudRate = 9600
                myComPort.PortName = "COM2"
                myComPort.Parity = IO.Ports.Parity.None
                myComPort.DataBits = 8
                myComPort.StopBits = IO.Ports.StopBits.One
                myComPort.Handshake = IO.Ports.Handshake.None
                myComPort.ReadTimeout = 3000
                myComPort.ReceivedBytesThreshold = 1
                myComPort.DtrEnable = True


                myComPort.Open()




            Catch ex As Exception
                MsgBox("Error Opening COM Port", MsgBoxStyle.Critical)
                End
            End Try
        End If
        Timer1.Enabled = True
        Dim onebuff() As Byte = {&H2, &H8, &H10, &H1F, &H10, &H0, &H3, &H17}
        Dim twobuff() As Byte = {&H2, &H8, &H11, &H1F, &H10, &H0, &H3, &H16}
        Dim threebuff() As Byte = {&H2, &H8, &H10, &H1F, &H10, &H0, &H3, &H17}
        If counter = 6 Then
            myComPort.Write(onebuff, 0, onebuff.Length)
        End If
        If counter = 7 Then
            myComPort.Write(twobuff, 0, twobuff.Length)
        End If
        If counter = 8 Then
            myComPort.Write(threebuff, 0, threebuff.Length)
        End If
        Dim rcvBuf(1024) As Byte
        If counter = 12 Then


            myComPort.Read(rcvBuf, 0, rcvBuf.Length)
        End If
        If counter = 20 Then
            TextBox2.Text = TextBox2.Text + rcvBuf(0)
            TextBox2.Text = TextBox2.Text + rcvBuf(1)
            TextBox2.Text = TextBox2.Text + rcvBuf(2)
            TextBox2.Text = TextBox2.Text + rcvBuf(3)
            TextBox2.Text = TextBox2.Text + rcvBuf(4)
            TextBox2.Text = TextBox2.Text + rcvBuf(5)
            TextBox2.Text = TextBox2.Text + rcvBuf(6)
            TextBox2.Text = TextBox2.Text + rcvBuf(7)
            TextBox2.Text = TextBox2.Text + rcvBuf(8)
            TextBox2.Text = TextBox2.Text + rcvBuf(10)
            TextBox2.Text = TextBox2.Text + rcvBuf(11)
            TextBox2.Text = TextBox2.Text + rcvBuf(12)
        End If
    End Sub


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Enabled = False
    End Sub
    Private Sub Timer1_Tick(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Timer1.Tick
        counter = counter + 1
        TextBox1.Text = counter
    End Sub


    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        counter = 0
        TextBox1.Text = 0


    End Sub
End Class
 
Back
Top