Overflow In Scl

Dear Peter, thanks for you answer.
But I´ve never programmed in STL, do you think you can show me how to do it?

Thanks again
 
Re: If you can then it isn't obvious to me either.

Peter Nachtwey said:
Write a small STL FC that returns 0 or 1 depending on the state of the OV flag the call the FC from SCL.

I am no expert on this, as I have not had a reason to monitor the status bit OV before, but don't you need to write a FB rather than a FC, I believe you do not have access to status bit's in FC's, only FB's. Doesn't the status bits have to be declared in the local data area of the FB? I am sure in FC's you can only declare in, out, in_out and temp data where as FB's also have the status declaration availiable.

For aracioppi to monitor this bit, he will have to do his math within a FB, then set a 'M' bit depending on the state of the OV, he should then be able to monitor the 'M' bit elsewhere in his program.

Perhaps, someone like Daniel or S7guy could confirm this

Paul
 
Paul, I think you are confusing an FB STAT variable with the Status Word. You can evaluate the status bits (one of them being the overflow bit) from an FC using the following instructions:

A ==0
A <>0
A >0
A <0
A >=0
A <=0
A UO
A BR
A OS
A OV

(Note that I used "A" in my example, but I could have used AN, X, ON, etc).

Take a look at the Siemens Help (Status Word Bit Checks) and it will explain each condition.
 
hello araciopi;

There is an STL instruction that loads the status word into the accumulator; you can then transfer the status word to a memory location, where you can evaluate the different bits. Just remembre that these bits change with every function executed, so it will be touchy to synchronize your logic.

For example, you could program your FC in STL this way:

L STW //place the content of the status word in ACC1 (32 bits)
T MD50 //save the status word to a specified memory location


Then in your SCL function (or anywhere in the program, including the STL function, which could be faster), check the status of bit M53.5, whre the OV bit has been copied. Here is a presentation of the L STW instruction in the Siemens STL manual:

Hope this helps,
Daniel Chartier

ov.jpg
 

Similar Topics

Hello: I am experiencing the following error: [ERROR] C0297: Stack overflow detected in DecodeOID. Maximal Stack Size: 64512. Calculated...
Replies
8
Views
1,222
Gents, I'm trying get some SEW Movigear motors in control by a Beckhoff PLC which is TwinCAT 3. The SEW motor is connected by EtherCAT and is...
Replies
0
Views
1,310
I found an older thread about fixing this issue, but the link to the technote was dead. I'm running InTouch 2014R2 with SQL 2012. When I try and...
Replies
0
Views
1,303
I have Logix v21 running in Emulate. I am getting runtime faults at random times, typically it takes anywhere from 30 seconds to 5 minutes for...
Replies
7
Views
2,132
I have programmed a cut-to-length system on ML1400 which I am simulating with a voltage controlled oscillator driving HSC:0. The program uses a...
Replies
1
Views
1,541
Back
Top Bottom