A forum for topics related to the scope of Modicon PAC offers and ecosystem along the whole lifecycle: Modicon M580 and 340, EcoStruxure Control Expert, EcoStruxure Process Expert (Unity Pro) and more.
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send InviteCancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
For example I like to have my alarms in a DDT so I can have easy to read names for each alarm. I then want to read this structure from HMI/SCADA so a %M variable is needed for each alarm. (my SCADA isn't great at extracting bits from a %MW but that is another story).
This is how I do it now and that might not be the nicest way at all so that is why I would like others comments and ideas on this 🙂 I create two equal size arrays as the DDT, one EBOOL and one BOOL (since the DDT elements isn't accessible by a number/index too which I sometimes wished also but that too is another story).
I then give both the DDT and the BOOL array the same %MW start address making the %MW address the "glue" between those two data structures. The EBOOL array gets an %M start address. I then use a FOR loop in ST and loop through each BOOL array element and copies the value to the EBOOL array. This creates a one way copy of a BOOL DDT structure as an EBOOL array where %M addressing is possible. I might mention that my ST loop can have per alarm conditions too like blocking or delay as I thought this was a good place to do that too at.
The downside to my approach is that is is not directly clear what %M address a specific alarm in the DDT has, you have to count the BOOLs in the DDT. Second is that this approach is not a very efficient workflow if you have to do it with more BOOL DDTs, maybe one of these per project could be ok but I can't imagine doing it with many. Third it is one way which is fine for alarms. And last, it is not that obvious why and how it works for someone else looking at this code as it is what I consider a "workaround".