K8056 demo conversion to Visual Basic 2010

Has anyone managed to convert the demo software to Visual Basic 2010 yet?

This is my code:
Private Sub Btn_L1On_Click(sender As System.Object, e As System.EventArgs) Handles Btn_L1On.Click
Btn_L1On.BackColor = Color.Green
Btn_L1Off.BackColor = Color.GhostWhite

    [u]checksum[/u] = (255 - ((((13 + address + Asc("S") + Asc("1")) / 256) - Int((13 + address + Asc("S") + Asc("1")) / 256)) * 256)) + 1
    messagestring = [u]Chr$(13)[/u] & [u]Chr$(address)[/u] & "S1" & [u]Chr$(checksum)[/u]
    messagestring = messagestring & messagestring
    messagestring = messagestring & messagestring
    [u]ComPort.Output[/u] = messagestring
End Sub

The underlined parts are showing as errors. I’m new to VB so I apologise if this is a stupid mistake, but how do I change these to work in VB2010.
Thanks for any help you can provide,
Tony

At fist :

Use Chr(…) instead of Chr$(…)

Where and how are checksum and ComPort defined in your code? (types? functions?)

Visual Basic 6 is a native Windows compiler, while what you call VB2010 is actually Visual Basic .NET (programming language) in Visual Studio 2010 (IDE). Both are VERY different.

[quote]ComPort.Output[/quote]ComPort is an ActiveX component to communicate with a serial port. The Output method can be used to send data. In Visual Basic .NET, you should use the SerialPort class (.NET 2.0 or higher) for serial communication.

[quote]Chr$(13)[/quote]I believe this converts the value 13 to a character so it can be appended to the messagestring. Concatenating strings in VB6 is done with the “&” character.

[quote]Asc(“S”)[/quote]This gets the ASCII value for the character “S”.

Visual Basic 6 vs Delphi 7

Chr$ = Chr
Asc = Ord