PRINTING TEMPERATURES USING ONLY PLC & PRINTER

Printing 10 Temperatures using Only Twido PLC & PRINTER

In this Application a PLC Twido is used to print 10 temperatures directly to a SERIAL EPSON dot matrix Printer using the Port 2 as ASCII mode
Configuration Software Twido V3.5
Twido PLC CPU TWDLMDA40DTK
TWDNOZ232D Port 2 : ASCII
TWDXCPRTC Real Time Clock
Analog cards 5 TWDALM3LT (2In MultiSensor/1Out)
The Inputs is configured as thermocouple J
The cable used for connection with the printer is the TSXPCX1031 in ascii mode
Configuration of the PLC Port2



Configuration of Analog Cards


The PLC communication with the Printer is being done using the command EXC


The explanation of the EXC command is left for another post

This application is written only for TWIDO PLC

You could request for the program

DAYLIGHT SIMULATION FISHTANK

This application simulate the daylight and night circle for artificial lighting
(fluroscents lamps) in a dark fishtank. The purpose is to control the intensity
of 2 fluroscent lamps during the day. So in a specific hour of the day the
lamps turn on slowly with a ramp-up during daybreak , then stay on
with full power for some time, then start to turn off slowly with a ramp down
during dusk period and finally stayed off in night period.
We use an analog voltage output (0 - 10V) to control a fluroscent lamp rheostat.

The ramp up period (04:00 till 08:00)
The steady state ON period (08:00 till 16)
The ramp down period (16:00 till 20:00
The night Off period (20:00 till 04:00)
The above periods is fixed and cannot be changed. If other periods need we could change these fixed periods. The program could be expand using a XBT to change the periods, but this is left upon user request

The configuration used is
Twido Software V3.5
We could use any Twido PLC with an analog card. In the application
TWDLMDA20DTK : CPU
TWDAMO1HT : Analog card 12 bits resolution
TWDXCPRTC Real Time Clock


In the application we use a 12 bits analog card
Steps/min=4095/4*60 = 17,0625steps/min
Voltage/min = 17,0625*10V/4095 = 0.0416667 Volts/min

Use of the application is for dark fishtank (vivarium) not open one. Maybe the user could use the program in various other applications

You could request for the program

PWM Function (MICRO - PREMIUM ) on PL7 software

PWM Function


The PWM function supports regulation of a pulse width on a TOR output.
It is a function that formats the PID’s output.
The pulse width depends on the PID’s output (The PWM function’s INP input)
and the modulation period.
 The PID operation have been described in a previous post
The circuit diagram of the function’s operation is as follows:


To each TOP of the T_MOD modulation period, the activation period
in 10-3 second of the PW_O output is calculated according to the following formula:
State 1 of the gap (shown in 10-2 seconds) = INP * T_MOD / 1000

The following timing diagram illustrates this formula:


Practical rules
T_MOD = TS (where TS is the sampling period of the upstream PID),
The period of the current task (expressed in 10-3 second) is equal to:
(Required resolution)* 10 * T_MOD.
The PID is in the MAST task, the MAST’s period is 50*10-3 s,
TS = 500*10-2 s and the required resolution is 1/50
(a T_MOD period must contain at least 50 periods of the current task).

T_MOD = TS = 500.

The period of the task where the PWM is introduced must therefore be less
than 500 * 10 /50 =100 10-3 s.

The PWM function can therefore be programmed in the MAST task.
the resolution will be 1/100.

The PWM function is a standard PL7 function. As such, it is available from the
functions library.
From the language editors there, it is possible to use the help of a PWM
function’s input to facilitate its programming.

From the PL7 menu Tools --> Library the next picture appears

The illustration gives you a general idea of the Functions screen in the library
supporting the implementation of the PWM function.


The PWM function’s call syntax is:
PWM(INP,PW_0,PARA)  Equation 1

For the Purpose of the example a Micro CPU TSX3722 used
with a TSXDSZ08T2 card  (8 Transistor Outs) in order to have
the digital output for the PWM output.
The selection of a Transistor Output was done because of the long life time of the transistor.
Of course the developer has to use additional relays for the output
The following picture illustrate the configuration of the PLC



The PID operate function which explained in a previous post is


Next the Allingment of the T_MOD (PWM) on the TS of the PID 
 which is the %MW105




 And Finally in the Mast Or Fast task the PWM Operate Function in which the PWM output is the %Q3.0


Using the equation 1
PWM(INP,PW_0,PARA)
INP = %MW52
PW_0 = :%Q3.0
PARA = %MW90:5
The following Illustration all the parameters explained 



 NOTE FOR THE READER : THE ABOVE IS THE CONFIGURATION ONLY AND TYPICAL EXAMPLES ON HOW TO CONGIGURE THE PWM FUNCTION IN PL7 SOFTWARE. THE INFORMATION GIVEN ARE NOT A COMPLETE APPLICATION AND THE DEVELOPER MUST MAKE HIS OWN CALCULATIONS TO ACHIEVE PWM CONTROL IN HIS SPECIFIC APPLICATION. IT'S THE RESPONSIBILITY OF THE USER TO USE THE INFORMATION ABOVE CORRECTLY IN THE APPLICATION. IMPROPER USE MAY RESULT IN EQUIPMENT DAMAGE OR HUMAN INJURIES