step 7 micro infi sobre scale mwl

13
STEP 7 Micro/WIN -- Creating S7 programs -- Calling blocks and functions How do you reset the high-speed counters of the S7- 200? Using an S7-200 without twilight switch, how do you have shutters open at sunrise and close at sunset? How do you count values over 16 bits with the S7- 200? How can you limit the pitch of jumps with S7- 200? How do you configure the positionin g module EM253 so that the connected stepper motor can proceed in both directions ? How do you position a servo drive axis using the S7-200 pulse interface? How do you create a bar display in

Upload: jose-garcia-gonzalez

Post on 22-Oct-2015

266 views

Category:

Documents


16 download

TRANSCRIPT

Page 1: STEP 7 Micro Infi Sobre Scale Mwl

STEP 7 Micro/WIN -- Creating S7 programs -- Calling blocks and functions

How do you reset the high-speed counters of the S7-200?

Using an S7-200 without twilight switch, how do you have shutters open at sunrise and close at sunset?

How do you count values over 16 bits with the S7-200?

How can you limit the pitch of jumps with S7-200?

How do you configure the positioning module EM253 so that the connected stepper motor can proceed in both directions?

How do you position a servo drive axis using the S7-200 pulse interface?

How do you create a bar display in TD 200 or TD 200C?

How can you optimize use of timers in STEP 7 Micro/WIN?

How do you determine the frequency of a pulse sequence and speeds?

Page 2: STEP 7 Micro Infi Sobre Scale Mwl

How can you scale analog values with S7-200 in conjunction with CPU224XP and expansion modules EM 231, EM 232 and EM 235?

How do you convert a binary number into Gray code (or vice versa) in STEP 7 Micro/WIN?

How do you convert the number format DOUBLE INTEGER into BCD code (or vice versa) in STEP 7 Micro/WIN?

How do you form the absolute and negative values of numbers in STEP 7 Micro/WIN?

Why does the PID controller created by the instruction wizard sometimes not work?

What do you have to do in the SIMATIC S7-200 in order to edit part of the program once after restarting?

Which library with the inverse functions to the trigonometri

Page 3: STEP 7 Micro Infi Sobre Scale Mwl

c functions (sine, cosine, tangent) is available for STEP 7-Micro/WIN?

Scaling the setpoint and actual values in the STEP 7 Micro/WIN V4 wizards for PID control loops

Positioning Wizard for PTO/PWM in STEP 7 Micro/WIN V4.0

How to implement a three step control with PID-loop in the S7-200 via STEP 7-Mirco/WIN?

How can you scale analog values with S7-200 in conjunction with CPU224XP and expansion modules EM 231, EM 232 and EM 235?

Display part number

InstructionsAnalog input and output values of the expansion modules EM 231, EM 232 and EM 235, as well as of CPU 224XP are displayed digitally in the INTEGER data word format. It is necessary to make conversions to ensure correct interpretation and processing. These conversions are explained using the download attached. The download contains both the "Scale" library with conversion functions and the sample program "Tip038" for better understanding.

1. ScalingThe following diagrams show how the input and output values are scaled.

The terms "unipolar", "bipolar" and "20% offset" are explained here. These are important for, among others, the STEP 7 Micro/Win - Instruction Wizard PID (Tools > Instruction Wizard > PID Controller).Unipolar scaling is done only in the positive or negative value range (Fig. 01 shows an example for an analog input value of between 0 and 32000).

Fig. 01

Page 4: STEP 7 Micro Infi Sobre Scale Mwl

In the case of unipolar scaling with a 20% offset, the lower limit of the value range is 20% of the upper limit (Fig. 02 shows an example for an analog input value of between 6400 and 32000).

Fig. 02

Bipolar scaling is done in the positive and negative value range (Fig. 03 shows an example for an analog input value of between -32000 and 32000).

Fig. 03

The following table explains the abbreviations used: 

Parameter Description

Ov Scaled output value (Output value)

Iv Analog input value (Input value)

Osh Upper scale limit for the scaled output value (Output scale high)

Osl Lower scale limit for the scaled output value (Output scale low)

Ish Upper scale limit for the scaled input value (Input scale high)

Isl Lower scale limit for the scaled input value (Input scale low)Table 01

2. FormulaThe following formula is derived from the diagram for calculating the scaled value:

Ov = (Osh - Osl) / (Ish - Isl) * (Iv - Isl) + Osl

3. Library

3.1 Description of the "Scale" libraryThe "scale.mwl" library contains the function blocks for converting the scaling from data type INTEGER to REAL (S_ITR), from REAL to REAL (S_RTR) and from REAL to INTEGER (S_RTI).

Page 5: STEP 7 Micro Infi Sobre Scale Mwl

Fig. 04

3.2 Scaling the analog input in the output data format REAL (S_ITR)The S_ITR function permits you to convert the analog input signal into a normalized value between 0.0 and 1.0 (type REAL).

Fig. 05

3.3 Scaling change to the data type format REAL (S_RTR)The S_RTR function permits you to convert value ranges within the REAL format (e.g., convert the input value between 0.0 and 1.0 to the output range in percent).

Fig. 06

3.4 Converting to the analog output scaling format INTEGER (S_RTI)

Page 6: STEP 7 Micro Infi Sobre Scale Mwl

The S_RTI function converts a REAL number to the analog output data type INTEGER.

Fig. 07

4. Sample program

4.1 Description of the sample program "Tip038"There is a liquid in a closed container.

The differential pressure measuring transducer provides a current (4 - 20 mA) at the input of the analog input module. The current is proportional to the fill level in the container.

The analog module EM 235 must be calibrated so that the analog value of 20 mA is converted into the digital value of 32000 at a fill level of 10 m. At a fill level of 0 m the analog value of 4 mA is converted into the value 6400. The program scales the converted digital values as height in meters.

The voltage for the fill level indicator must be produced via the analog output module. This voltage is generated by writing the corresponding digital value to the analog output word (AQW).

The analog output module transfers the fill level height (between 0 m and 10 m) to a measuring instrument in the form of a voltage of between 0 V and 10 V. The analog display of the measuring instrument reacts to the voltage with needle deflection proportional to the fill level.

The formula scales every value between a maximum and minimum scaling value. This program receives the analog input value (AIW) and scales it for the analog output module. First the program reads the AIW, a value between 4 mA and 20 mA (6400 and 32000), and scales the value to a normalized value between 0.0 and 1.0 (see Fig. 05). This value is then scaled for the ranges of 0.0 to 100.0 (see Fig. 06) and 0 to 32000 (see Fig. 07).

4.2 The STEP 7 Micro/WIN library as zip fileCopy the "scale.zip" file to a separate directory and extract the file. You can then integrate the "scale.mwl" library and the sample program "Tip038_D.mwp", which can be used in version 4.0.7.10 and higher of STEP 7 Micro/WIN, into your S7-200 project. The "scale.zip" file contains the library "scale.mwl" and the sample program in German ("Tip038_D.mwp") and in English ("Tip038_E.mwp").

Notes

This program is also part of the SIMATIC S7-200 Programming Tips 08/03 ("Tip038")Entry ID: 1232912

Page 7: STEP 7 Micro Infi Sobre Scale Mwl

Information on inserting libraries in STEP 7 Micro/WIN is available in Entry ID: 16689345

 scale.zip ( 20 KB ) esto es prueba de guardar Word vvvvvv

InstruccionesLa representación de los valores de entrada y salida analógicos en los módulos de ampliación EM 231, EM 232 y EM 235, así como en la CPU 224XP, se realiza de forma digital con el formato de tipo palabra INTEGER. Para la interpretación correcta y consiguiente elaboración de los datos, es necesaria una conversión. Con ayuda del Download abajo indicado, se aclaran estas conversiones. El Download contiene tanto la librería "Scale" con las funciones de conversión, como el programa ejemplo "Tip038" para una mejor comprensión.

1. EscaladoEl escalado de los valores de entrada y salida se puede tomar de los siguientes diagramas.

Aquí se explican los conceptos "unipolar", "bipolar" y "20% de desviación". Especialmente importante para el STEP 7-Micro/Win - Asistente de operaciones PID (Herramientas -> Asistente de operaciones -> Regulador PID).El escalado unipolar sólo se desarrolla en el rango de valores positivos o negativos (la figura 01 muestra un ejemplo para valores de entradas analógicas de 0 a 32000).

Figura 01

Con un escalado unipolar con una desviación del 20%, el límite inferior del rango de valores está al 20% del valor superior (la figura 02 muestra un ejemplo de un valor de entrada analógica que va de 6400 a 32000).

Figura 02

El escalado bipolar se desarrolla en el rango de valores positivo y negativo (la figura 03 muestra un ejemplo de un valor de entrada analógica que va de -32000 a 32000).

Page 8: STEP 7 Micro Infi Sobre Scale Mwl

Figura 03

La siguiente tabla da información sobre las abreviaturas utilizadas: 

Parámetro

Descripción

Ov Valor de salida escalado (Output value)

Iv Valor de entrada analógico (Input value)

Osh Valor límite superior de la escala para el valor de salida escalado (Output scale high)

Osl Valor límite inferior de la escala para el valor de salida escalado (Output scale low)

Ish Valor límite superior de la escala para el valor de entrada analógico (Input scale high)

Isl Valor límite inferior de la escala para el valor de entrada analógico (Input scale low)

Tabla 01

2. FórmulaLa siguiente fórmula se deduce del diagrama para el cálculo del valor escalado:

Ov = (Osh - Osl) / (Ish - Isl) * (Iv - Isl) + Osl

3. Librería

3.1 Descripción de la librería "Scale"La librería "scale.mwl" contiene módulos de función para convertir el escalado de tipo INTEGER a REAL (S_ITR), de tipo REAL a REAL (S_RTR) y de tipo REAL a INTEGER (S_RTI).

Page 9: STEP 7 Micro Infi Sobre Scale Mwl

Figura 04

3.2 Escalado de la entrada analógica al formato de datos de salida REAL (S_ITR)Las funciones S_ITR ofrecen la posibilidad de convertir señales de entradas analógicas en valores normalizados entre 0.0 y 1.0 (tipo REAL).

Figura 05

3.3 Modificación del escalado al formato de tipo de datos REAL (S_RTR)Las funciones S_RTR ofrecen la posibilidad de convertir rangos de valores enteros de formato REAL (por ejemplo, los valores de entrada entre 0.0 y 1.0 a la zona de salida en porcentaje).

Page 10: STEP 7 Micro Infi Sobre Scale Mwl

Figura 06

3.4 Conversión al formato de escalado de salidas analógicas INTEGER (S_RTI)Las funciones S_RTI convierten un número real en el tipo de datos de salida analógica INTEGER.

Figura 07

4. Programa ejemplo

4.1 Descripción del programa ejemplo "Tip038"Se tiene un fluido determinado dentro de un contenedor cerrado.

El conversor de medida de diferencia de presión suministra una intensidad (4 - 20 mA) a la entrada del módulo de entradas analógicas. La intensidad es proporcional al nivel de llenado del contenedor.

El módulo analógico EM 235 se tiene que calibrar de tal manera que el valor analógico de 20 mA, con un nivel de llenado de 10 m, se convierta al valor digital 32.000. Con un nivel de llenado de 0 m, el valor analógico de 4 mA se convierte al valor digital 6.400. El programa realiza la escala de los valores digitales convertidos en altura en metros.

La tensión para el señalizador del nivel de llenado se tiene que crear a través del módulo de salidas analógicas. Esta tensión se crea escribiendo el valor digital correspondiente en una palabra de salidas analógicas (AAW).

El módulo de salidas analógicas suministra la altura del nivel de llenado (entre 0 y 10 metros) al equipo de medida en forma de una tensión entre 0 V y 10 V. La señalización analógica del equipo de medida reacciona a la tensión con un movimiento de la aguja que es proporcional al nivel de llenado.

La fórmula escala cada valor que se encuentra entre un valor de escalado máximo y mínimo. Este programa recibe la palabra de entradas analógicas (AEW) y la escala para el módulo de salidas analógicas. Primero, el programa lee la palabra AEW, es decir un valor entre 4 y 20 mA (6.400 y 32.000), y escala el valor a un número normalizado entre 0.0 y 1.0 (consulte la figura 05). Este valor se escala para el rango de 0.0 a 100.0 (consulte la figura 06) y de 0 a 32.000 (consulte la figura 07).

4.2 La librería de STEP 7-Micro/WIN como archivo ZIPCopie el archivo "scale.zip" en un directorio aparte y descomprímalo. A continuación, la librería "scale_d.mwl" y el programa ejemplo "Tip038_D.mwp" ya se pueden integrar en el S7-200 a partir de la versión 4.0.7.10 del STEP 7-Micro/WIN. El archivo "scale.zip" contiene la librería y el programa ejemplo en alemán ("scale_d.mwl" und "Tip038_D.mwp") e inglés ("scale_e.mwl" und

Page 11: STEP 7 Micro Infi Sobre Scale Mwl

"Tip038_E.mwp").

Advertencias

Este programa también forma parte de los tipos de programación 08/03 del SIMATIC S7-200 ("Tip038")Página del Customer Support con número ID 1232912

Información para la inserción de librerías en el STEP 7 Micro/WIN está disponible en:  Página del Customer Support con número ID 16689345

 scale.zip ( 20 KB )