1. Introduction
Modern machines often demand good man-machine interface. A
message display system is an indispensable part of the man-machine interface and is
becoming an essential part of modern control systems.
The MDS100-BW is specially designed to allow a host computer
board, a master PLC or a PC to display alphanumeric characters on its backlit 4 lines x 20
characters per line LCD display via RS485 bus. You can connect up to 255 MDS100-BW
together to a master PLC such as the T100MX+, the T100MD+ PLC or to a host PC. Each
MDS100-BW can be programmed with a unique ID between 01-FF, and the master PLC is able to
select which MDS100-BW to display what text simply by sending an ASCII string that
includes the ID information of the display. Hence the MDS100-BW is ideal for implementing
multiple remote displays for a host computer.
Note: although a T100MD+ or
F-series PLC already has a built-in LCD port, it can still utilize the MDS100-BW for
additional display job, especially at a long distance and away from the machine, or if you
need an LCD display that works in extreme temperature application such as in outdoor
installation.
MDS100-BW comprises a daughter board (the control
board) that is plugged onto the back (piggy-backed) of a high
constrast, black characters on snow white background, 4 lines x 20 characters LCD module.
The LCD module is rated for industrial temperature range of between -20oC to
+70oC (-4oF to +158oF), making it suitable to be
installed in some outdoor applications.
The control board may be removed during installation of the
LCD module but care must be taken to plug it back with all the pins correctly aligned
before turning on the power, otherwise the LCD panel and/or the control board may be
severely damaged.
Jumper |
J1 (Baud Rate) |
J2 (Power Supply) |
Open |
38400 bps |
24V |
Short |
9600 bps |
12V |
Messages to be displayed on the LCD are sent from the PLC to
the MDS100-BW via their respective RS485 ports at either 38,400 or 9,600 bits per second,
selected by the setting of Jumper J1 when power-on (see table). Always use the maximum
baud rate (38,400bps for T100MX) for best performance. For short distances of less than
2m, any ordinary pair of cables can be used to connect the RS485 interfaces. Make sure
that the + and - terminals of both RS485 terminals are correctly
connected to each other.
For longer distances (of up to 1200m) you need to purchase
network-grade shielded twisted-pair cables to connect the MDS100-BW to the T100MX
PLC with the terminating resistors (on the last unit) and biasing resistors etc demanded
by RS485 network..
2. Power Supply and Backlighting of MDS100-BW
MDS100-BW may be powered by the same 12 to 24V DC power
supplies of the PLC. The requirements of the backlight current however restrict the
working voltage range. MDS100-BW employs the PWM technique to control the amount of
backlight current. When Jumper J2 is open during power-on, the PWM duty cycle is set to
10%. When jumper J2 is shorted, the PWM duty cycle is set to 25%. It is important that you
leave J2 open for DC24V power supply. If you short J2 when using DC24V, the LCD backlight
is much brighter but excessive heat will be generated on the MDS control board, and unless
forced air cooling is implemented, the current limiting resistors on the MDS100 control
board can burn out as a result.
One remarkable feature of MDS100-BW is that you can adjust
the brightness of the backlight by software, or even turn it OFF completely using special
instruction ?Bnn described later. This opens up the possibility of
using the backlight as a kind of attention signal to the operator to read the
message when something is amiss or when operator attention is required. When everything
works well the backlight is turned off or dimmed automatically.
3. Displaying Messages
When power is supplied to the MDS100-BW, its backlight should
be turned-on and its LCD screen should display a sign-on message announcing its model
number, firmware version and network ID for about one second. After that the screen
will be cleared and the MDS100-BW is ready to display messages. A blinking cursor will
appear at the top left corner of the screen and the cursor marks the starting position
where messages will be displayed.
It is extremely easy to display any character on the LCD.
Since the MDS100-BW is connected to the PLC's RS485 port, simply use the PRINT
#3 statement to display a string of alphanumeric or special characters on the LCD
screen. Texts are displayed beginning at the default cursor position and extend towards
the right end of the LCD screen. E.g.
PRINT#3 Room Temp=;ADC(1)/100;
CHR$(&HDF); C
If Analog Digital Converter #1 returns a value of 1200, then
in the above example the LCD will display the message:
Room Temp=12 o C
To display the special degree ( 0 )
character, please refer to the LCD ASCII table (see Figure 1.25) and you will find that
the special character DF (Hex) or 223 (Dec)of the ASCII table corresponds to this symbol.
You will need to use CHR$(&HDF) or CHR$(223) to represent this character.
Only as many characters which can be fitted on a single line
will be displayed. Excess characters from the PRINT statement will simply be ignored.
MDS100-BW can accept no more than 20 characters from the PLC at any one time. After
displaying the string, the cursor is placed back to the original position. That is to say,
messages sent to the MDS100-BW will always be printed at exactly the same coordinates
until being changed by the ?Pxxyy... command which will be described next.
Displaying Messages Using NETCMD$
command
The MDS100-BW can accept
messages embedded within a host link command sent to it in a form similar to
the PLCs host link command protocols. Such message format contains the
MDS100-BWs ID and error checking Frame Check Sequence (FCS) characters.
Only messages with correct ID and FCS will be accepted for display. Other characters will
be discarded. This allow multiple MDS100-BWs to be used in a network environment with
other PLCs as well.
If the MDS100-BW is to be used with a PC, you can download sample code in Visual Basic
from http://www.tri-plc.com/applications/VBsample.htm
The sample program contains function that you can call directly to send out
commands or messages in proper host link command format and it will also returns a
response string it receive from the MDS100-BW.
The M- or F-series PLCs have built-in networking command NETCMD$ for this
purpose. To use the NETCMD$, first note down the ID address of the MDS100-BW in use. The
ID is displayed in hexadecimal notation (01 to FF) on the 4th line of the sign on message
when the MDS100-BW is first powered ON. Simply append the string @nn (where nn
is the ID) in front of the coordinates and message string to be displayed. Then create a
custom function (e.g. function #99, assuming ID = F0) which can be called by other
functions, as follow:
' Custom Function #99
'----------------------A$ = NETCMD$(3, @F0+X$) ID = F0
IF LEN
(A$) = 0 command failure.
A$ = NETCMD$(3, @F0+X$)
Try a 2nd time
ENDIF |
The string to be displayed, including the coordinates "?Pxxyy" are
constructed within the caller function as X$ and then passed to function #99 by
executing a "CALL 99" command. Function #99 will then add the network header
"@F0" (where ID = F0 in this example) to the string and invoke the NETCMD$ to
send out the complete network message string (with FCS appended) to the MDS100-BW. When a
good message has been received by MDS100-BW controller the actual content of the message
will be extracted and displayed on the LCD. A response string which includes the
@ symbol, the ID and the FCS will be returned to the PLC as acknowledgment via
A$. If there are any missing characters then the message will be aborted and NETCMD$ will
receive an empty string (hence its length = 0). If an error occur the message will be
re-sent a second time by function #99.
4. Changing Display Coordinates
The command string:
?Pxxyy<message to be
displayed>
allows you to print the message at the specific coordinates
(xx,yy), where xx specifies the column # (01 to 20) and yy specifies the row # (01 to 04).
The message to be displayed may follow next. This command changes the default cursor
coordinates to the new coordinates (xx,yy) and display the string. E.g. the statement
PRINT #3 ?P0502Col 5; Line
2
will display the text string Col5; Line 2 at the
coordinates (05,02). Thereafter, any text string sent to MDS100-BW without the
?Pxxyy prefix will be displayed starting from the 5th column, 2nd row of the
LCD screen.
E.g. To display a message such
as the current room temperature, do the following:
X$= "?P0103Room Temp=" +
STR$(ADC(1)/100)+CHR$(&HDF)+"C"
CALL 99