Moxa Technologies C168HS user manual Mhwflow

Models: C168HS

1 102
Download 102 pages 35.46 Kb
Page 69
Image 69

Serial Programming Tools

Syntax for SCO UNIX/OpenServer

 

#define MSTATUS

0x407

 

int

status;

/* status = RS-232 line status

*/

 

 

/* bit0¡ÐCTS (1:on, 0:off)

*/

 

 

/* bit1¡ÐDSR (1:on, 0:off)

*/

 

 

/* bit2¡ÐDCD (1:on, 0:off)

*/

ioctl(moxa_fd, MSTATUS, &status);

 

Syntax for UNIX SVR4.2

 

#define MSTATUS

0x407

 

#include

 

<sys/stropts.h>

 

#include

 

<sys/sysmacros.h>

 

struct strioctl

ioc;

 

int

 

status; /* status = RS-232 line status */

/* bit0¡ÐCTS (1:on, 0:off)

*/

/* bit1¡ÐDSR (1:on, 0:off)

*/

/* bit2¡ÐDCD (1:on, 0:off)

*/

ioc.ic_cmd = MSTATUS; ioc.ic_timout = 0; ioc.ic_len = sizeof(int); ioc.ic_dp = (char *)&status; ioctl(moxa_fd, I_STR, &ioc);

7. MHWFLOW

This function is used to enable/disable hardware flow control. The first open() function of a port will set the hardware flow control bits on or off depending on the [RTS/CTS Hardware Flow Control] configuration in mxadm. However, users might want to control the DTR or RTS signal on their will, thus the RTS flow control bit should be turned off (HWFLowControlOff) in order to take over the control of DTR or RTS signal via function MTCRTS or MTCDTR. MTCRTS and MTCDTR can be effective only after the RTS flow control bit of MHWFLOW is turned off.

Smartio C168H/HS User’s Manual 4-11

Page 69
Image 69
Moxa Technologies C168HS user manual Mhwflow