07-22-2002 10:41 AM
07-22-2002 11:58 AM
05-20-2007 02:41 PM
ok good example
write code ansi and display decimal in a micro atmega
how i can write code decimal and display decimal ?
05-20-2007 05:43 PM - edited 05-20-2007 05:43 PM
Message Edited by mikeporter on 05-20-2007 06:44 PM
05-21-2007 12:01 PM
05-21-2007 08:56 PM
05-21-2007 10:23 PM - edited 05-21-2007 10:23 PM
The code shown below does the same thing. If you can't get the basic serial write and read example to work by entering a numeric value into the string control, then using a numeric control on the front panel and converting to a string won't work either.
You have posted the same question over and over again and have been asked to provide additional information. Such as, does the micro code require a CR and LF at the end of each command? Are you sure it requires ASCII (there is no such thing as ansi)? Does it work with Hyperterminal? Answer some of these questions instead of just saying your LabVIEW program does no work.
If you are going to talk about some vb example that works, provide a link to the code or post the code itself. The statement 'Research_TelB ' is meaningless.
You might also consider posting your question in both English and your native language.
Message Edited by Dennis Knutson on 05-21-2007 09:27 PM
05-21-2007 10:37 PM
i put 'Research_TelB because is the link above
code in VB `work very well
Private Sub Command1_Click()
variable = Val(Text1.Text)
MSComm1.Output = Chr(variable)
End Sub
Private Sub msComm1_OnComm()
y = MSComm1.Input
Label1.Caption = y
End Sub
Private Sub Form_Load()
MSComm1.CommPort = 1 'define puerto serial comm1
MSComm1.InBufferSize = 1024 'default mayor tamaño
MSComm1.InputLen = 0 'no limita tamaño
MSComm1.Settings = "9600,n,8,1" 'define velocidad, paridad etc
MSComm1.RThreshold = 1 'hab int al recibir
MSComm1.SThreshold = 1 'hab int al transmitir
MSComm1.Handshaking = comNone 'protocolo
MSComm1.DTREnable = False 'lineas de protocolo NO
MSComm1.NullDiscard = False 'no descarta los nulos
MSComm1.PortOpen = True 'abrir puerto
End Sub
05-21-2007 10:52 PM
05-21-2007 10:54 PM - edited 05-21-2007 10:54 PM
The Chr command converts text to numeric I believe. So, it does not appear you want to send ASCII text. For example, to send a carriage return which is decimal 13 or hex D, you do a Chr(13). In LabVIEW, you can use the Byte Array to String function. You can use the Type Cast function. You can also right click on a string control/constant and select Hex Display. Enter the commands in hex.
p.s. you just put the text 'Research_TelB' in the post. You did not insert a link.
Message Edited by Dennis Knutson on 05-21-2007 09:55 PM