Help PLZ, confused in Data Comparison

ahsen001

Member
Join Date
Mar 2010
Location
Dubai
Posts
25
Hi, Hello to all guys,

I have a problem to ask. Plz help me.

I have made a Global DB (named as DB1), in which i have define an ARRAY of 4 Elements. In which i have define the Hi_Limit, Low_limit and Intermediate values of my TT( Temperture Transmitter).

like here, Lets my array name is "DATA".

Data[1] = 10.0
Data[2] = 20.0
Data[3] = 30.0
Data[4] = 40.0

I have a Function (FC1), in which I have performed scaling of TT using FC105. Now, I want to compare my scaled value with the VALUES defined in Global DB1.

> If Scaled Temp is less than Data[1] then Q5.0 should blink.
> If Scaled Temp is greater than Data[1] & less than Data[2]then Q5.1 should become high.
> If Scaled Temp is greater than Data[2] & less than Data[3]then Q5.2 should become high.
.....
....
....
.....
And so on ...

> If Scaled Temp is less than Data[4] then Q5.4 should blink.

I m trying to do but i m not succeeding. Kinldy tell me how it is possibel ...?
 
Sample program

This is the snapshots of program which i have tried.

DB1 is the GLOBAL DB.

FC1 is a self made function where i have perfromed scaling and stroed it in temporary variable(Scaled_Value). And then tried to compare by picking the data from DB1.

Kindly tell me the mistake.

Thanx,

PIC-0.jpg PIC-01.jpg DB1.jpg
 
Right DB-1

This is the Right DB-1. the old one which i have attached is false b/c of wrong addresses. Kindly follow this DB for addresses.

DB-1.jpg
 
1. There is no code for any flashing
2. When you jump to ABC you will always set all the Q's because the program flow will carry on through the labels DEF and XYZ
3. Once you have set a Q, there is no code to turn it off.
 
In network 2 of your code when you load value from DBD[AR1, P#0.0]... from which DB does this come from since you dont open any prior to loading? For example OPN DB1.

In NW3 you should replace two first NOP 0 commands with BE or jump to MW4 if there is one. If you want to use SET to control the outputs you will have to RESET them before the jumps. After that you can think about flashing them.
 
Thanx for both of your replying LD & Maitomies.

For Maitomies:
I think that L DBD[...,...] is used automatically to load data from Global DB of your progam. And about the NW3, i try to do it. and then tell you.

For LD:
I want to just make that bit high (not neccessary to blink or flash).

Plz tell me had i made any mistake in NW#2, where i have compared the Sclaed_value with Array elements.................??
 
Please add to the above - it loads data from the currently open global db, it does not open the global DB.

I've coded your logic (in ladder) together with a flasher and some simulation code to test the logic. See OB1 in the attached S7 library.

In your code, why have you used indirect addressing rather than direct loads to read the values from the DB ?
 
Last edited:
Thanx LD for help and Code also.

LD, I have also tried a code for the above mentioned task. I am attaching its Screen_Shots. It is not about the Blinking, It just sets the BIT according to Conditions.

I want to ask a question that i didnt open here the DB1, but I had done all the comparison through indirect addressing from DB1. how it is possible that without opening and addressing DB, we can access its Values.......?

Bit-1.jpg Bit-2.jpg DB.jpg
 
The instruction

Code:
L DB1.DBD0

actually executes as

Code:
OPN DB1
L DBD0

So DB1 has been opened.
 
Thanx LD.

U asked me that why are you using indirect addressing rather than direct addressing from DB1...?

Because I was trying to do some basic example of Indirect addressing using STL. Although, I am new to use the STL language, but it makes our calculation so short and easy.

Actually, I have a NTC sensor having temperature range -55 to 150 Degree-Centigrade. Its resistance range is 7686.8 to 1.156 K-Ohms. I have also a Siemens Module 6ES7 331-1KF01-0AB0.

But i am confused in scaling of this sensor. Because the resistance is not the almost Linear. So how should i make Scaling for coverting the input resistance value into appropriate temperature.....?

One thing which i am thinking is that i shoud make a DB in which i should define the Temperature with the difference of 5-Centigrade.
Like here:
Data[1] = -55
Data[2] = -50
Data[3] = -45
......
...
...
Data[n] = 150

And also define the Resistance Value (seen from the table of this NTC) which corrosponds to each temperature.
Like here:
Resistance[1] = 7686.6
Resistanec[2] = 5161.2
Resistance[3] = 3602.6
Resistance[4] = 2545.24
....
....
...
Resistance[n] = 1.156

And make a FB in which i compare the Each input coming Resistance with the Defined Resistance and then corrospondant TEMPERATURE...?

TELL ME IS THIS THE RIGHT WAY TO DO IT...?

AND ALSO GUIDE ME THAT HOW SHOUD I START IT...?

U KNOW I AM NEW IN STL. THEREFORE, I WAS MAKING THIS BASIC TEMPERATURE COMPARISON EXAMPLE TO DO THIS NTC TASK.
 
Hi,

with 6ES7 331-1KF01-0AB0 you can only measure resistances from 0...6kΩ. You might have to think about some other connection/converter to measure the temperature.
 
Thanx Maitomies.

Oh! its also a problem. I didnt think about it. But i think this problem can be solved by Attenuation Circuit. But actual confusion is how to do the main task....?
 
Have a look at the following implementation - DB1 contains a lookup table of resistance/temperatures. FC2 takes a given resistance, finds the relevant entry in the look-up table and then uses linear interpolation with the following entry to return a temperature value.
 

Similar Topics

Hi Can I get the programming software and data cable name for allen bredly servo drive which model is 2098-DSD-020x?
Replies
4
Views
2,215
I need some assistance to any Siemens Gurus' who can help me convert the following from STL to Lad. I have tried all the old tricks I can...
Replies
4
Views
4,289
Any body here to help me regarding S7-300
Replies
4
Views
1,349
hey evry one i have this problem In the system with S5 CPU 927 it is work ok, but i try to run another four CPU 927 for backup but no one of the...
Replies
10
Views
3,895
sir plz tell me how to interface servo motor with abb micrologoc 1400b plc plz give me detail of instruction and wht type driver may i use or tell...
Replies
5
Views
2,495
Back
Top Bottom