Appendix, Appendix. host mode command and serial data format, Host mode command – Banner A-GAGE MINI-ARRAY Series User Manual

Page 39: Serial data format

Advertising
background image

P/N 43298 rev. E

39

Banner Engineering Corp.

Minneapolis, MN U.S.A.

www.bannerengineering.com • Tel: 763.544.3164

MINI-ARRAY

®

Instruction Manual

Appendix

Host Mode Command

The MINI-ARRAY controller can communicate with a computer or PLC via either an

RS-232 connection (all models) or RS-485 connection (discrete-output models). See

hookup information in Section 3.4. The host can respond to output from the controller

when the controller is programmed for either the Continuous or Gate control mode

(see Section 5.5.6).
Alternately, the host can control sensor scanning. When the Host control mode is

selected, the host computer or controller initiates scans using a command string. The

command string is a three-byte message, consisting of:
Control byte with decimal value 248
Controller ID (one of 16 ASCII letters A through O, as specified in the PSF)
Scan initiation byte (ASCII letter S)
The command string is further defined, as follows:
unsigned char msg[3]; /*declare three byte unsigned character array using C

language*/

msg[0]=248; /*control byte*/
msg[1]=65; /*assume the controller ID is the letter A*/
msg[2]=83; /*scan initiation byte which is the ASCII letter S*/
The host transmits this three-byte message at the defined baud rate. The format is one

start bit, one stop bit, even parity, and eight data bits. When this message is received

by the MINI-ARRAY controller, the controller initiates a scan, and then updates its

outputs as required. The MINI-ARRAY controller then waits for the next command

string.

Serial Data Format

The programmed measurement mode or modes determine the type of information that

is transmitted. For example, if Meas1 is set for FBB and Meas2 is set for LBB, then the

data transmitted to the host contains the values of the first and last beam blocked.
The ALL measurement mode provides the status of all beams to the host. The VHS

mode does not provide serial output data.
In addition to measurement mode information, the data transmission also contains a

start string and a termination byte. The start string consists of two unsigned character

bytes:
Hex value 1C
The controller ID value
The termination byte is the ASCII character for a linefeed (hex value 0A). These three

bytes are collectively called the Header.

Appendix. Host Mode Command and Serial Data Format

Advertising