UNIX

Programming the MOXA Ports

The system calls that apply to standard tty port can also be applied to MOXA port since MOXA port conforms to UNIX tty standard. System calls are like open(), ioctl(), read(), write(), close(), etc. Please refer to your UNIX Programmer's Reference manual.

However, these system services only provide limited functions and thus may not satisfy the sophisticated programmers' need. In order to meet the user's special purpose, MOXA supports extended services through ioctl() command, which are:

1.

MIBUFED

(= 0x401)

To get byte count in input buffer.

2.

MOBUFED

(= 0x402)

To get byte count in output buffer.

3.

MTCRTS

(= 0x403)

To control RTS output signal.

4.

MTCDTR

(= 0x404)

To control DTR output signal.

5.MLOWATER (= 0x405) To set output buffer low water level.

6.

MSTATUS

(= 0x407)

To read modem line status (CTS/DSR/DCD).

7.

MHWFLOW

(= 0x40e)

To enable/disable the hardware flow control.

The next section details all the commands.

Extended UNIX Ioctl() Commands

The following lists the syntax of MOXA extended functions for both non-SVR4.x and SVR4.x UNIX. The variable moxa_fd is the returned file descriptor by open() a specific MOXA port. For example,

int moxa_fd;

moxa_fd = open("/dev/ttya11",O_RDWR);

1. MIBUFED

This function let you know how many bytes queued in input buffer when this function is issued.

4-6Intellio C218Turbo /PCI User's Manual

Page 60
Image 60
Moxa Technologies C218 user manual Programming the Moxa Ports, Extended Unix Ioctl Commands

C218 specifications

Moxa Technologies, a leader in the field of industrial networking and communication solutions, has made significant strides in enhancing operational technology with its C218 series of industrial Ethernet switches. The Moxa C218 is designed to meet the demanding requirements of industrial automation, ensuring robust performance and reliability in critical applications.

One of the standout features of the C218 series is its advanced networking capabilities. The switch supports Layer 2 switching functionality, which allows for efficient traffic management and improved network performance. With support for up to 8 Ethernet ports, the C218 can seamlessly connect multiple devices, ensuring that communication flows smoothly across the network.

The C218 is designed with resilience in mind, equipped with features such as redundancy support. It includes Rapid Spanning Tree Protocol (RSTP) and Media Redundancy Protocol (MRP), which minimize downtime and ensure continuous network operation even in the event of failures. These features make the C218 an ideal choice for mission-critical applications where reliability is paramount.

Another significant aspect of the C218 is its ability to withstand challenging environmental conditions. With an extended operating temperature range, the switch can handle extreme temperatures typical in industrial settings. Its ruggedized design protects against dust, moisture, and vibrations, ensuring that it performs consistently in harsh environments.

Security is a crucial consideration in modern industrial networks, and the C218 addresses this with built-in security features. The switch supports various authentication mechanisms and allows for VLAN configurations, helping to segment network traffic and protect sensitive data.

Moxa's C218 also provides convenience through its user-friendly management interface. It supports SNMP, allowing for simple network monitoring and management. Additionally, the switch's web-based management and command-line interface (CLI) make it easy for network administrators to configure and monitor the device efficiently.

In summary, the Moxa Technologies C218 switch is a reliable, feature-rich solution tailored for the industrial sector. With its excellent networking capabilities, robust design, environmental resilience, security features, and user-friendly management tools, the C218 is well-equipped to meet the demands of today's industrial automation challenges, helping businesses optimize their operations while ensuring network integrity.