Calling all Siemens S7-200 gurus

mjamil

Member
Join Date
Apr 2002
Location
PK
Posts
162
The Hardware:
S7-226 CPU.
TD-200 Display.
Cable to connect both of the above items together.
and ofcourse the machine with lots of buttons, sensors, etc.

SCENARIO:
I've got 8 sensors on this machine, its a packing machine.
I've been programming this kinda machine quite a lot. I was given a task, to modify my programming structure so that I would have to go to the site to upload the program, instead we could send it as a kit, and the user could do the final settings as per his requirement.

the kind of setting I am referring to would not require the MICROWIN software, as I plan to integrate it in the DISPLAY TD-200.

The changes would be something like this

Each sensor would have certain options, the problem is each user requires different option to be turned ON or OFF.

Say we are talking about a SENSOR-A, the options I want on the TD-200, would be somthing like this;

1) Sensor 'A' input ENABLED/DISABLED. (as most production concious ppl. tend to by-pass sensors, frequently, ofcourse these sensors are not related to SAFETY, rather, to the quality of the product being packed.)

2) Sensor 'A' should sound a bell! ENABLED/DISABLED.

3) Sensor 'A' should stop the Machine ENABLED/DISABLED.

4) Sensor 'A' should xxxxxx EN/DIS.


...... and so on.

what I was wondering, how would it be possible to achieve the above solution? after some time, I noticed if I had 8 sensors, and each having say evn 4 options, this would mean 32 messages in the TD-200, (if the messages are stored independantly)

How would it be possible to include all the options in one message under the TD-200....... HEXADECIMAL????

where (if possible, I'm not sure) the options would be displayed like a '00001001' (like a regular DIP SWITCH, we see every now and then)

only these are the kinds of setting I have to do at site, within or outside the country. This will certainly cut down my extra running, apart from the fact that until I am successful in achieving the solution (even If I dont implement it) its going to bug me for the rest of my life.

the problem is how the heck can I display a HEX number in the TD-200?

any / all comments / suggestions are welcome.
 
I do EXACTLY what you're planning to do on every machine we build. I was going to explain how easy it will be to do, until I researched that TD-200 and found that it only holds 80 messages!... :eek:

I sure hope that TD-200 is under 100 bucks, 'cause even the US$180 EZ-220 I use can hold 256 messages... (y)

The only trick I can think of would be to use numeric values to represent each option. 1 = Option 1, 2 = Option 2, etc., but then you'll have to give them a cheat sheet to associate the number with the option. That kinda defeats the purpose of a T-E-X-T display though... :rolleyes:

Using numeric values would only need a few messages (not like you have that many to spare!). The first line would read something like "Option nn is", with nn being your variable. I would use two messages for the second line. When the option is enabled, you'd display "Currently Enabled", and "Currently Disabled" when it's disabled (duh)... :D

That is basically how I do it myself. I just have separate messages that describe each option instead of a number you have to cross reference.

I'd be glad to share my method of displaying/selecting options, but it's it's not something you couldn't come up with on your own. Since I've already worked out the bugs, it may simply save you some time. Let me know if you want details. I'm headed home right now, but I can elaborate tomorrow, which is actually just 'later today' for me... ;)

beerchug

-Eric
 
Thanks eric, for taking time to reply.

Since mostly I'm working under 80 messages, the TD-200 is OK for my apps. never hear of EZ-220 actually, probably b'coz its not from Siemens, is it?

Here in our region, not many products (options), we prefer single source, to avoid compatibility issues.

I did think of Numerical values, but its kind difficult from operator's point of view (as compared to simple 1010101s)

Just now, I was wondering, what and how would it be, if I used more than one byte/word to be displayed at a time in a single message? would it let me change the values for all these say 4 messages at a time? (I dont think so, but I've never tried)

However, I would appreciate if you could eloborate how you do it, maybe I can enhance my skills, even if not for this particular project.

thanks again.
 
is possible.....

Hi Mjamil,


I've been thinking about this problem and the only thing i see is use a decimal number like an binary list of "0" and "1". The operator writes "10011" and you must work with this number to separate each digit and activate or not the option. It's not a good idea because it needs more program and the operator can easiliy make a mistake or use other numbers apart from 0 and 1.

Good luck
 
Odd that no one else had any suggestions... :( EDIT: I see plc'r'us responded while I was typing.

mjamil said:
However, I would appreciate if you could eloborate how you do it, maybe I can enhance my skills, even if not for this particular project.

You might not understand my method without seeing 'the whole picture' so I'll try to stay generic and just give you the gist of it.

You first need to create a sequencer to scroll thru the available choices. You can initiate this however you want, but lets assume you'll assign function key 'F1' to access the options. 'F1' will be a one-shot pulse (from the TD-200, or generated locally in the program)

Rung 1: Each time 'F1' is pressed, move to the next option (when options are displayed). This needs to be before the the SET instruction so it doesn't increment when you first access the option display.

| One-shot Display
| from 'F1' Latch
|-----] [---------] [------> Increment Sequencer Register by "1"
|


Rung 2: Make the sequence repeat from the beginning when it reaches the last option. Whatever value you put in the > comparison dictates the number of options. In this case, it will go 1, 2, 3, 1, 2, 3, etc...

The < comparison just eliminates the need to preload a valid value in the sequencer register. This gives you the option of always starting at option #1 (sequencer register set up as non-retentive), or remembering the last option accessed (sequencer register set up as retentive).

| Sequencer > "3"
|-----------] [-----+------> Reset Sequencer to "1"
| |
| Sequencer < "1" |
|-----------] [-----+
|


Rung 3: Initiates the option display when 'F1' is pressed.

| One-Shot Display
| from 'F1' Latch
|-----] [--------------------------------( SET )
|


Rung 4: Automatically cancels the option display after a preset amount of time. IOW, if no key is pressed for 30 seconds, revert back to normal display. You'll want to add additional N.C. contacts for any other keys used during editing.

| Display One-Shot
| Latch from 'F1' +-------+
|-----] [---------] [-----+-------------| Timer |
| +-------+
|
| Display
| Timer Latch
+---] [--------( RST )



On to the message display portion...

Rung 1: When the display latch is ON, display "Option n" on the top line. You can use you sequencer register as the 'n' embedded value to save on registers if the S7-226 is as limited as that TD-200... ;)

| Display
| Latch
|-----] [------------------> Display top line message


Rung 2: When the display latch is ON, and the currently displayed option is ON, display "is Enabled" on the bottom line.

| Display Option #n
| Latch Sequencer = "n" Enabled
|-----] [-------------] [----------] [-----> Display bottom 'enabled' message
|


Rung 2: When the display latch is ON, and the currently displayed option is OFF, display "is Disabled" on the bottom line.

| Display Option #n
| Latch Sequencer = "n" Enabled
|-----] [-------------] [----------]/[-----> Display bottom 'disabled' message
|



Now the option enable/disable logic...

You'll need an 'edit' key to enable/disable the option. For my example, let's use 'F2'. When the display latch is ON, a one-shot called 'Edit Option' is generated (for the currently displayed option) when the 'F2' key is pressed.

Here we get to use the forum's favo(u)rite topic, a flip-flop!... :D

The one-shot toggles your option bit ON and OFF. Remember that this bit will have to be setup as retentive to hold its value through power cycles


| Display One-Shot Edit
| Latch Sequencer = "n" from 'F2' Option 'n'
|-----] [-------------] [----------] [----------( )
|
| Edit Option 'n' Option 'n'
| Option 'n' Toggle Toggle
|-----] [---------]/[-----+---------------------( )
| |
| Option 'n Edit |
| Toggle Option 'n' |
|-----] [---------]/[-----+



That's about it. Hopefully I explained it okay. 3 messages in the TD-200, one register, one timer (if you even need it), and however many bits you need to cover the options. Of course, there are many other ways to accomplish the same thing. This way works just fine for me, and my customers have no trouble using it.

beerchug

-Eric
 
Last edited:
Thanks Eric, once again,

I was just going thru your reply and downloading some stuff, from siemens's site.

maybe u would like to have a look at it here

I will have to give both of these options a shot, before I can fully understand, sometimes plain text gets boring zzzzz

thanks for all your help
 
Yes, that might be a nicer option. As long as you don't run out of memory in the PLC trying to store all the ASCII strings!... :D

beerchug

-Eric
 
Eric

Could you please send me sampel program of AD PLC & EZ text.
I lookink for the method of massage scroll.
I found the a way to do it with Omron but not with AD.

Thanks in advance
 
ArikBY said:
Eric

Could you please send me sampel program of AD PLC & EZ text.
I lookink for the method of massage scroll.
I found the a way to do it with Omron but not with AD.

Thanks in advance

What I posted above is my basic code verbatim, but I'd be more than happy to write you an A-D specific version. I definitely 'owe you one' for pointing me to the NC8000 (which I'm typing on right now!)... :D

In all of my programs, this display portion interacts with the rest of the program, so it would be difficult for you to understand without knowing the machine. What I'll do is isolate it so it can function as a standalone program.

Which specific model PLC and EZ-Text are you using? I can probably find some time to put it together tomorrow night.

beerchug

-Eric
 
Last edited:
The TD-200 sure seems to be quite limited. 80 messages can be eaten up in no time.

But the TD-200 is not as limited as it first appears.

In terms of the problem posed by mj, one might expect that the TD-200 could address up to 80 device/option combinations. In that case, each device/option combination is one less message available for normal operations. This is not a good "general solution".

A good "general solution" would provide for an unlimited number of device/option combinations. ("unlimited" means much, much more than 80... something in the many thousands, maybe.)

The TD-200 can provide that general solution while using only two of the 80 messages. The only messages that need to be created are...

DEVICE ID (####) <== Embedded Variable
OPTION CODE (####) <== Embedded Variable


Of course, this would mean that the option codes would have to be developed from a worksheet. On the TD-200, you wouldn't see text describing the options. You would simply see DEVICE ID followed by a decimal number. And OPTION CODE followed by a decimal number. The value of the Option Code would be used in the program to activate or de-activate various options for the particular device.

TD-200 messages are displayed by Priority. Priority is determined by Message-Number. That is, Message-1 is the highest priority. Message-80 is the lowest priority.

When calling the Device Option Routine, your program would turn off all messages (possibly saving a copy of the current message status).

Your program would then turn on Message-1 & Message-2.

MSG-1: DEVICE ID (####) <== Embedded Variable
MSG-2: OPTION CODE (####) <== Embedded Variable


The DEVICE ID might come up with a default value of "1". The current OPTION CODE assigned to Device-1 would also be displayed. The Option Code data comes from a table. The table consists of an array of Bytes. The "BASE-BYTE" might be VB-100. The location of Device-X would be Base-Byte + Device X. Device-5 would be located at VB(100 + 5) = VB105. The value in VB105 = the Option Code for Device-5.

Both of these Embedded Variables can be edited. You would use the appropriate keys to move back and forth between the two messages and edit as required.

Editing the Device ID would cause a "jump" to that device while editing the Option Code would redefine the option code for the current device.

Pressing one of two F-Keys would cause the Embedded Variable in the Device ID to either increment or decrement. The current option code for that device would also be displayed.

Pressing ENTER would save the edit, pressing ESC would abort the edit.

All of this activity is managed through manipulating and monitoring the F-Key Control Word. The TD-200 can turn on bits in the control word. The program in the cpu must monitor the control word, respond appropriately and then clear the F-Key bit.

When you save an Option Edit (ENTER) your program must read the current Device ID and then assign the current Option Code to that Device. All of this happens in the program in your cpu. Remeber, the TD-200 really is just a dumb-terminal.

As far as the Device/Option Table... (current option status for a given device)... there are dozens of different ways to create and manage a data table.

This method could provide for many thousands of possible device/option combinations. And you would still have 78 Messages available for normal operation.

Gee,... it would almost be like programming a PDP-11. (Device ID = LineNumber, and Option Code = Instruction or Data)

(190)
 
Terry Woods said:
But the TD-200 is not as limited as it first appears.

Oh, yes it is, Terry.

There are many creative ways to work around limitations, but it makes for a very boring display... :oops:

The 'correct' solution would be to realize the limitations ahead of time, and find a display without these limitations. Unfortunately, mjamil is stuck with these limitations until the next project... :(

I have used your 'increment/decrement via function keys' idea on the older Optimate panels, but the communication lag makes for very annoying operation. What's worse is when you need to make a drastic value change. No one wants to push a key a zillion times, so I would add an automatic key-repeat when the button was held. Saves wear and tear on the key (and the operator's finger), but by the time the display updates, you've overshot the mark... :rolleyes:

If you havent already guessed, I don't use those displays anymore. Local value editing is a must. I have my share of gripes about the newer EZ-Text displays, but at their price, I can't get overly upset... :confused:

Now let me sit down and throw together an example program for Arik... :D

beerchug

-Eric
 
From the original post...

what I was wondering, how would it be possible to achieve the above solution? after some time, I noticed if I had 8 sensors, and each having say evn 4 options, this would mean 32 messages in the TD-200, (if the messages are stored independantly)

How would it be possible to include all the options in one message under the TD-200....... HEXADECIMAL????

where (if possible, I'm not sure) the options would be displayed like a '00001001' (like a regular DIP SWITCH, we see every now and then)

only these are the kinds of setting I have to do at site, within or outside the country. This will certainly cut down my extra running, apart from the fact that until I am successful in achieving the solution (even If I dont implement it) its going to bug me for the rest of my life.

the problem is how the heck can I display a HEX number in the TD-200?


It sounds to me like mj is talking about "reconfiguring" a particular machine for a particular operation. I expect this means shutting the machine down and going through the pains of reconfiguring the machine for a different operation. It's a one-time sorta thing... 'til the next change over, if any.

Several machines, or one machine with several operational modes, one program, one setup routine. hmmm... doesn't sound too bad for a family of similar machines.

He expressed concern that 4 options on 8 devices would use 32 of the 80 messages. He is obviously worried that he might run out of messages before he runs out of device/option configurations and possibly operational messages.

Granted... a little foresight would have made this less of a problem... duuuhhh... do ya think?

The TD-200 ain't no SCADA... however, it can be made to operate a little better than the manual would have you think.


THE CHALLENGE...
The challenge is to provide what he needs with the hardware he has. In fact, the challenge is to squeeze out every drop of blood that the TD-200 has to offer. This means looking deeper into how the TD-200 works and finding a way to make it work more efficiently than appears on the surface.

Given the constraints that mj described, I provided a means to get around the 80-Message limitation. Instead of using a multitude of messages I showed him how to get the same effect while using only two messages. Instead of trying to figure out how to enter a HEX value to identify a particular option I described using DECIMAL.

BTW, the TD-200 will NOT display HEX. That format is not allowed.

The decimal number would be derived from a binary weighting. If he used BYTES to record the options then he would have upto 8 options per device. The number of devices would be essentially unlimited.

Depending on the particular mode of operation, it might be desireable to have a particular device turned OFF (Option Code = 0 Dec).

Depending on the particular device and its particular operation, it might be desireable to have two or more options turned ON.

BYTE Number is bound to Device ID.
BYTE Value is the Device Option code.

Option # 1 2 3 4 5 6 7 8
+---+---+---+---+---+---+---+---+
| 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
+---+---+---+---+---+---+---+---+
Weight 128 64 32 16 8 4 2 1

Option-1 = Horn when device goes ON.
Option-2 = Bell when device goes ON.
Option-3 = Horn when device goes OFF.
Option-4 = Bell when device goes OFF.
etc...

Option Code = 128 + 16 = 144

Horn sounds when device goes ON and Bell sounds when device goes OFF.

If Option Code is "0" then device is ignored... disabled.



In this case, the only difference between HEX and Decimal is the display. They both have the same binary value. There would be differences in the way that the value is incremented or decremented.

Decimal is much more straight forward.

The option list could be unique for each device.
The "device" could be an Input, an Output, or a Control Relay.

A programmer could write a generic program that might apply to several machine types in the same family. The specific operation of the machine could be determined by a "recipe" number (that would use one more of the 80 messages). The operation could then be "fine-tuned" by explicitly modifying device options. The current configuration could then be saved as a new recipe (this would use up one more of the 80-messages).

Now, mj could simply provide a list of device codes and option codes for a particular configuration. In this case, he retains control over the configuration.

Or, he could provide a listing of the devices and the various options to the customer. This would give control of the configuration to the customer. This could be dangerous... but then, if properly programmed, the program would not allow an invalid configuration.

All of this can be accomplished by that little piece of **** we know as the TD-200. I would NEVER, willingly use that piece of ****... however, if I had to...

All it takes is a little imagination.
 
If it were me, I'd be on the phone to Siemens for an RMA number... :rolleyes:

Anyway, here's your example Arik. The DL-06 and EZ-Touch programs are in separate folders in the zip. I assumed that you meant the 4-line EZ-420, since there's no such thing as a 240. I used all 4 lines, so if you have an EZ-220, let me know and I'll modify accordingly.

[attachment]
If you can't open them, your software might not be up to date. All updates are HERE. And yes, they're FREE!...
abbash.gif


This example will work on it's own. You don't have to copy and paste it into your code. Just dump both programs into their appropriate devices and away you go.

beerchug

-Eric
 
I almost forgot...

ArikBY said:
Is it possible to scroll by up-down arrowes?

Yes, and that's how I made it function in the example. The up and down arrows scroll through the available options. There are seven 'Options' (A thru G), and each one can be on or off. You'll notice that I used a few different descriptions of the ON and OFF states (ENABLED, SELECTED, etc.). This is just to show that you can opt to share common descriptions, or have individual text associated with each one. Each option's current state is in C101 thru C107 (for A thru G respectively). These bits will need to be retentive.

Play around with it and come back with any questions you have.

I'd recommend NOT using the arrows to scroll, as you need them to maneuver the cursor, and edit values.

beerchug

-Eric
 

Similar Topics

Hi everyone, I'm using a S7-1200 and a KTP basic 1000 with TIA basic. In my program i call a screen using an internal marker M0.0 for instance...
Replies
0
Views
1,218
Hey gang. I hope I'm not too much of an annoyance for you guys, but I need some more help ^^ I'm more or less just getting started at...
Replies
12
Views
12,342
I am looking to get an AB series 1774 (PLC1) from the 1970's up and running. I have all the parts, and it powers up just fine without errors if I...
Replies
12
Views
2,286
Hello all, I’ve recently begun using Automation Studio on my own time to boost my knowledge of controllers beyond AB/Siemens. To ease myself into...
Replies
0
Views
871
Hello I'm new to PLC programming and I'm programing in ST. Programming envirement is GX works 3. I can't figure out how to jump to subprogram or...
Replies
1
Views
1,410
Back
Top Bottom