First out Bit in Siemens SCL

MOeZ

Lifetime Supporting Member
Join Date
Nov 2009
Location
singapore
Posts
101
Hello all,

I want to do it first out bit detection in 16 bits per group and could somebody provide me samples? i prefer SCL and STL is ok for me too. appreciate help in advance. 🤞🏻🤞🏻🤞🏻
 
Can you give an example 16 bits and what you are looking to detect?

First out = First bit that is zero - returns bit number?
 
Thanks for asking..

Hi LD,

Yes " First out = First bit that is zero - returns bit number? "

Details: I want to Latch out only one bit depend on input trigger bit (1 = normal, 0 = Alarm) positions. for example, i have AlarmIn_1..16 and if AlarmIn_9 trigger first then QAL_IN9 need to latch true until reset by operator. i think this is the better idea to detect which bit is trigger first in 16. thanks in advance.🤞🏻🤞🏻🤞🏻

VAR_OUTPUT
QAL_IN1 { S7_m_c := 'true' } : BOOL ;
QAL_IN2 { S7_m_c := 'true' } : BOOL ;
QAL_IN3 { S7_m_c := 'true' } : BOOL ;
QAL_IN4 { S7_m_c := 'true' } : BOOL ;
QAL_IN5 { S7_m_c := 'true' } : BOOL ;
QAL_IN6 { S7_m_c := 'true' } : BOOL ;
QAL_IN7 { S7_m_c := 'true' } : BOOL ;
QAL_IN8 { S7_m_c := 'true' } : BOOL ;
QAL_IN9 { S7_m_c := 'true' } : BOOL ;
QAL_IN10 { S7_m_c := 'true' } : BOOL ;
QAL_IN11 { S7_m_c := 'true' } : BOOL ;
QAL_IN12 { S7_m_c := 'true' } : BOOL ;
QAL_IN13 { S7_m_c := 'true' } : BOOL ;
QAL_IN14 { S7_m_c := 'true' } : BOOL ;
QAL_IN15 { S7_m_c := 'true' } : BOOL ;
QAL_IN16 { S7_m_c := 'true' } : BOOL ;
END_VAR
 
Last edited:
it's perfect!!!

Thanks for nice example 🍺. i tested and it's perfect coding. but one thing, QOUT should allow reset/Scan only when all inputs are back to normal condition. i will study ur code and modify it.

foa.JPG
 

Similar Topics

I got problem to set a bit in a word with symbolic name. When I juse the DB adress its works( DB1.DBX4.3 := 1; ) Can somebody help me with the...
Replies
2
Views
8,759
I'm from a Mitsubishi Q-series background so excuse my ignorance. In Mitsubishi world, in my experience your Mbits (booleans) are just M1, M2...
Replies
20
Views
2,866
Good morning (EST), I am trying to implement the code below in on an S7-1200. It's barely half a dozen instructions, but I am stuck; I have not...
Replies
26
Views
5,759
I don't know what to think about this... When a "finger car" travels over a bump, there is a spike in the output Q1.3 (24 vdc output). I've...
Replies
9
Views
3,073
First time looking at Siemens. Our thin brick saw would not go system ON which by troubleshooting the wiring it was an issue with an ESTOP. But...
Replies
9
Views
2,406
Back
Top Bottom