Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

tcl script for serial communication

Status
Not open for further replies.

tinaelizabeth84

Newbie level 1
Newbie level 1
Joined
Sep 11, 2012
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,291
Hi,

I am new to TCL scripting.
I need to open a serial connection,write a command and read its output.
with my program I can send all command I want to to the errial communication but the output of the command is not proper.At times it gives the correct output.At times it gives partial output or at time it will be mixed up (like a buffer overflow).
My program looks like

set DUT_Console "/dev/ttyS0" ;# Com port no for DUT1
set DUT_Baud "9600"

set fh [open $DUT_Console RDWR]
fconfigure $fh -mode $DUT_Baud,n,8,1
fconfigure $fh -blocking 1 -buffering none -timeout 1000
#fconfigure $fh -mode 9600,n,8,1 -blocking 1 -translation auto -buffering none -timeout 1000 -handshake xonxoff
puts -nonewline $fh "info\r"
puts "DUT echo: [read $fh]"
flush $fh
close $fh

command "info" is just an example.

Can anyone help me out?

I see that info is given to my serial communication properly.Problem is with the output.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top