Jump to content

Recommended Posts

Posted (edited)
Hallo. Ive made an array of bool for all my alarms. The idea was if any Bool wrent 1 i could do something. Now i have a problem finding a function that does that check. Is this possible or do have to use another aproach? Edited by jydepower
Posted (edited)
It standard ladde you can write K4M0 Each K value = 4 bits K4M0 means M0-M15 seen as a 16 bits value K8M0 means M0-M31 seen a a 32 bit value In IEC Developer the same can be done with your an array K8<Arrayname>[0] NE 0 K8<Arrayname>[32] NE 0 K8<Arrayname>[64] NE 0 K8<Arrayname>[96] NE 0 Edited by Gambit
Posted
You can use static variables like K4M0 but I don't think you can use labels with K*, like you say K8<Arrayname>[0] NE 0. I might be wrong, but I've never been able to use this with labels. Please correct me if I'm wrong. Another option would be to convert to a DINT and then compare to 0 like the picture attached.
Posted (edited)
Kaare your solution is better but as an alternative. Using K8 on a Array is possible. Unfortunately you cannot index anymore Edited by Gambit
Posted
I actually thought about converting to dint. But thought there might be a function to directly check the array. Ill use what you have made kaare. Thanks for the help both of you.
Posted
Not sure what you mean, but here's some more examples: Z = 4 -> M0Z = M3 Z = 10 -> M0Z = M9 Z = 15 -> M0Z = M14 As you see, if you index then the value of Z will be added to the value of the M/D and so on. Here's some more examples: Z = 4 -> M100Z = M103 Z = 10 -> M100Z = M109 Z = 15 -> M100Z = M114 Z = 4 -> M1100 = M1103 Z = 10 -> M1100 = M1109 Z = 15 -> M1100 = M1114
Posted
Hmm must admit im completely lost now. How and where do you define that? (Z = 4 -> M100Z = M103) how do i say this in ladder? Know any guide or something where i can learn to understand this? Remember im still in ladder.
Posted
Here are some exmples: 1: Basic usage of Z 2: Your application using Z and hardware addresses 3: Your application using index and bit arrays with labels Note that no3 is preferred since you normally don't want to use hardware addresses. Sometimes there's no choice so you must use hardware addresses and then you must use no2
Posted
I understand your usage of code. But I still don't get the picture of the z indexing. For me it looks like another register. Just like d and w except it only goes from 0-7. And in your post you talk about hardware addresses, I don't see those in your examples.
Posted
Sorry, I use the word "Hardware addressing" when referring to M, D, W and so on... In essence every address not declared in Header/GVL and used with labels instead of "directly" addressing the address. Yes, Z's are basically an integer in the same way as D's except that you can use them for indexing "hardware addresses". You can try to write M0D0 instead of M0Z and see what happens.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...