Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2004-09-14
21:00 • Closed ticket [1027924fff]: translation binary plus 9 other changes artifact: 9d6dfa50a9 user: dkf
13:56 • New ticket [1027924fff]. artifact: ca83ecd340 user: nobody

translation binary

Closed / Invalid1027924fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2004-09-14 13:56:47
tcl version 8.4.2
system windows xp

problem:-
setting serial com port to translation binary causes data 
to be output to the serial port ending with a LF. The 
data should end blank.

This is a problem when using RS485 Modbus protocol for 
the commands sent are not recognized by remote 
equipment because of this LF.

I can supply oscilloscope traces of a working solution 
using Visual Basic and the erroneous output using Tcl.

code:

#send rtu command to config use with asci
set tty [open com2 {WRONLY}]
fconfigure $tty -translation {binary}
fconfigure $tty -buffering {none} -buffersize 8
fconfigure $tty -handshake {none} -mode 9600,n,8,1
fconfigure $tty -blocking 1 -timeout 1000
fconfigure $tty -eofchar {}
set tx_comms [binary format "W1" 0x0105000300003dca]
puts $tty $tx_comms
pause 100
set tty [close $tty]
dkfplain2004-09-14 21:00:57
Logged In: YES 
user_id=79902

This is by design. Use:
  puts -nonewline $tty $tx_comms
Log in (anonymous is fine) to add a comment.