Siemens PLC Indirect addressing

Hey,

I have tried your example, but I think it is not fully what I need, and I guess cuz it is how I explained it.
In order to clarify it(what exactly I do need) I made it in SCL:


THis is what I need


Code:
#AlarmCount := 0;
FOR #i := 0 TO "FC_DB_SIZE"(dbNO := 2) / 2 BY 1 DO
    #Alarm := PEEK_BOOL(area := 16#84, dbNumber := #dbNo, byteOffset := #startByte, bitOffset := #startAlarmBit);
    #AlarmType := PEEK_BOOL(area := 16#84, dbNumber := #dbNo, byteOffset := #startByte, bitOffset := #startTypeBit);
    IF #Alarm AND #AlarmType THEN
        #AlarmCount := #AlarmCount + 1;
        #AlarmNumber[#AlarmCount] := #i +1 ;
    END_IF;
    #startByte := #startByte + 2;
END_FOR;
 
Last edited:

Similar Topics

Hi, I have a DB in my program with all the alarms of a machine, but the machine is divided in stations. So I want to check if any station is with...
Replies
2
Views
2,078
i have two plc 1. s7-1212dc/dc/dc ip; 192.168.0.1 2. s7-1500 1513-1pn ip; 192.168.3.2 i need to get data from plc1 to plc2. any idea how to do...
Replies
5
Views
86
Good morning fellow sea captains and wizards, I am being asked to do the above and obtain 4 values from each slave, I know about the MRX and MWX...
Replies
27
Views
630
Hey guys, I have to take an upload of a program on an S71200 PLC to change a hardware config option and then redownload the program with this...
Replies
3
Views
110
Hello Guys, I want to establish profinet communication between siemens plc and my system using python programming. Which python lib can i use to...
Replies
12
Views
360
Back
Top Bottom