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

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

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.