Moxa Technologies C168P user manual Serial Programming Tools, Solution

Page 55
There are 2 solutions to control RS-485 2-wire transmission.

Serial Programming Tools

There are 2 solutions to control RS-485 2-wire transmission.

Solution 1

The following model is common in RS-485 2-wire transmission.

sio_SetWriteTimeouts(port, 0); /* Set sio_write() into block mode if

 

for Windows NT and Windows 95/98 */

sio_RTS(port, 1);

/* Turn on RTS signal. The RS-485

 

port is ready for transmitting data. */

sio_write(port, buff, 10);

/* Write 10 byte characters in "buff".

 

The function blocks until last

 

character transmitted */

sio_RTS(port, 0);

/* Turn off RTS signal. The RS-485

 

port is ready for receiving data. */

sio_read(port, buff, 10);

/* Read 10 bytes */

Solution 2

function in PComm or API-232 library. It

There is a dedicated RS-485

integrates the above functions of solution 1 regarding sending data as one.

sio_putb_x(port, buff, tick ); /*

1.

Turn on RTS and ready for

 

 

transmitting data.

 

2.

Send data.

 

3.

Wait for tick time.

 

4.

Turn off RTS and ready for

 

 

receiving data. */

For more information on these functions, please refer to PComm library on-line Help file for Windows NT and Windows 95/98 or API-232.txt file for DOS, respectively

C168P User’s Manual 4-9

Image 55
Contents support@moxa.com.tw C168P User’s ManualMay 1999 7th Edition Universal 8 Port Serial BoardC168P User’s Manual Copyright NoticeTrademarks DisclaimerMOXA Internet Services Chapter 5 Connection Option Opt8x and Cable Wiring About This ManualChapter 2 Hardware Installation Chapter 3 Software InstallationTable of Contents Hardware InstallationSoftware Installation Serial Programming ToolsTroubleshooting Connection Option Opt8x and Cable WiringTechnical Reference Introduction The Standard Multiport Async SolutionsOverview Jumper SwitchQuick Installation Hardware Configuration MethodWide Applications IntroductionOperating System Support MOXA Serial Comm ToolsFeatures Opt8A/Opt8B/Opt8S Check ListOpt8F/Opt8Z Opt8C/Opt8DP1P2 P3 P4 P5 P6 P7 P8Opt8J Opt8JRS-422/485 Port Switch of Opt8J RS-422 ModeRS-485 Mode Installation GuideDefault Settings Hardware InstallationC168P How to Do Quick Hardware Installation Quick Hardware InstallationHardware Installation with IO-IRQ Utility 2-4 C168P User’s Manual IO-IRQ Utility and Hardware Configuration2. Select “Smartio/Industio ISA Family” and press ENTER key Speed 5. Press F10 to save the configuration and exit the utility 2-8 C168P User’s Manual Windows NT Software InstallationInstalling Driver 5. Select “MOXA Smartio/Industio Family multiport board” in the “Select OEM Option” dialog box, and then click OK to enter the “Moxa Smartio/Industio Configuration Panel” dialog box to start the installation 3-4 C168P User’s Manual Rx FIFO Trigger Port NumberTx FIFO Size 3-6 C168P User’s Manual Configuring Board and Port In this configuration panel, you may Updating Driver Windows 95/98Removing Driver 1. Run Setup95.exe in the driver diskette Note ! Go directly to the step 7 if you need not change any setting 3-12 C168P User’s Manual If error message like “Smartio C168 Series CAP=0x0180, port 1=COM3 3-14 C168P User’s Manual Updating Driver 3-16 C168P User’s Manual Software Installation 3-18 C168P User’s Manual Driver SetupC168P User’s Manual 3-20 C168P User’s Manual You may now enter/modify each port’s configuration. These displayed values are the port initial values as driver is loaded Loading Driver Unloading Driver 3-24 C168P User’s Manual Serial Programming Tools InstallationWindows NT and Windows 95/98 Utilities PComm Programming Library4-2 C168P User’s Manual Diagnostic for MOXA boards only 4-4 C168P User’s Manual Monitor for MOXA boards under Windows NT OnlyTerminal Emulator Data Scope DOS API-232 Library4-6 C168P User’s Manual There are three major functions in Data Scope utility Diagnose RS-485 Programming for Opt8JSolution There are 2 solutions to control RS-485 2-wire transmission4-10 C168P User’s Manual Connection Option Opt8x and Cable Wiring RS-232 Cable Wiring for Opt8A/B/C/D/SOpt8B/C DTE, DB25 Male The followings are pin assignments for various connection optionsOpt8A/S DCE, DB25 Female 2 RxD 3 TxD 4 CTS 5 RTS 6 DTR 7 GND 8 DCD 20 DSRStraight-through Cable Opt8A/S Type 1 To connect C168P to a DTE deviceNull Modem Cable Opt8B/C 5-4 C168P User’s Manual Type 2 To connect C168P to a DCE deviceConnection Option Opt8x and Cable Wiring Opt8A/S 5-6 C168P User’s ManualDTE Device RS-422 Cable Wiring for Opt8J/F/Z RTS-A RS-422 Pinouts for Opt8J/F/ZOpt8J/F/Z 2 RxD+B 3 TxD+B 14 RxD-A 16 TxD-A 7 GND 4 CTS+B 5 RTS+BRS-422 Device N RS-422 Point-to-pointOpt8J/F/Z RS-422 DeviceOpt8J RS-485 Cable Wiring for Opt8JRS-422/485 Impedance Matching 5-12 C168P User’s Manual Hardware Causes and Solutions TroubleshootingGeneral Troubleshooting Hardware causes and solutionsSoftware Causes and Solutions A Io-irq Step Step Step Step Step StepStep 8. Power off the PC 4. Windows NT system panic blue screen 3. The COM number of the C168P conflicts with others6-6 C168P User’s Manual Technical Reference SpecificationsAppendix A-2 C168P User’s Manual IO/ Address PC I/O Port Address MapDevice Pin no DB62 Connector PinoutsSignal A-4 C168P User’s Manual1. Moxa Product C168P Serial Number 2. Moxa Driver Version Problem Report Form C168P3. Moxa hardware settings Customer name Company Tel Fax EmailDateReturn Procedure