PLC omron to VB example

In this post , I'd like to Change the state of PLC (run,monitor,stop) from the VB.I send the command from VB to PLC and then PLC responds and the change their state ,
please make VB interface below:

write the source code below:
Dim data 'General Declaration
Private Sub kirim()
Dat$ = data
l = Len(Dat$)
A = 0
For I = 1 To l
Opo$ = Mid$(Dat$, I, 1)
A = Asc(Opo$) Xor A
Next I
FCS$ = Hex$(A)
If Len(FCS$) = 1 Then

FCS$ = "0" + FCS$
End If
DatTX$ = Dat$ + FCS$ + "*" + Chr$(13)
MSComm1.Output = DatTX$
End Sub

Private Sub cmdKeluar_Click()