KY data S5

juanmdx

Member
Join Date
May 2007
Location
SLP
Posts
281
Hi everyone,

I'm working on a proyect for a TP270 panel that will be witha S5 plc.

But I don't know how to manage the KY data type.

I have some of this data that I want to show on the panel, but how do I manage to separate the two words that are on the KY?.

Example:
KY = 010, 012 that's on the PLC, but how do I put on the
screen:
G1 = 010
G2 = 012
???

And also, how do I write to this kind of data?


Thanks to everyone in advance.


Juan
 
Anyone... please

I've been trying to display a KY value but it shows a value that seems to be the two words ad once (like KY 13865) but how do I see the two words??

And how do I write to this kind of data???

Juan
 
I don't know and it looks like no one else does either. I don't know anything about S5.

I am guessing that its a high byte and a low byte. First I would display the tag on the screen in Binary. Then I would look at the different bytes and see if they are out of order or backwards. I have found that type of problem with Siemens in the past so its the first thing I would look for.

Try giving more information and maybe someone else will be more help.
 
Hello Juan;

7.6 Number Representation

With STEP 5 you can work with numbers in the following five representations:

• Decimal numbers from -32768 to +32767 (KF)

• Hexadecimal numbers from 0000 to FFFF (KH)

• BCD-coded numbers (4 tetrads) from 0000 to 9999

• Bit patterns (KM)

Constant byte (two-byte representation) from 0 to 255 for each byte (KY)





:JU FB250 READ SETPOINT

NAME :RLG: AI

BG : KF +8 MODULE ADDRESS

KNKT : KY 1,6 CHANNEL NO. 1, FIXED-POINT BIPOLAR

OGR : KF +2047 UPPER LIMIT FOR SETPOINT

UGR : KF - 2047 LOWER LIMIT FOR SETPOINT

EINZ : F 12.0 NO SELECTIVE SAMPLING

XA : DW 9 STORE SCALED SETPOINT IN CONTR. DB

FB : F 13.1 ERROR BIT

BU : F 13.2 RANGE VIOLATION

This is from a S5-100U manual (6ES5 998-0UB23_100U.pdf) that you can find on Siemens' support website.
It shows that the KY data type is composed of 2 consecutive bytes (decimal values of 0-255 for each individual byte); it also gives an example of how it is used, in one of the parameters of FB250 in this case:
KY 1,6 sets parameters for the analog input channel and polarity using parameter KNKT.

Hope this helps,
Daniel Chartier
 
The KY format was a way in S5 to enable you to store two byte's in 1 word, when you are reading it in the PC you are reading the word.

You have 3 options:

1. Read a byte at a time (easiest).
2. Split the bytes into two words to read.
3. Split the word once its read by code in the PC.

KY 1,2 = KH 0000 0001 0000 0010 = KF 258.

So if you read as a word and don't split the high and low bytes you will see 258.
 
Thanks dchartier, but that's something I already knew, what I don't know is how to enter a KY data to the PLC from the WinCC Flex, because the IO Fields don't allow me to enter commas or any other character that is not numerical, so how do I do that???

Peter W, so how do I split the word into two bytes to read? (not in PLC code, I can't mess with the code of the PLC, all I can do is modify de panel), so that I can see the 1 and the 2 on your example?.


Thanks a lot for your help.


Juan
 
This KY data from the S5 is similar to the B# data of S7 (the one that is like B# (10,12)), so maybe if you know about S7 you can also help me....


Juan
 
I've seen that if I display the KY data in Hex format it's a four characters number, the fist two are the first number and the last two are the second number:

KY (bin) = 0000 0011 0000 0111
KY (hex) = 0307
KY (dec) = 775

So I could enter the data as hex, so..., that's half the problem.

Know, how can I read the data??, so that I can see the two separated bytes?, does anyone has an idea?

If for example I would like to display the 3 and the 7 in sepparated fields, because they mean different thigns to me, how do I do that?, I've this

KY (dec) = 46823
KY (hex) = B683

I know it's a 182 and a 131, but how do I display that.

The S5 shows on the program

KY = 182, 131

But I don't know how to sepparate this data, I assume is the same as in S7 with the B# (10,12) data..., anyone can help?


Juan
 
Last edited:
In wincc you'd have to use some scripts, not an expert in what you have available as command but maybe I can point you in the right direction.

Your example KY 182, 131 equals 46723 decimal

First you'd want to see if there is a high and low part

IF VALUE > 255 THEN
HIGH = VALUE/255 (You need to use an instruction where the answer is just the whole number, i.e. 46723/256 = 182.5117, so you just need the '182' bit to equal HIGH)
LOW = VALUE - (HIGH*256)
ELSE
HIGH = 0
LOW = VALUE
END IF
 
yeah... I should use scripts....

But I don't have a clue on how to work with scripts....

I know a little C++...

I've already review the First User Manual and Power User Manual of WinCC Flex and still don't know how.

Anyone has a manual or link where I can lear on how to do this code?, can I just write one time the code and use it for all the values I've to display???

Thanks


Juan
 
Juan,

I'm no WinCC guy, but you surely you can't exchange KY type data with the PLC as KY is a S5 constant format.

What is the address of the data object in the PLC you wish to read/write to?
 
The address is

DB 171 DW 10
DB 171 DW 11
DB 171 DW 12
...

there are lots of them...

and all of them are in the KY format, I'm seeing the program on the Step 5 and they are all in KY, showing the two numbers and I need to display them separately

i.e.

DB 171
10: KY = 010,010;


Juan
 
Try using..

DB 171
DL 10 for the left hand byte
DR 10 for the right hand byte

etc
 
That would be great..., but I've been around WinCC Flex and can't take just one byte of the word.

Is there a way to do it?


Juan
 
Just had a look at the help file on my WinCc Flex 2007 (haven't used it yet!) and your'e right, it doesn't support any byte length data objects....

How are you connected to the S5...PROFIBUS DP or the AS511 port?

For S5 PROFIBUS DP connections the syntax for displaying KY type data is 0,0 to 255,255 but for S5 AS511 connections the syntax is given as 0.0 to 255.255 ...using a period separator instead of a comma.
 
Last edited:

Similar Topics

Hello I have a s7-1200 and I would like to read the tags present in this controller with my controllogix controller. The two controllers don't use...
Replies
5
Views
118
Hi folks, I'm not as accustom with Siemens & WinCC, however I've been asked to increase the amount of data an existing application is logging...
Replies
2
Views
65
Has anyone migrated Proficy Historian data to a new server? I followed the guide to move all the data over, but when I run the utility, it stops...
Replies
0
Views
48
I cannot add SLC500 analog input tag (I: 8.3) to EZSeries Touch Panel Editor (V 5.3). I used all the listed tag datatype but it all says "Invalid...
Replies
10
Views
257
Hi, Wy we log data in PLC using DLG instruction, when we have option to log data in HMI
Replies
1
Views
80
Back
Top Bottom