B&B Electronics 232D4SS8 manual Programming the User Defined Character

Page 17

The turn off string also adds the ASCII ESC character to the front of the three-character turn off string.

The first character is the ASCII ESC character. The second and third character of the command control string is the user-defined character. The fourth character is the ASCII EOT character (decimal 4).

Example 2: To turn off all ports and the user defined character is ASCII STX (decimal 2).

Send to Master Port: ESC STX STX EOT

(27 2 2 4 decimal)

It is recommended that the user-defined character be a non- printable character. The turn off command will then consist of four characters that will not show up on the current port device.

If you were writing a program in GWBASIC to select port E of the 232D4SS8 (address zero) you would form a string like this:

SW0E$ = CHR$(27) + CHR$(2) + "0" + "E"

You could then send SW0E$ to select port E. Similar strings could be used for turning on the other ports. To turn off the ports the string might look like this:

TOFF$ = CHR$(27) + CHR$(2) + CHR$(2) + CHR$(4)

NOTE: There is no delay through the Smart Switch and the data is not buffered.

Programming the User Defined Character

The user-defined character comes programmed as the ASCII STX character (decimal 2). You can change this to any 8-bit character you wish by reprogramming DIP switch 2 (SW2). SW2 is located on the printed circuit board inside the 232D4SS8. Refer to Figure 2. SW2 is an eight-position switch with each position equal to a certain weight. Refer to Table 4. It is recommended that a non- printable character be defined.

Documentation Number 232D4SS84502 Manual

15

B&B Electronics Mfg Co – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104 B&B Electronics Ltd – Westlink Comm. Pk – Oranmore, Galway, Ireland – Ph +353 91-792444 – Fax +353 91-792445

Image 17
Contents Port Smart Switch CE Table of Contents Introduction HardwareRear View Switching Baud Rate From 300 to 38.4 KbpsFront View Serial Data Configuration Simplified Functional Diagram ChecklistMaster Port Communication & Configuration Switch DIP Switch SettingPort Configuration Printed Circuit Board Outline Master Port DCE/DTE Jumpers Description Port DCE Master Port Chart Signal Direction Pin #DTE Master Port Chart Signal Direction Pin # Description RS-232 Configuration Data Set Ready Input Signal Ground Carrier DetectRequest to Send Output Clear to Send InputRS-422/485 Ports a H Signal Pin # Description Direction Simplified RS-232 Schematic RS-422/485 Slave Port OptionRS-422/RS-485 Mode Simplified RS-422/485 Schematic1200 6002400 4800Three Character Command String Smart Switch OperationSmart Switch Mode Four Character Command String Programming the User Defined Character Smart Switch/Port Combiner Mode SW2 Weight Chart DIP SwitchPort Select Test Binary File TransferMethod One Software232D4SS8 Users Default Values Smart Switch SetupDescription Default Value Method TwoSelecting Ports Uninstalling Windows Smart Switch Selector ProgramDecimal to HEX to Ascii Conversion Table Appendix a Ascii Character CodesAppendix B Cable Charts Chart 4. DCE Device w/DB25 Connector to Ports a H DTE Chart 3. Modem DB25 Connector to Master PortAsync Modem 232D4SS8 Master Port DTEChart 6. IBM PC DB9 Connector to Ports a H DTE Chart 5. IBM PC DB25 Connector to Ports a H DTEChart 8. IBM PC DB9 Connector to Ports a H DTE Chart 7. IBM PC DB25 Connector to Ports a H DTEPorts a H Declaration of Conformity Appendix C Declaration of Conformity