S7- 315 - 2dp Cpu

Unregistered

Guest
U
Hi,

I have been having problems with the ENO being activated on some blocks that are called in OB1.

6 of the function blocks are identical appart from the addressing but one of the six will not enable

The program has been compiled and there are no errors.

I have broken down some of these blocks and found what part of the ladder program the block call does not like but can not find the problem.

The funny thing is that the blocks operate OK even without the block call being present in OB1 but without ENO being activated.

Help Please.

New to Siemens
 
If you want ENO to be always true after your block ends, put the following code at the end of your blocks:

Exit:SET
SAVE

Do not use BEU or BEC, but JU Exit or JC Exit.
 
The BEU and BEC will exit the function as soon as they are encountered. If you have code at the end of your block that you always want executed it will not be executed. The jumps to the Exit label will always guarantee the SET/SAVE combination are run before the function exits.

Simon, this seems to infer that the ENO takes on the state of the RLO when the function exits. This is good to know. I didn't realize this before. Then again, I have never use the ENO from a fucntion before.
Keith
 
The BEU and BEC will exit the function as soon as they are encountered. If you have code at the end of your block that you always want executed it will not be executed. The jumps to the Exit label will always guarantee the SET/SAVE combination are run before the function exits.



This is one of these wonderful occasions where I understood perfectly what was meant, without fully appreciating the potential consequences. I've never used the SET/SAVE combination, although Simon explained it to me a few weeks ago, it didn't seem relevant. I very rarely use the ENO function and I don't think I've had any problems, there again, I have got a couple of funny intermittent problems which aren't serious enough yet that I've sat down to chase them. Maybe I ought to raise the priority flag on this subject a little higher!
 
Here's a sample program that I wrote to do BYTE compares. The result controls the ENO so you can put a N/O contact after a byte compare and set a coil on the end. If the bytes are equal, the ENO is ON, not equal the ENO goes OFF.


L #Byte_1_IN //Load the BYTE value of Byte_1_IN to the accumulator #1
L #Byte_2_IN //Load the BYTE value of Byte_2_IN to the accumulator #2
==I //Compare the accumulator Values for EQUAL
JCN ZERO //If the accumulators are NOT Equal Jump to ZERO
SET //SET the RLO to 1
SAVE //Write RLO Bit to the BR bit (ENO) output
BEU //Block End Unconditionally
ZERO: CLR //SET the RLO to 0
SAVE //Write RLO Bit to the BR bit (ENO) output
 
Would this also work?

Note: This is a modified copy of RRobbin's code

A(
L #Byte_1_IN //Load the BYTE value of Byte_1_IN to the accumulator #1
L #Byte_2_IN //Load the BYTE value of Byte_2_IN to the accumulator #2
==I //Compare the accumulator Values for EQUAL
)
SAVE //Write RLO Bit to the BR bit (ENO) output

I think the A() will set the RLO based on the outcome of the ==I. Then just saving that will update the ENO.

Is this correct?

Keith
 
Yep, it works, better in fact. Thanks Keith.

If you gave this to 10 programers, the logic would be different but the result, hopefully, would be the same.
 
Thanks for replying to my post. I have only just come home after working away for the last week. I will try your recommendations out next week.
 
All this needs:

L #Byte_1_IN //Load the BYTE value of Byte_1_IN to the accumulator #1
L #Byte_2_IN //Load the BYTE value of Byte_2_IN to the accumulator #2
==I //Compare the accumulator Values for EQUAL
SAVE //Write RLO Bit to the BR bit (ENO) output
 

Similar Topics

Dear sir, I am using SIMATIC 300, CPU 315-2DP , (6ES7 315-2AF03-0AB0) VIPA 603-1CC21 A1.0 RAM 32KB, Firmware=V4.0.8 The problem Im using MPI...
Replies
2
Views
160
I'll preface this by saying this is the first time I've worked on a Siemens system and I'm fairly unfamiliar with them. I might mess up some of...
Replies
29
Views
721
Hi We were having a few power cuts and the CPU would not work. I had to reset the memory and he CPU would read from the memory card and start...
Replies
13
Views
3,144
Hello, I used SFC64 TO MEASURE MOTOR RUN TIME , OUTPUT : LD Memory , in case of power failure runing hours return to zero or keep the status ...
Replies
5
Views
2,293
hi there its my firest time working with profibus and i have already install gsd and networked profibus in step7 hw config and inserted base...
Replies
2
Views
2,511
Back
Top Bottom