Thank you khalid for your very fast responses, it works, but not as smoothly as VB program do.
these are VB codes:
Dim a As StringOption ExplicitPrivate Sub Form_Load()MSComm1.CommPort = 1MSComm1.Settings = "9600,n,8,1"MSComm1.PortOpen = TrueEnd SubPrivate Sub HScroll1_Change()a = HScroll1.ValueMSComm1.Output = Chr$(a)Debug.Print aText1.Text = aEnd Sub
(my VB app have a little bug, can you find it!?)
and this is Microcontroller codes in BASIC
Do B = Inkey() If B > 0 Then B = B * 4 Pwm1a = B End IfLoop
(Pwm1a must be between 1 and 1024)
VB divide pulse width in 255 section, but as it seems LabView just divide it into 10.