UNITELWAY NETWORK

UNITELWAY NETWORK

Suppose we want to exchange information between two PLCs via network UNITELWAY. The following figure (Fig.1) shows a circuit of both PLC. Two TSXPACC01 placed to protect the TER entrances of each PLC by exogenous risk factors (hypertension, overvoltage etc.) and are very necessary


Figure 1

At the following figure (Fig.2), we can see the configuration needed to addressing the 1st PLC
This picture listed for the Master PLC. To display the image below, do the following steps:
In the PL7 Application Browser, application has already created, select Configuration -->
Hardware Configuration.
The Hardware appears and double-click on the shape of the TER which is displayed below the image.
In option "select CHANNEL" select CHANNEL 0.
If PLC PCMCIA card is installed and we want to use it then select CHANNEL 1.
Next choose the type of communication that used, in this case UniTelWay.
Then choose the "Type" --> Type Master.
Below the latter option see this option "Number of slaves" = 8 indicating the number of Slave PLC, from 4 to 8 Addresses Slaves. (A PLC can have from 1 to 3 addresses depending on the application. The position 0 is bound by the Master CPU, and the 1,2,3  for a device programmer (eg PC) .



Figure 2

Whole can be connected up to 5 Slave PLC, but if you connect a Magelis terminal, then limited to 3 Slave PLCs, because Magelis binds 2 Addresses.
If you use PCMCIA card then the total number of Slave addresses is about 98.
Below we see Figure 3, which refers to the Slave PLC.
We make the same adjustments but also set the option "Server Address AD0" to 6.
It is best to begin the addressing of PLCs by this specific address (if other used).
We can introduce a Magelis terminal to the existing network.
In this example we will follow the specified address and we will see how to put together the basic commands for data exchange.



Figure 3

The following figure (Fig.4) shows the commands necessary to achieve communication between the PLC network UNITEL-WAY


Figure 4

Suppose you want to read three words from the Slave PLC using the command
READ_VAR (ADR # 0.0.6, '% MW', 1,3,% MW10: 3,% MW200: 4)


ADR # 0.0.6: the destination address (Slave PLC), Module = 0, Channel = 0, Ad0 = 6

'% MW': is the type of data (internal words)

1:% MW1 is the Slave PLC 1st % MW

3 is the total number of words to be read from the Slave PLC

So you read the following 3 words - % MW1,% MW2,% MW3.

%MW10: 3: is the area in the Master PLC to place the above three words
i.e positions % MW10,% MW11,% MW12, respectively.

%MW200: 4: activity bit, report, length.


Now suppose that we want to write three words to Slave PLC using the command
WRITE_VAR (ADR # 0.0.6, '% MW', 20,3,% MW30: 3,% MW250: 4)

ADR # 0.0.6: the destination address (Slave PLC), Module = 0, Channel = 0, AD0 = 6

'%MW': is the type of data (internal words)

20 means the %MW20 the Slave PLC 20th % MW

3 is the total number of words will be written to the Slave PLC

So you write the following 3 words % MW20,% MW21,% MW22.

% MW30: 3: is the area in the Master PLC from where they would write the above three words in the Slave PLC, ie positions% MW30,% MW31,% MW32, respectively.

% MW250: 4: activity bit, report, length.

MASTER - SLAVE

READ

% MW10: 3  <-- % MW1: 3

WRITE

% MW30: 3 -- > % MW20: 3


Figure 5

In Figure 5 we see the internal view of TSXPACC01

S1: Selector of how the PLC (Master or Slave) which is attached the TSXPACC01
S2: Selector finish line BUS.
JA and JB: connectors TSXCSA 100/200/500 cable of the BUS.



Figure 6

Specific configuration options in our example.
For the Master PLC: S1 place in OFF postion and S2 in the NOT OFF.
For the Slave PLC: S1 = NOT OFF, S2 = NOT OFF.


Figure 7

In Figure 7 we see how to connect the cable at the interior connectors of the
TSXPACC01, and at figure 8 the communication connectors of the TSX P ACC01

Figure 8

Summary:
This is an example of how to use the READ_VAR and WRITE_VAR commands and also how to configure the PLCs to form a UNITELWAY network. This code should be altered or inserted respectively in your specific application. It is your rensponsibility to use the example properly in your applications
For more info visit Schneider Electric Site


MICRO TSX37 USE OF INCREMENTAL ENCODER WITH INTEGRATED COUNTER AT CHANNEL 11.

MICRO TSX37
USE OF INCREMENTAL ENCODER WITH INTEGRATED COUNTER AT CHANNEL 11.

At following figure 1 is the connection of the P.L.C with TELEFAST 2



Figure 1




Figure 2

At our example we used P.L.C Micro TSX3722 and encoder XCC1510PR01K
with 11-30V/push-pull/100cpt

In Fig. 2 connection with the sensors, which is similar with those of the ENCODER
Cables and color of encoder and TELEFAST 2

RED = 24Vdc - 26
BLACK = 0V - 27
GREEN = Α - 4
BROWN = Α - 1
YELLOW = Β - 8
ORANGE = Β - 10
And we connect the Α-, Β-, και 0V together. Ζ and Preset are Not Connected.

The small program is analysed
The small code program named INCOUNTERUPDOWN.STX and you could download it HERE
We use two Setpoints (High & Low). When passed from High setpoint an output is activated %Q2.1. Then when the rotation of the movement will inversed, then passing through Low setpoint another output will be activated %Q2.0, and finally when under 15 steps ouputs are zeroing.
We used %MD0 for the Highsetpoint and %MD2 for Lowsetpoint which are give values at the following

%MD0=%MD0.11.10 Value of High Setpoint
%MD2=%MD0.11.12 Value of Low Setpoint όπου
0 = Module
11 = Counter0

Making Enable the Counter setting the %Q0.11 with a contact %Ι1.4

Making Preset the Counter setting the %Q0.11.1 with a contact π.χ %Ι1.7

Making Reset Preset τthe Counter setting the %Q0.11:X1

With %I0.11.9 we know every momment the direction of movement of the Εncoder.

%I0.11.7 (Current Value >Highsetpoint) Encoder Value has passed the Highsetpoint

%I0.11.8 (Current Value>Lowsetpoint). Encoder Value has passed the Lowsetpoint

Finally with WRITE_PARAM %CH0.11 we could change the High and Low setpoints giving values at %MD0 & %MD2.

In the following figure 3 is the Hardware Configuration of the PLC Internal Counter.


Figure 3

Use of the Incremental encoder is only applied at Counter0 (CNT1 – CHANNEL 11)

For more info visit the site schneider-electric at the category
P.L.C Micro . Hardware Installation Counting.

How to import and export user data to/from Twido PLC

Title: How to import and export user data to/from Twido PLC

Description:
- This paper describes a workaround that allows exporting and importing user memory data from/to Twido controller using Twidosoft/Twidosuite animation table editor and an external spreadsheet with XML support.

Hardware any Twido controller
Software Twidosoft 3.5 or Twidosuite 1.2
MS Excel (tested with Excel 2003 SP2)  

1. Export of data

1.1. In your application create an animation table containing addresses you want to export values from.

1.2. Copy current values to retained

Twidosoft:
 

Twidosuite:
 
 
 
Figure 1: Copy current values to retained
 
1.3. Save/export your animation table to disk



Figure 2: Saving *.tat animation table file to disk

1.4. Open the *.tat file in MS Excel as XML list


Figure 3: opening of the animation table file in MS Excel

1.5. The file is displayed in Excel in form of a table, very similar to animation table in Twidosoft/Twidosuite


Figure 4: Data exported from Twido PLC displayed in Excel
 
2. Import of data


2.1. Go through steps 1.1, 1.3, 1.4 and 1.5.

2.2. Modify values in “RetainedValue” column of the table.

2.3. Save the file as XML data to keep the structure of your file


Figure 5: Saving of modified animation table

2.4. Rename the file from *.xml to *.tat

2.5. Open/import the modified animation table in Twidosoft/Twidosuite


Figure 6: loading/import of animation table
 
2.6. Use the button to copy retained values to current values




Figure 7: copying retained values to current values

3. Summary

This procedure can be used to get values from/to Twido PLC. Manipulation with a table in spreadsheet is more convenient than manual modification of animation table in Twidosoft/Twidosuite..
Length of animation table is restricted to 64 rows. It’s possible to have multiple animation tables in Twidosuite. Trying to write retained values to objects that are not writable will result in a non-critical error.\

All information provided in this document is correct to the best knowledge of the author. This approach was designed and tested in laboratory conditions. The environment influences behaviour of electronic devices and therefore the user takes full responsibility for applying presented solutions.

Using Event task with PLC Twido

Using Event task with PLC Twido
Description:

- Description and example how to use Event task subroutine in PLC Twido with example of event task triggered by an input with description of the syntax.

Hardware
Twido PLC SV:3.2
Software
MS Windows XP SP1
TwidoSoft V3.2

1) Introduction:


- An event task is part of program which is executed with higher priority then the main program and it is executed only when a conditon is met. It guarantees a rapid response time.
- The event could be triggered by software or hardware condition (VFC counting, physical inputs, periodic event).
- The events are queued till they are executed, higher priority could be set.

2) Example of configuring an event caused by input interruption (rising edge).
a) In menu Hardware/Input configuration set up which input, which edge should be detected and number of subroutine to be executed. In this example it will be %I0.2, event caused by rising edge, low priority and event subroutine number 0.

Note: Only inputs %I0.2-%I0.5 could be event source.
 

b) The program to be executed when a rising edge is detected on input %I0.2 must be called as case subroutine SR 0. To call a subroutine the main program must be finished by a rung with END statement. The subroutine must be finished by RET statement then.



c) The event subroutine must have rung header stated as subroutine with the right number (please see below). To get Rung header menu double click on the rung header when editing the rung.



d) the syntax result should be as below:



All information provided in this document is correct to the best knowledge of the author. This approach was designed and tested in laboratory conditions. The environment influences behaviour of electronic devices and therefore the user takes full responsibility for applying presented solutions.

Twido PLC - How to use 0-20mA Analog card with 4-20mA device or sensor

Twido PLC - How to use 0-20mA Analog input card with 4-20mA sensors or devices


Description:
The following describes conversion using 0-20mA Twido analogue input modules with sensors or devices working in 4-20mA range.
ANY Hardware Twido controller supporting floating point data type:
TWDLMDA20DRT
TWDL●●● 40D●●
Analogue input modules:
TWDAMI8HT  8 Input Analog channels 10bit resolution
TWDAMI4LT  4 Input Analog channels 12bit resolution
Twidosoft & firmaware 3.5
Windows XP SP2

1. Line Theory - Conversion background
The conversion of input current to value is linear. Characteristics can be described using linear equation
f(x)=m*x+c. Where m=slope and c=y intercept (y intercept , where the line cross the y axis)
Conversion consists of changing the slope m, and y-intercept c.

Figure 1 Characteristics of 0-20mA and 4-20mA analog I/O modules with 10bit resolution

Conversion for 4-20mA device connected to 0-20mA input
TWDAMI8HT - 10bit, normal range and TWDAMI4LT – 12bit,

Where :
Value(scaled) = The rescaled value at 0-20mA 
Value(meas) = The measured value
RangeXmax = 1024 for TWDAMI8HT & 4096 for TWDAMI4LT
RangeXmin = 0

Twido Analog Configuration and Program :

We Select TWDLCAA40DRF CPU and the Analog module TWDAMI8HT










Figure 2 Twidosoft application - Conversion for 4-20mA device connected to 0-20mA input with 10bit resolution and error (Sensor Fault) check

In case %MW100 is negative, it’s set to 0. This prevents %MW100 from reaching negative value when the measured current is lower than 4mA.
If the wire to the 4-20mA device is broken, current drops to 0. This state is detected in the application. The threshold for detection of the error can be altered; value 100 is used as an example.

The above approach is not neccessary for Micro TSX37 Analog cards as they could be configured to be used as 4-20mA or 0-20mA inputs
(TSXAEZ802 - TSXAEZ414 - TSXAMZ600)

3. Summary

Using this algorithm will allow to connect devices with 4-20mA analogue output to TWDAMI8HT and TWDAMI4LT 0-20mA analogue inputs. However, it will lower effective resolution of analog input by 20% since only 4-20mA from 0-20mA range is used effectively. Maximum error caused by conversion from float to integer is lower than 0.1% from the full scale

NOTE : It's your rensponsibility to use this example properly in your applications

Silo Material Weight Calculation

This Block (S7300 CPU Simatic) calculate the weight of the material in the Silo using a sonar level meter properly connected in an analog input (16bit type analog card recommended)
(or maybe something else but analog meter), given the dimensions of the SILO (constant values)
and the specific weight of the material  "global".Cntr_Specific_Weigth_S11
The input is the level measurment in cm "view".level_silo11
The output calculated in kg (REAL)  "global".view_silo11_weight

Here we use DBs to store and change the values and the results. Of course you could use a memory type value but MUST be the same type as the program indicate. It is reccomended to use your own DB.



It is your responsibility to use the block properly in your applications

You could REQUEST for download

Step Sequence (Event Drum Timer) - S7200

Step Sequence (Event Drum Timer)
Category: General Applications
Special Hardware Requirements: None
Project Example
This example program demonstrates a step sequence in which each step is followed by certain actions.
The steps follow one after another, and a step is only executed when all of the conditions stipulated for it have been met. The following applies:



Tip 18: Step Sequence (Event Drum Timer)

Copyright 2002 Siemens Energy & Automation
SIMATIC S7-200 customers have free use of the application tips. These tips are only a general approach to using the S7 -200 with various applications.
Your specific application may be different. It is your responsibility to use the SIMATIC S7-200 properly in your applications.

You could find the Program HERE

How to Track How Long a Device Has Been Operating - S7200

How to Track How Long a Device Has Been Operating (Tip 16)
Category: General Applications
Special Hardware Requirements: None
Project Example. Version 5.0. Updated 10/01
This example program shows how to record the operating period of a device such as a brake or switch. To ensure the validity of the results, a 24-V signal must be present at input I0.0 while the device is running and no voltage should be present while the device is off.
When the signal starts, time measurement starts. When the signal stops, time measurement is interrupted until the signal resumes.
The number of hours is stored in variable memory word VW0.
The number of minutes is stored in variable memory word VW2.
The number of seconds is stored in variable memory word VW4.

Copyright 2002 Siemens Energy & Automation
These tips are only a general approach to using the S7 -200 with various applications.
Your specific application may be different. It is your responsibility to use the SIMATICS7 -200 properly in your applications.

You could download the Program HERE

Reversible Motor Starter Circuits for Changing the Rotational Direction of Three-Phase AC - S7200

Reversible Motor Starter Circuits for Changing the Rotational Direction of Three-Phase AC Induction Motors (Tip 10)
Category: Motor Control
Version 4.0. Updated 12/98
Special Hardware Requirements: None
Project Example .
This programming example shows how to control a three-phase induction motor with two possible rotational directions.
Use the momentary contact switch at input I0.0 to start the motor counterclockwise. Use the momentary contact switch at input I0.1 to start the motor clockwise. The prerequisites are that the motor circuit breaker at input I0.3 and the OFF switch at input I0.2 are not activated. The rotational direction cannot be changed until after the OFF switch is pressed and a waiting period of 5 s has elapsed. This allows the motor to brake and start up in the opposite direction.





Program Flowchart:


Tip 10: Reversible Motor Starter Circuits for Changing the Rotational Direction of ThreeSeite 1 von 2

These tips are only a general approach to using the S7 -200 with various applications.
Your specific application may be different. It is your responsibility to use the SIMATIC S7-200 properly in your applications
You could find the program HERE