Đang chuẩn bị liên kết để tải về tài liệu:
Parallel Port Complete- P9
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Parallel Port Complete- P9: From its origin as a simple printer interface, the personal computer's parallel port has evolved into a place to plug in just about anything you might want to hook to a computer. The parallel port is popular because it's versatile-you can use it for output, input, or bidirectional links-and because it's available-every PC has one. | Chapter 7 Const OPENSWITCH 0 Const CLOSESWITCH 1 Sub ActivateSwitch OpenOrClose Dim Strobe Dim XY Data port bit 7 OpenOrClose 0 open l close OpenOrClose OpenOrClose H80 Data port bit 6 Strobe. Strobe H40 Data port bits 0-2 hold the X value bits 3-5 hold the Y value. XY grdXY.Col - 1 grdXY.Row - 1 8 Write the address select open or close Strobe 1 DataPortWrite BaseAddress XY Strobe OpenOrClose Pulse the Strobe input. DataPortWrite BaseAddress XY OpenOrClose DataPortWrite BaseAddress XY Strobe OpenOrClose End Sub Sub DisplayResults Select Case Switchstate Case Closed grdXY.Text X Case Open grdXY.Text End Select End Sub Sub Form_Load Startup LabelTheGrid End Sub Sub grdXY_Click Select Case grdXY.Text Case X ActivateSwitch OPENSWITCH Switchstate Open DisplayResults Case Else ActivateSwitch CLOSESWITCH Switchstate - Closed DisplayResults End Select End Sub Listing 7-2 Controlling an 8 x 8 crosspoint switch Sheet 1 of 2 146 Parallel Port Complete Please purchase PDF Split-Merge on www.verypdf.com to remove this watermark. Output Applications Sub LabelTheGrid Dim Row Dim Column grdXY.Col 0 For Row 1 To 8 grdXY . Row Row grdXY.Text Y Row - 1 Next Row grdXY.Row 0 For Column 1 To 8 grdXY.Col Column grdXY.Text X Column - 1 Next Column IblXY.Caption 8x8 Crosspoint Switch End Sub Listing 7-2 Controlling an 8 x 8 crosspoint switch Sheet 2 of 2 display the switch matrix. When you click on a cell the associated switch opens or closes. An X indicates a closed switch an empty cell indicates an open switch. You can make and break as many connections as you want by writing appropriate values to the chip. All previous switch settings remain until you change them by writing to the specific switch. The switches can connect in any combination. For example you can connect each X pin to a different Y pin to create eight distinct signal paths. Or you can connect all eight Y pins to a single X pin to route one signal to eight different paths. The X and Y pins may connect to external inputs or