LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-11-2012, 03:29 AM   #1
tinaelizabeth84
LQ Newbie
 
Registered: Apr 2007
Posts: 6

Rep: Reputation: 0
tcl scripting-serial communication


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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Serial Communication mail2rajan89 Linux - Software 3 06-17-2011 09:48 AM
Serial Communication Suraj Swami Linux - Newbie 1 06-25-2009 08:25 AM
Serial Communication Suraj Swami Linux - Newbie 3 06-23-2009 12:22 PM
Serial Communication help mitchell2345 Linux - Software 2 03-20-2009 09:41 PM
TCL Scripting in Emacs wildcat22 Linux - Software 4 08-06-2004 12:12 PM


All times are GMT -5. The time now is 12:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration