Needs["NETLink`"]

InstallNET[];

NETTypeInfo["System.IO.Ports.SerialPort"]

ser = NETNew["System.IO.Ports.SerialPort","COM8",9600]

ser@Open[]

Button["Open",ser@Open[]]

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

Button["Set Offset",ser@Write["S"]]

Button["Reset",ser@Write["R"]]

Show[Graphics3D[{Red,Arrowheads[0.1,2],Arrow[Tube[{{0,0,0},{Dynamic[Refresh[ser@Write["X"];ToExpression[ser@ReadLine[]],UpdateInterval->0.1]],Dynamic[Refresh[ser@Write["Y"];ToExpression[ser@ReadLine[]],UpdateInterval->0.1]],Dynamic[Refresh[ser@Write["Z"];ToExpression[ser@ReadLine[]],UpdateInterval->0.1]]}},5]]},PlotRange->{{-256,256},{-256,256},{-256,256}}]]