-
What is an MSP Driver? An MSP driver is a small ladder logic
program that is added to the user program. All code is standard ladder
logic. In GE VersaMax Nano/Micro it requires a subroutine call the
beginning of the main program and one to three subroutines. One line of
logic in the main program calls the MSP Subroutine. This subroutine may
be the complete driver or in some versions it may call one or two other
subroutines.
The user can add the driver subroutines into their
program with the VersaPro programming software. Alternately the user
could start with our driver program and build their program from it.
-
Drivers. The following is a list of drivers in the MSP Driver
Library for the GE VersaMax Nano/Micro PLC. These drivers were prepared
with GE's VersaPro programming software, Nano/Micro Edition, Release
1.10 (Build 1150). The single channel input and single channel output
drivers are available on the Driver Installation disks. All other
drivers are available on our web site. They contain rung comments,
address descriptions, and address symbols that are viewable in the
programming package and on printouts.
|
DRIVER
|
DESCRIPTION
|
|
Msp_I
|
1 Channel Input
|
|
Msp_I_M
|
2 Channel Input Multiplexed
|
|
Msp_I_H
|
1 Channel Input, High Speed Counter
|
|
Msp_O
|
1 Channel Output
|
|
Msp_O_M
|
2 Channel Output Multiplexed
|
|
Msp_IO
|
1 Channel Input, 1 Channel Output
|
|
Msp_IO_M
|
2 Channel Input Multiplexed, 2 Channel Output
Multiplexed
|
-
Different Models. All drivers were tested on a 28 point VersaMax
Micro and should work with very little revision on other VersaMax Nano/Micro
PLCs. Only the model used in hardware configuration should have to be
changed. The programming language and memory layouts are very similar in
all models. In general, the VersaMax Nano/Micro programming is derived
from the 90Micro and 90/30 series.
-
Memory Usage. The attached table shows the memory usage for the
different drivers available for GE VersaMax Nano/Micro PLCs.
-
Timing Parameters. These drivers are set up for the Delta
protocol. Following are some of the key timing parameters:
|
Input
|
|
|
Protocol
|
Delta
|
|
Scan Time
|
10 msec (See Note 9)
|
|
Full Word Bits
|
16 Bits
|
|
Delta Bits
|
4 Bits
|
|
Delta Refresh Count
|
16 Scan Refresh
|
|
ID Pulse Width
|
1.2 Scans
|
|
Data Pulse Width
|
3 Scans
|
|
Output
|
|
|
Protocol
|
Delta
|
|
Scan Time
|
10 msec (See Note 9)
|
|
Full Word Bits
|
16 Bits
|
|
Delta Bits
|
4 Bits
|
|
Delta Refresh Count
|
16 Scan Refresh
|
|
ID Pulse Width
|
3 Scans
|
|
Data Pulse Width
|
3 Scans
|
-
Quality Control File. Included with the files for each driver is
a file of the same name with the ".sp" extension. This file
contains the model and serial numbers of all hardware and software used
for testing. This file also contains the setup parameters used for
testing.
-
Scan Time. The key to getting the driver to function properly is
to get the driver code executed and PLC I/O for the MSP updated at
constant time intervals.
The VersaMax Nano/Micro PLCs have the ability to fix
the scan of the PLC. Constant scan time is set in the processor
configuration package under "Hardware Configuration". On the
"Scan" tab the "Sweep Mode" should be set to
"Constant". Using the cursor and double clicking on the
"Values" field beside the "Sweep Mode" parameter
will allow easy selection of the mode. Next double clicking on the
"Values" field beside the "Sweep Timer" will allow
easy selection of the constant scan time.
The more powerful VersaMax processors have periodic subroutines. If
available the MSP driver should be run from this subroutine and the scan
time could then float with the "Sweep Mode" set to
"NORMAL". See the GE manuals for how to set this up. Note that
inputs will have to be updated at the beginning the periodic subroutine
using the DOIO instruction. Outputs will have to be set at the end by
also using the DOIO instruction. See the GE manuals on how the DOIO
instructions work.
-
Scan Time Exceptions. When possible the scan time is set at 10
msec. This is the default setting of the MSP. Those models with relay
outputs must be slowed down when using MSP analog outputs on relay
outputs. The mechanical relays are slow when compared to solid state and
we used a scan time of 30 msec.
Note that the Msp_IO_M driver effectively has 4
channels. For any of the multiplexed drivers that are expanded to 4 or
more channels on any model the scan time should be watched closely and
may have to be increased.
As the user program is added the scan time should
watched and may have to be increased to allow for additional execution
time. For the MSP to work properly the scan time must be fixed and
stable. The VersaMax Nano/Micro provides status contacts that can be
watched to detect overruns.
See note 18, Input/Output Scan Time Ratio, for more
information on scan times of outputs.
-
Programming Methods. One of the key programming methods is the
use of memory locations that are accessed both as registers and bits. We
used the M memory for this purpose. In several cases we use a shift
register as a counters. A seed is planted in bit zero of the shift
register word. To increment the counter by one the shift resistor is
shifted one bit. This allows the current value of counter to be checked
by testing a single bit in ladder, which is much more efficient than a
whole register compare. These programs have been extremely optimized for
both minimum scan time and memory usage.
-
Programming Results. Programming for GE processors yields
excessively complex code. GE does not permit branching around block
instructions, which is a serve limitation on making a program both
understandable and efficient.
GE does support a continuation coil and contact. The
mechanisms intent is to allow rungs longer than 10 columns but it can
be used for another purpose. Though messy the mechanism can provide
output branching around block instructions. Once the continuation coil
has been determined its status can be referenced multiple times by
continuation contacts for different output branches. Once the status of
the continuation coil is determined it is not changed until it is used
again.
In the VersaMax ladder logic is sometimes not solved
in the order that it is written. When doing output branching, it will
always solve the direct outputs before solving branches containing
additional logic. In the 90Micro logic was solved in the order written.
Continuation coils and contacts are also used to force the order logic
is solved in.
The ladder logic has been refined and optimized to a
very high degree. In someways this may make the driver programs harder
to read but it is felt that efficient use of memory and execution time
are the most important factors.
-
High Speed Counter (HSC). The HSC driver is intended for the
VersaMax Nano/Micro only. This driver uses less ladder logic memory but
requires 2 inputs per channel. Depending on the value transmitted it may
be faster or much slower than the Delta protocol. Unlike the Delta
protocol the update time for the HSC protocol is not deterministic.
The HSC driver uses Type A counters and up to four
(4) input channels are possible on a VersaMax Micro (3 on the Nano). The
included driver is setup for a single channel on counter 1.
The scan time on the MSP must be set greater than the
maximum scan time of the PLC. We used 10 msec for test purposes even
though the scan time of the PLC was less than 1 msec. This allows some
room for the user to add their program. On the VersaMax Micro used for
testing the scan time was fixed. With only the driver program in the
VersaMax Micro the scan time was so fast that HSC was not updated every
scan. The scan time was fixed just to slow down its rate of execution.
If the user program has a minimum scan time of more than 2 msec. scan
time could float.
Much of the setup of the counter is in the
configurator. The desired counters must be Type A and setup as follows:
|
Channel Function:
|
Counter
|
|
Counter (Output) Status:
|
Disabled
|
|
Count Direction:
|
Up
|
|
Count Mode:
|
Continuous
|
|
Preload / Strobe:
|
Preload
|
|
Preload / Strobe Input Edge:
|
Zero to Positive
|
|
Count Edge:
|
Zero to Positive
|
|
Time Base (mSec):
|
10
|
|
High Limit:
|
32767
|
|
Low Limit:
|
0
|
|
On Preset:
|
32767
|
|
Off Preset:
|
0
|
|
Preload:
|
0
|
The parameters in Italics are not used and can
be set to any value. See manuals for additional information on the HSC.
In order to send a value of zero (0) or negative
values an offset is added to the pulse count before transmission. The
driver then subtracts this offset after counting the received pulses.
Note the subtraction that occurs in the third rung. The value of the
offset varies depending on the MSP model and scale factor in order to
keep the offset to a minimum. The following table shows the offset for
the different ranges. The constant in the second rung must be changed to
match the configuration of the MSP.
|
MSP MODEL
|
SCALE FACTOR
|
OFFSET
|
|
MSP-RTD
|
X1
|
500
|
|
MSP-RTD
|
X10
|
5000
|
|
MSP-TC
|
X1
|
500
|
|
MSP-TC
|
X10
|
5000
|
|
All other models
|
|
1
|
As noted previously, each HSC uses two inputs. The
MSP must be connected to the count input that is %I1, %I3, %I5, and %I7
for HSCs for channels 1, 2 3 and 4 respectively. The Preload/Strobe
inputs are %I2, %I4, %I6, and %I8 for HSCs or channels 1, 2 3 and 4
respectively. Warning: If a counter is used for an MSP its
corresponding Preload/Strobe input must remain disconnected and can not
be used for other purposes.