DB block program

Sautokill

Member
Join Date
Aug 2016
Location
Sydney
Posts
4
Can someone help, from a AB background and trying to program HMI alarms but having trouble getting the DB set up triggering the array words. Nothing seems to go and the PLC logic is red:mad:
 
Hello and welcome to the forum Sautokill,

You might want to tell us what PLC/HMI you are using and what your problem exactly is.
 
Yea that might help, S7 1200 PLC and Simatic touch KTB 1000
I am trying to get a alarm page , what is the best way, Been watching U tube showing array setups and FB, which is the best?
Also I want to add text to graphics on the screen but says that it does not support multilingual text? is this something that needs to be setup? using step 7 Professional V13 software
 
To save on tag count, the Siemens HMIs expect the alarms to use different bits of a word. What may be tripping you up is that Words are not also arrays, like DINTs are in AB. you need to access them differently. Array syntax would be arraytag[index]. What you need is "slice" syntax, to access a bit in a word: alarm tag.x0 (or X11, x2, etc, for each bit.

The "multilingual" message might be related to Windows. I think you need some optional OS service installed.
 
If you're setting discrete alarm you need to know how to read exact bit from word variable. I have done it this way:



HpY5Xix.png




If you really need to read it from DB u should use DBxx.DBXx.x i.e. DB1.DBX0.0 which means first zero is offset of variable you are reading and second is bit of same variable.



RvhkutK.png
 
Last edited:
This is how I did it. Be aware that the numbering is a bit weird in a Siemens. For example I took MW5.

But the first bit is M6.0 till M6.7 then we continue from M5.0 until M5.7

You can name MW5 and also give new names to each bit as well. Then set the bits high in your code when you want the alarm to happen.

Sorry not everything is in English.

error1.jpg error2.jpg error3.png
 
I think you have all the information here that you need, just a couple of tips.

I would not use uneven numbers, when declaring a tag. So use MW4 and/or MW6, not MW5.

I would also use a DB instead of memory tags, and it will be easiest if you set this DB up without(!) optimized access.

For example. You have DB1 with all your alarms, non optimized access.
Add a tag (WORD) to your HMI tags, absolute.
Then add your alarms.

See pics.

Alarm_0.jpg Alarm_1.jpg
 
This is how I did it. Be aware that the numbering is a bit weird in a Siemens. For example I took MW5.

But the first bit is M6.0 till M6.7 then we continue from M5.0 until M5.7

You can name MW5 and also give new names to each bit as well. Then set the bits high in your code when you want the alarm to happen.

Sorry not everything is in English.

This is true for using absolute addressing. If you use slice based addressing, as mentioned in my post above, then it is in the expected least significant bit to most significant bit order. More importantly, it is the same order as used in the HMIS, so you don't have to worry about it.

In a 1200 you should never use absolute addressing unless you really need to.
 

Similar Topics

Do you have a s1200 block cutter machine program
Replies
6
Views
672
Hi, I'm learning GX Works 2 for upcoming project. I want to use ST Function Blocks in Ladder Program and it works if the FB(Structured text)...
Replies
5
Views
1,665
Hi All, I know this is very basic and I do have a concept, but I want to still ask you all: What is the difference between a function block, a...
Replies
10
Views
7,734
Is there an ISA or IEEE standard which details symbols that one would use to create a logic diagram representing the PLC program? I only have a...
Replies
2
Views
1,487
So I have this situation where I need to debug a major change to a program for a machine. I have very limited time on the actual machine and it is...
Replies
24
Views
9,061
Back
Top Bottom