Needs["NETLink`"]
InstallNet[];



ser=NETNew["System.IO.Ports.SerialPort","COM4",9600]
ser@Open[]
Button["CONNECT",ser@Open[]]

«NETObject[System.IO.Ports.SerialPort]»

Button["1",ser@Write["1"]]
Button["2",ser@Write["2"]]
Button["3",ser@Write["3"]]

Button["4",ser@Write["4"]]
Button["5",ser@Write["5"]]

Button["6",ser@Write["6"]]

Button["7",ser@Write["7"]]
Button["8",ser@Write["8"]]
Button["9",ser@Write["9"]]

Button["0",ser@Write["0"]]


Button["Stop Program",ser@Close[]]