Moxa Technologies C360 manual Write a string of data to Tx buffer, Non-TTY port parameter setting

Page 37

For UNIX Users

Chapter 4

 

 

int

sio_read(int port, char *buf, int len)

return

=

>0

length of data received

 

 

0

no data received

 

 

-1

bad port

 

 

-2

time out

 

 

-5

port is not open

port

=

port number

buf

=

receive buffer pointer with required space

len

=

buffer length

4.Write a string of data to Tx buffer.

int

sio_write(int port, char *buf, int len)

return

=

>0

length of data transmitted to Tx buffer

 

 

=0

buffer full

 

 

-1

bad port

 

 

-2

time out

 

 

-5

port is not open

port

=

port number

buf

=

transmit string pointer

len

=

transmit string length

5.Put a block of data to Tx buffer. If the Tx buffer free space is smaller than block length, it will return zero.

int

sio_putb(int port, char *buf, int len)

return

=

>0

length of data transmitted to Tx buffer

 

 

0

free buffer not enough

 

 

-1

bad port

 

 

-2

time out

 

 

-5

port is not open

 

 

-6

len > Tx buffer size

port

=

port number

buf

=

transmit string pointer

len

=

transmit string length

6.Non-TTY port parameter setting.

31

Image 37
Contents C360 Copyright Notice Moxa Internet Services Table of Contents Appendix a Troubleshooting Page Overview IntroductionFeatures Features and SpecificationsSpecifications SystemAsync Concentrator Control BoardC360 Control Board Check listRack Mount Kit Installation of C360 Hapter 2 Hardware InstallationHardware Installation ∙ ∙ Chapter Rack Mount Kit HubDiagnostics LED IndicatorsSerial Number of the Async Concentrator ~10~ Hardware Installation ∙ ∙ Chapter Driver Installation Software Driver Installation and SetupControl Board Configuration Driver Loading Driver Setup~14~ Moxa Serial Port Naming Convention Driver RemovalDOS API-232 Library and Programming Languages AdministrationsAsync Concentrator Status Monitoring Data Scope Async Concentrator DiagnosticsFor Unix Users Driver InstallationFor Unix Users ∙ ∙ Chapter Moxa TTY Ports Moxa TTY and Non-TTY PortsConvention of the Moxa TTY device name is Moxa Non-TTY Ports Tty + a + B + CConfiguration TTY or Non-TTY Async Concentrator Serial NumberDriver Reset DiagnosticsMonitoring Concentrator RestartTerminal Emulation Programming the Moxa TTY Ports Using Standard Unix APIFunction Description Extended Function List for Moxa TTY PortsMobufed Mhwflow Function List Programming the Moxa Non-TTY Ports Using Moxa Unix API-232Open a non-TTY port Function DescriptionClose a non-TTY port Read data from a non-TTY portWrite a string of data to Tx buffer Non-TTY port parameter settingFlush Tx/Rx buffer data Send break signalRead the length of data queued in Tx buffer Read the length of data queued in Rx bufferGet modem line status Set modem line control signal RTS Set modem line control signal DTRSetting CTS/RTS and XON/XOFF flow control Enable transmitting data Disable transmitting dataAppendix a Software Cause and Solution Hardware causes and solutionsSoftware Causes and Solutions RTS DSR CTS DTR SolutionUnder UNIX, the newly rebuilt kernel could not boot Hardware Cause and SolutionEthernet Cabling Appendix BAsync Concentrator and Serial Number RS-232 Cable Wiring RJ-45 Female ConnectorDTE GND RTS CTS DSR Appendix C Appendix C ∙ Customer name Company Date Tel Fax Problem Report FormWarranty