Sponsored Content
Operating Systems HP-UX Serial standard communication (stty) Post 302943474 by Monttanna on Friday 8th of May 2015 07:06:21 PM
Old 05-08-2015
CPU & Memory Terminal and script

I'm trying to do both, first gain communicate via terminal and then make a script in BT-Basic that can reliably do this automatically for a project.

Code:
sub IniRS232(Port$,Baudrate)
    global  @RS232
    dim STTY1$[512]
    STTY1$ = "stty "& val$(Baudrate) & " -parenb -parodd cs8 -cstopb -hupcl "
    STTY1$ = STTY1$ & "cread clocal -loblk -crts -ignbrk "
    STTY1$ = STTY1$ & "-brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr "
    STTY1$ = STTY1$ & "-icrnl -iuclc -ixon -ixany -ixoff -rtsxoff -ctsxon "
    STTY1$ = STTY1$ & "-ienqak -isig -icanon iexten -xcase -echo -echoe -echok "
    STTY1$ = STTY1$ & "-echonl -noflsh -opost -olcuc -onlcr -ocrnl -onocr "
    STTY1$ = STTY1$ & "-onlret -ofill -ofdel -tostop < "
    RS232_Dev$ ="/dev/" & Port$
    assign @RS232 to RS232_Dev$; read, write
    timeout @RS232, 0.8
    execute STTY1$ & RS232_Dev$; append
subend

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Serial port communication

We're running SCO Unix Openserver 5.05 and I'm having trouble with serial communication between the com2 serial port and a handheld device. Downloading data from Unix to the handheld works perfectly, but the other way around creates a major problem. I don't know whether it's a buffer overflow or... (1 Reply)
Discussion started by: Aretha
1 Replies

2. UNIX for Advanced & Expert Users

Serial Communication in UNIX

Hi, I am working on serial communication on Unix. Can anyone guide me through it. The steps required for RS 232 communication and can i do serial communication even if i dont have super user previledges. Thankx, Vicky (1 Reply)
Discussion started by: Vicky
1 Replies

3. UNIX for Dummies Questions & Answers

serial communication

This isn't really a unix question, or even a programming question, but I hope you guys can help. I want to create a program to control the electricity on a model railway. I have created the program to that it sends characters over the serial cable, but now I need to do the switch that will... (1 Reply)
Discussion started by: KrazyGuyPaul
1 Replies

4. IP Networking

ip communication through serial connection

I have serial modem connection between two computers. We have to login the remote computer through ip address. How can I get the ip address in this connection? (1 Reply)
Discussion started by: pcsaji
1 Replies

5. Programming

problem while having a communication with serial port?????

hello, I am gettin problem while sending and recieving data through seial port... when I am sending Data then the reciever end is not able to recieve that data ..... Reciever end is running in infinite loop just polling after some time to check that there is data on the port and then again... (9 Replies)
Discussion started by: arunchaudhary19
9 Replies

6. OS X (Apple)

Serial Communication from shell Mac OS X PHP script

Hi again, I spoke with Keyspan and they assured me the USB to Serial device was working if I could use the Screen tool. I asked why I was unable to redirect stdin/stdout to and from the /dev/tty. device and was told there was no reason I shouldn't be able to do so. I have tried: ... (1 Reply)
Discussion started by: cpfogarty
1 Replies

7. Shell Programming and Scripting

standard error to standard out question

Hi there how can i get the result of a command to not give me its error. For example, on certain systems the 'zfs' command below is not available, but this is fine becaues I am testing against $? so i dont want to see the message " command not found" Ive tried outputting to /dev/null 2>&1 to no... (5 Replies)
Discussion started by: hcclnoodles
5 Replies

8. Ubuntu

Ubuntu 9.04 Serial application to telnet to serial device

Hello! I am working on an application which reads environmental instruments which have serial ports. The application requires a serial port to be present to talk to the device (i.e. /dev/ttyS0 ). In some instances the environmental devices will be 100's of yards away from the computer, so a... (5 Replies)
Discussion started by: mvona
5 Replies

9. Programming

Serial communication failing

edit: never mind; mods please delete. I finally got so frustrated I figured it couldn't be the code and it must be the device on the other end. After pulling it out of its cradle, I realized it was a different model number than the one I was using before, and wasn't accepting my... (1 Reply)
Discussion started by: DreamWarrior
1 Replies

10. UNIX for Dummies Questions & Answers

Redirect Standard output and standard error into spreadsheet

Hey, I'm completely new at this and I was wondering if there is a way that I would be able to redirect the log files in a directories standard output and standard error into and excel spreadsheet in anyway? Please remember don't use too advanced of terminology as I just started using shell... (6 Replies)
Discussion started by: killaram
6 Replies
STTY(1) 							   User Commands							   STTY(1)

NAME
stty - change and print terminal line settings SYNOPSIS
stty [-F DEVICE | --file=DEVICE] [SETTING]... stty [-F DEVICE | --file=DEVICE] [-a|--all] stty [-F DEVICE | --file=DEVICE] [-g|--save] DESCRIPTION
Print or change terminal characteristics. -a, --all print all current settings in human-readable form -g, --save print all current settings in a stty-readable form -F, --file=DEVICE open and use the specified DEVICE instead of stdin --help display this help and exit --version output version information and exit Optional - before SETTING indicates negation. An * marks non-POSIX settings. The underlying system defines which settings are available. Special characters: * dsusp CHAR CHAR will send a terminal stop signal once input flushed eof CHAR CHAR will send an end of file (terminate the input) eol CHAR CHAR will end the line * eol2 CHAR alternate CHAR for ending the line erase CHAR CHAR will erase the last character typed intr CHAR CHAR will send an interrupt signal kill CHAR CHAR will erase the current line * lnext CHAR CHAR will enter the next character quoted quit CHAR CHAR will send a quit signal * rprnt CHAR CHAR will redraw the current line start CHAR CHAR will restart the output after stopping it stop CHAR CHAR will stop the output susp CHAR CHAR will send a terminal stop signal * swtch CHAR CHAR will switch to a different shell layer * werase CHAR CHAR will erase the last word typed Special settings: N set the input and output speeds to N bauds * cols N tell the kernel that the terminal has N columns * columns N same as cols N ispeed N set the input speed to N * line N use line discipline N min N with -icanon, set N characters minimum for a completed read ospeed N set the output speed to N * rows N tell the kernel that the terminal has N rows * size print the number of rows and columns according to the kernel speed print the terminal speed time N with -icanon, set read timeout of N tenths of a second Control settings: [-]clocal disable modem control signals [-]cread allow input to be received * [-]crtscts enable RTS/CTS handshaking csN set character size to N bits, N in [5..8] [-]cstopb use two stop bits per character (one with `-') [-]hup send a hangup signal when the last process closes the tty [-]hupcl same as [-]hup [-]parenb generate parity bit in output and expect parity bit in input [-]parodd set odd parity (even with `-') Input settings: [-]brkint breaks cause an interrupt signal [-]icrnl translate carriage return to newline [-]ignbrk ignore break characters [-]igncr ignore carriage return [-]ignpar ignore characters with parity errors * [-]imaxbel beep and do not flush a full input buffer on a character [-]inlcr translate newline to carriage return [-]inpck enable input parity checking [-]istrip clear high (8th) bit of input characters * [-]iutf8 assume input characters are UTF-8 encoded * [-]iuclc translate uppercase characters to lowercase * [-]ixany let any character restart output, not only start character [-]ixoff enable sending of start/stop characters [-]ixon enable XON/XOFF flow control [-]parmrk mark parity errors (with a 255-0-character sequence) [-]tandem same as [-]ixoff Output settings: * bsN backspace delay style, N in [0..1] * crN carriage return delay style, N in [0..3] * ffN form feed delay style, N in [0..1] * nlN newline delay style, N in [0..1] * [-]ocrnl translate carriage return to newline * [-]ofdel use delete characters for fill instead of null characters * [-]ofill use fill (padding) characters instead of timing for delays * [-]olcuc translate lowercase characters to uppercase * [-]onlcr translate newline to carriage return-newline * [-]onlret newline performs a carriage return * [-]onocr do not print carriage returns in the first column [-]opost postprocess output * tabN horizontal tab delay style, N in [0..3] * tabs same as tab0 * -tabs same as tab3 * vtN vertical tab delay style, N in [0..1] Local settings: [-]crterase echo erase characters as backspace-space-backspace * crtkill kill all line by obeying the echoprt and echoe settings * -crtkill kill all line by obeying the echoctl and echok settings * [-]ctlecho echo control characters in hat notation (`^c') [-]echo echo input characters * [-]echoctl same as [-]ctlecho [-]echoe same as [-]crterase [-]echok echo a newline after a kill character * [-]echoke same as [-]crtkill [-]echonl echo newline even if not echoing other characters * [-]echoprt echo erased characters backward, between `' and '/' [-]icanon enable erase, kill, werase, and rprnt special characters [-]iexten enable non-POSIX special characters [-]isig enable interrupt, quit, and suspend special characters [-]noflsh disable flushing after interrupt and quit special characters * [-]prterase same as [-]echoprt * [-]tostop stop background jobs that try to write to the terminal * [-]xcase with icanon, escape with `' for uppercase characters Combination settings: * [-]LCASE same as [-]lcase cbreak same as -icanon -cbreak same as icanon cooked same as brkint ignpar istrip icrnl ixon opost isig icanon, eof and eol characters to their default values -cooked same as raw crt same as echoe echoctl echoke dec same as echoe echoctl echoke -ixany intr ^c erase 0177 kill ^u * [-]decctlq same as [-]ixany ek erase and kill characters to their default values evenp same as parenb -parodd cs7 -evenp same as -parenb cs8 * [-]lcase same as xcase iuclc olcuc litout same as -parenb -istrip -opost cs8 -litout same as parenb istrip opost cs7 nl same as -icrnl -onlcr -nl same as icrnl -inlcr -igncr onlcr -ocrnl -onlret oddp same as parenb parodd cs7 -oddp same as -parenb cs8 [-]parity same as [-]evenp pass8 same as -parenb -istrip cs8 -pass8 same as parenb istrip cs7 raw same as -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -opost -isig -icanon -xcase min 1 time 0 -raw same as cooked sane same as cread -ignbrk brkint -inlcr -igncr icrnl -iutf8 -ixoff -iuclc -ixany imaxbel opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke, all spe- cial characters to their default values Handle the tty line connected to standard input. Without arguments, prints baud rate, line discipline, and deviations from stty sane. In settings, CHAR is taken literally, or coded as in ^c, 0x37, 0177 or 127; special values ^- or undef used to disable special characters. AUTHOR
Written by David MacKenzie. REPORTING BUGS
Report stty bugs to bug-coreutils@gnu.org GNU coreutils home page: <http://www.gnu.org/software/coreutils/> General help using GNU software: <http://www.gnu.org/gethelp/> Report stty translation bugs to <http://translationproject.org/team/> COPYRIGHT
Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
The full documentation for stty is maintained as a Texinfo manual. If the info and stty programs are properly installed at your site, the command info coreutils 'stty invocation' should give you access to the complete manual. GNU coreutils 8.12.197-032bb September 2011 STTY(1)
All times are GMT -4. The time now is 04:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy