Moxa Technologies C360 Programming the Moxa Non-TTY Ports Using Moxa Unix API-232, Function List

Page 35

For UNIX Users

Chapter 4

 

 

4.5Programming the MOXA Non-TTY Ports Using MOXA UNIX API-232

Even though C360 SuperPort system provides up to 1024 serial ports, maximum of 256 ports can serve as standard UNIX TTY devices while the rest of the ports, up to 768, can only be used as MOXA non-TTY devices.

To control MOXA non-TTY ports, MOXA proprietary functions in the MOXA UNIX API-232 library should be used, which are listed below. Note that UNIX system services, such as open( ), close( ), read( ), write( ), and ioctl( ), can not be applied to MOXA non-TTY ports.

The MOXA UNIX API-232 functions are almost the same as those in MOXA DOS API-232 library. Hence it is easier for porting applications from DOS platform to UNIX one. One thing to notice is that all the MOXA non-TTY ports can only be accessed in one UNIX application (process). In other word, two or more applications accessing any MOXA non-TTY ports are not allowed.

Remember to include the header file, mxapi232.h, in the application program and link with the library, mxapi232.o. User can use the example program (example.c), header file (mxapi232.h), library (mxapi232.o) and makefile in the directory, /usr/lib/moxa to shorten the learning curve.

Function List:

1.

sio_open( )

Open a non-TTY port.

2.

sio_close( )

Close a non-TTY port.

3.

sio_read( )

Read data from a non-TTY port.

4.

sio_write( )

Write a string of data to Rx buffer.

5.

sio_putb( )

Put a block of data to Tx buffer.

6.

sio_ioctl( )

Non-TTY port parameter setting.

7.

sio_break( )

Send break signal.

8.

sio_flush( )

Flush Tx/Rx buffer data.

9.

sio_iqueue( )

Read the length of data queued in Rx buffer.

10.

sio_oqueue( )

Read the length of data queued in Tx buffer.

11.

sio_lstatus( )

Get modem line status.

12.

sio_lctrl( )

Set modem line control.

13.

sio_DTR( )

Set modem line control signal DTR.

 

 

29

Image 35
Contents C360 Copyright Notice Moxa Internet Services Table of Contents Appendix a Troubleshooting Page Overview IntroductionSystem Features and SpecificationsFeatures SpecificationsAsync Concentrator Control BoardC360 Control Board Check listRack Mount Kit Installation of C360 Hapter 2 Hardware InstallationHardware Installation ∙ ∙ Chapter Rack Mount Kit HubSerial Number of the Async Concentrator LED IndicatorsDiagnostics ~10~ Hardware Installation ∙ ∙ Chapter Control Board Configuration Software Driver Installation and SetupDriver Installation Driver Loading Driver Setup~14~ Moxa Serial Port Naming Convention Driver RemovalAsync Concentrator Status Monitoring AdministrationsDOS API-232 Library and Programming Languages Data Scope Async Concentrator DiagnosticsFor Unix Users Driver InstallationFor Unix Users ∙ ∙ Chapter Convention of the Moxa TTY device name is Moxa TTY and Non-TTY PortsMoxa TTY Ports Moxa Non-TTY Ports Tty + a + B + CConfiguration TTY or Non-TTY Async Concentrator Serial NumberConcentrator Restart DiagnosticsDriver Reset MonitoringTerminal 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-232Read data from a non-TTY port Function DescriptionOpen a non-TTY port Close a non-TTY portWrite a string of data to Tx buffer Non-TTY port parameter settingFlush Tx/Rx buffer data Send break signalGet modem line status Read the length of data queued in Rx bufferRead the length of data queued in Tx buffer Setting CTS/RTS and XON/XOFF flow control Set modem line control signal DTRSet modem line control signal RTS 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

C360 specifications

Moxa Technologies C360 is a cutting-edge solution designed to meet the demands of modern industrial networking. This device is pivotal for various sectors including manufacturing, transportation, and smart grid applications, where reliable communication is critical.

One of the main features of the C360 is its ability to provide robust connectivity options. It comes equipped with multiple Ethernet ports, allowing for seamless integration into existing networks. The device supports advanced networking protocols such as EtherNet/IP, Modbus TCP, and MQTT, which facilitates easy communication between devices, enhancing interoperability and data exchange capabilities.

Another standout characteristic of the C360 is its high-level security features. With the increasing number of cyber threats targeting industrial networks, Moxa Technologies emphasizes the importance of safeguarding connected systems. The C360 includes built-in firewall capabilities, access control lists, and support for virtual private networks (VPN), ensuring that critical data remains secure during transmission.

The C360 is also designed for reliability in harsh environments. Its rugged construction guarantees durability and resilience against extreme temperatures, vibrations, and electromagnetic interference. This makes it perfectly suited for outdoor deployments or in situations where conditions may compromise less robust devices.

Moreover, the C360 boasts a user-friendly interface with intuitive management tools. Network administrators can monitor performance, configure settings, and troubleshoot issues easily via a web-based interface or command-line options. This level of accessibility improves operational efficiency and allows for rapid response to network needs.

Compatibility with Moxa's MXview network management software adds another layer of convenience. This software provides centralized network monitoring, enabling proactive management of network devices, which is essential for maintaining uptime in critical applications.

In conclusion, Moxa Technologies C360 is a versatile and reliable solution that addresses the complexities of modern industrial communication. With its advanced networking protocols, robust security measures, rugged design, and user-friendly management tools, it stands out as an essential component for organizations looking to enhance their operational efficiency and secure their networks. The C360 is engineered to provide lasting performance, making it a valuable investment for businesses aiming for growth and innovation in an increasingly connected world.