Difference between revisions of "Scale Communication"

From HiveTool
Jump to: navigation, search
(Configuring the computer's serial port)
(Configuring the computer's serial port)
Line 29: Line 29:
 
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
 
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
 
</pre>
 
</pre>
 +
 +
 +
stty can also  be used to set the serial port parameters:
  
 
<pre>
 
<pre>
 
stty -F/dev/ttyS0  -hupcl ignbrk  -icrnl -ixon -opost  -onlcr -isig -icanon -
 
stty -F/dev/ttyS0  -hupcl ignbrk  -icrnl -ixon -opost  -onlcr -isig -icanon -
 
iexten -echo -echoe -echok  -echoctl -echoke igncr
 
iexten -echo -echoe -echok  -echoctl -echoke igncr
<pre>
+
</pre>

Revision as of 18:36, 22 December 2013

Cable

RS-232 Serial Communication Ports

Depending on whether the scale is wired for DTE or DCE, it may require a null modem cable or replacing and rewiring the serial connector.

Configuration

Set up the scale. 9600 baud, 8 bit, no parity


Testing communication

Terminal Emulation program like Minicom

Configuring the computer's serial port

To list the line parameters for ttyS0: stty -F /dev/ttyS0 -a

Example:

# stty -F /dev/ttyS0 -a    
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V;
flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
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


stty can also be used to set the serial port parameters:

stty -F/dev/ttyS0  -hupcl ignbrk  -icrnl -ixon -opost  -onlcr -isig -icanon -
iexten -echo -echoe -echok  -echoctl -echoke igncr