Question about S5 (PY - peripheral byte?)

uptown47

Lifetime Supporting Member
Join Date
Feb 2008
Location
Over there, next to those boxes
Posts
1,146
Hi all

I'm looking at an S5 program and it has the following code:


L PY 1
T EB 1



I am presuming that EB 1 is german pnemonic for IB 1.

I've looked in the S5 programming manual and found out that PY is a peripheral byte. So I know that the code is taking a peripheral byte and putting it into an Input Byte. Is this correct?

There is no physical input byte 1 on the system.. is this correct? Should it not transfer to a Flag Byte?? Or can you just use imaginary Input Bits like this?

My main question however is where does the "Peripheral Byte" come from?

I can't see any network on the PLC so where could it be coming from?

If it helps the code is in OB2 which I've read is an "interrupt OB" and the S5 PLC (a 942B CPU) has a Digital 8x24vDC Input Card on it that's a "434 input module with interrupt" that's address 0.0 to 0.7. I'm not sure if that's relevant or not but thought I'd mention it.

Anyone any ideas on this?

Cheers

:)
 
This 8 Digital input module occupies two bytes of memory instead of one.
Input bits 0.0 - 0.7 correspond to the inputs, whereas 1.0 to 1.7 correspond to the interrupt status bits. Somewhat like flag memory.

L PY1

Reads the status of interrupts and acknowledges them

T EB1

Transfers the status of interrupt bits to I1.0 to I1.7. This is programmed in OB2, as the interrupt status bit are not scanned automatically into PII.

You might want to re-read the pages i had sent to you earlier, there is a nice example explaining the programming of interrupts for this module.
 
Here's a section of the manual to amplify on Rohan's reply

434001.JPG
 
It was common in Step 5 to load from and transfer to periphery areas.

The periphery bytes are the real world inputs and outputs, The I (E) and Q (A) areas are images of the periphery.

At the start of the scan, the input periphery is loaded into the input image area and at the end of the scan, the output image area is transferred into the output periphery.

Therefore inputs and outputs are updated at a time interval governed by the PC scan.

If the program has a requirement to read an input in real time in the scan, or update an output in real time, then it would be common to L PY/PW x and then T IB/IW x. To update an output in real time you would L QB/QW x and then T PY/PW x.

Analogues, addressed PW256 and above, would always be accessed as periphery.
 
Rohan, Simon, Peter, many thanks for your information.

Rohan, I'm sorry, I didn't make the connection between the manual extracts you posted before and this code involving IB1 etc. Thank you for pointing me in the right direction.

The job I've been asked to do is to replace this old S5 PLC with a new S7 PLC.

I think I can translate the code ok but this 'interrupt' card is worrying me.

It is an old 115U PLC with a 942B CPU. I was thinking of replacing it with an S7-313C 2DP. Do you think that the 313C will be sufficiently fast enough to do away with the interrupt card and just use bog standard inputs?

I'm estimating that the system needs to be able to count 1000 pulses a second.

The S5 system at the moment is using all 8 of the inputs on that interrupt card.

Do you think a 313C is fast enough or do I need to either:
a) upgrade to a faster PLC
b) buy a special card

I'd really appreciate some pointers on this as I'm a bit inexperience with interrupts etc...

Cheers

:)
 
The 313C CPU has 24 DI which have programmable interrupts, so you dont need a special card.

CPU 313C is fast enough to replace your S5 115U 942B CPU.
 
Hi Rohan


Thanks for the information about the 313C. When you say that it has 24 digital inputs that have programmable interrupts. How would that work? Would I put the inputs in OB31 or one of the interrupt OB's in S7. Or can you specify somewhere that an input is to 'act' as an interrupt??

Many thanks for your continued support.

Cheers

:)
 
You can configure the interrupts in hardware configuration, select the 24 DI and then properties. You can then enable/ disable interrupts for each inputs and also the positive / negative edge trigger.

The Hardware interrupt OB in this CPU is OB40.
 
This practice is common if you do not want to use interrups.

Another common practice is to create a function block & in it update the input image imidiate with L PYxx T IBxx
Then call the block a number of times in OB1.
e.g. if the total scan time of all blocks in OB1 is 150ms
Then calling the block say three times could bring the scan of the Peripharal byte to less than 60ms, this depends on each block scan time etc.
 
L D[AR2 said:
..... not for counting 1000 pulses/sec though.

Simon, Peter, (and anyone else who can help)

How many pulses a second do you think a 313C-2DP would be able to cope with. Its not a very large program. I'll need to see just how fast the machine is running but is 1000 pulses a second ridiculous or just a little bit too fast do you think??

*EDIT*
What about if I went for a 314C-2DP? This PLC says that it has a speed of 0.1ms/1000 instructions. It also has "4 channel counting and measuring with incremental encoders 24V (60Khz)" not sure what that last bit means fully but am I right in thinking that if it ends up not being fast enough I could somehow configure 4 built in high-speed counters to do the job??
 
Last edited:

Similar Topics

Hello again..trying something on an existing poorly written program and just wanted to double check something system is an A-B MicroLogix 1200 In...
Replies
5
Views
167
Good morning! Let me start by saying, I am still learning about this type of HMI programming. I recently watched a video about recipes and how it...
Replies
0
Views
68
I have some logic that I have written within a 5380 series controller that tracks the time an event is started, while the event is running an RTO...
Replies
2
Views
91
I have an HMI 2711R - T4T Series B, and I want to know which PLCs, besides Micro 820, can communicate with it.
Replies
2
Views
81
HI i would like to know how to get a variable that will store the amount of times a program has been executed. The issue is I have 3 DBs for 1 FB...
Replies
2
Views
81
Back
Top Bottom