The Super PLC with 3 Serial Ports:   T100MX+

home.gif (509 bytes)Ladder + Basic Programming SoftwarePLC Application Photos and Users' Application NotesContact Information, Distributor List and Testimonialdiscussions.gif (727 bytes)How to Place Order on-line or Off-Line

Click one of the above links


Besides typical ON/OFF type I/Os and Analog I/Os, some of the T100MX first 8 ON/OFF inputs can be configured as special inputs such as High Speed Counter, Interrupt and Pulse Measurement. Some of the first 8 outputs can also be configured as PWM and the stepper pulse-outputs, as follow:

Input # High Speed Counter Interrupt Pulse Measurement Output # Stepper pulse Pulse Width Modulation
1 - - - 1 - -
2 - - - 2 - -
3 Ch #1: Phase A Ch #1 Ch #1 3 -
4 Ch #1: Phase B Ch #2 Ch #2 4 -
5 Ch #2: Phase A Ch #3 - 5 Ch #1 -
6 Ch #2: Phase B Ch #4 - 6 Ch #2 -
7 - - - 7 - Ch #1
8 - - - 8 - Ch #2

1. Interfacing Stepper Motors

No. of Channels 2
Maximum Pulse Rate (pps) 30000 (single channel running)

15000 (two channels running)

Maximum Load Current 1A @24V DC
Maximum number of steps

The T100MX built-in Stepper-Motor Controller generates the required number of "pulses" according to the defined acceleration and maximum pulsing rate specified by "STEPSPEED" and “STEPMOVE” commands. The SETPSTOP command can immediately interrupt and stop the stepper motor. STEPCOUNT( ) function tracks the number of steps sent to the stepper motor since the beginning of STEPMOVE command.

2. PWM Outputs

No. of Channels 2
Duty Cycle range 0.00 to 100.00
Actual Resolution 0.4%
Available Frequencies (Hz) 16, 32, 63, 250, 500, 2000, 8000 and 32000 Hz
Relevant TBASIC commands setPWM

Pulse-Width Modulation (PWM) is a highly efficient and convenient way of controlling output voltage to devices with large time constant, such as controlling the speed of a DC motor, the power to a heating element or the position of a proportional valve. PWM works by first turning the output to full voltage for a short while and then shutting it off for another short while and then turn it on again and so on in accurate time intervals. This can be illustrated in the following diagram:

The average voltage seen by the load is determined by the “duty cycle” of the PWM wave form. The duty cycle is defined as follow:

Duty Cycle = a / (a+b) x 100%

Period = (a + b)

Frequency = 1/period Hz

The TBASIC SETPWM statement controls the frequency and duty-cycle settings of the PWM channel. The T100MX PLC features two channels of PWM on its outputs #7 and #8. Since these two outputs are high voltage, high current outputs (24V, 1A) they can be used to directly control the speed of a small DC motor of up to maximum of 1A current. They can also directly drive proportional (variable position) valves whose opening is dependent on the applied voltage.

The advantage of using PWM is that you can easily amplify the drive current to a larger load such as larger permanent magnet DC motor by using low cost DC Solid-State Relays (SSR) to boost the current switching capability. In such case the T100MX PWM output is only used to drive the emitter portion of the SSR. The load is driven by the receiver portion of the SSR. Using SSR has the added advantage of isolating the CPU from the high current load.

3. High Speed Counter Inputs - Interfacing to Rotary Encoder

No. of Channels 2
Counter Range
Maximum acceptable pulse rate 4000 Hz
Quadrature signal decoding Automatic

Input #3, 4 and Inputs #5, 6 form two channels of high speed counter inputs which can interface directly to a rotary encoder that produces “quadrature” outputs. A quadrature encoder produces two pulse trains at 90o phase shift from each as follow:


When the encoder shaft rotates in one direction, phase A leads phase B by 90 degrees. When the shaft rotates in the opposite direction, phase B will lead phase A by 90 degrees. The quadrature signals therefore provide an indication of the direction of rotation.

T100MX handles the quadrature signals as follow: if the pulse train arriving at input #3 leads the pulse train at input #4, the High Speed Counter (HSC) #1 increments on every pulse. If the pulse train arriving at input #3 lags the pulse trains at input #4, then the HSC #1 decrements. Note that if input #4 is OFF, then pulse trains arriving at input #3 is considered to lead the input #4 and HSC #1 will be incremented. Likewise if input #3 is OFF, then pulse trains arriving at input #4 will decrement HSC #1. Input #5 and #6 form the inputs for High Speed Counter channel #2 and they operate in the same way as Input#3 and #4 for HSC#1 described above.

The fact that T100MX PLC automatically takes care of the direction of rotation of the quadrature encoder greatly simplifies the programmer's task of handling high speed encoder feedback. The HSCDEF statement can be used to define a Cusfn to be executed when the HSC reaches a certain pre-defined value. Within this Cusfn you can define the action to be taken and define the next Cusfn to be executed when the HSC reaches another value.

4. Interrupt Inputs

An interrupt input may occur randomly and the CPU will have to immediately put down whatever it is doing and start “servicing” the interrupt. Hence the CPU responds much faster to an interrupt input. In addition, interrupts are “edge-triggered”, meaning that the interrupt condition occurs when the input either changes from ON to OFF or from OFF to ON. Consequently, the input logic state need not persist for longer than the logic scan time for it to be recognized by the CPU.

Any one or all of inputs #3 to #7 can be used as interrupt inputs when defined by the INTDEF statement. The Interrupt inputs may also be defined as either rising-edge triggered (input goes from OFF to ON) or falling-edge triggered (input goes from ON to OFF). When the defined edges occur, the defined Custom Function (CusFn) will be immediately executed irrespective of the current state of execution of the ladder program.

5. Using Pulse Measurement Inputs

T100MX provides a very straight forward means to measure the pulse width or frequency of a square-wave pulse-train arriving at its Pulse Measurement (PM) inputs #3 or #4. To use the input to measure pulse width or frequency, execute the PMON statement to configure the relevant input to become a pulse measurement input. Thereafter the pulse width (in ms) or the pulse frequency (in Hz) can be easily obtained from the PULSEWIDTH(n) or PULSEFREQUENCY(n) function.

Setting Up a Simple Tachometer or Encoder

  • One useful application of the PM capability is to measure the speed of rotation of a motor. A simple optical sensor, coupled with a rotating disk with slots fitted to the shaft of a motor can be fabricated economically. When the motor turns, the sensor will generate a series of pulses. The frequency of this pulse train relates directly to the rotational speed of the motor and can be used to provide precise speed control.

This setup can also double as a low cost position-feedback encoder, since the number of pulses counted can be used to determine the displacement.

  • 2) Some transducers incorporate Voltage-Controlled-Oscillator (VCO) type of outputs which represent the measured quantities in terms of varying frequency of the output waveform. Such transducers may be used conveniently by T100MX using the pulse measurement capability. However, the frequency of such signal must be below 4000Hz and the output should be conditioned to square wave using Schmitt-Trigger type IC driver.

mailbox.gif (1651 bytes)    
Email :

Home of Programmable Logic Controllers (PLC)   
TRi Home Page

wpe1C.jpg (2003 bytes)
Contact Us

Copyright 2001 Triangle Research International, Inc
All Rights Reserved