Efficient Data Handling in AB Logix5000 with Ladder Logic and User-Defined Data Types

Question:

As a Siemens user, I am delving into my initial AB program project. The client has requested the use of Ladder logic for all programming tasks. I am faced with the challenge of handling a significant amount of data, specifically 3 integers worth of boolean values, which are being extracted from a set of non-concurrent words received via the bus. These words need to be broken down into individual boolean operators. While I am aware that I could manually convert each word bit into a local argument through a ladder run or directly use the boolean operator from the word, I am considering creating a User-Defined Data Type (UDT) structure to streamline the process. However, I am unsure if this is achievable in AB programming. Initially, I explored using BTD to retrieve and organize the words, but it seems to be incompatible with UDT type placement. I also considered utilizing a COP instruction, which works efficiently for individual words but falls short when dealing with 3 words. I attempted to create an array of words, transform my non-concurrent words into a concurrent format, and then use the COP function to transfer them into the UDT structure. Unfortunately, COP rejected being assigned to the header of the array instead of a direct array address. Is there a method or technique that I have overlooked in accomplishing this task efficiently in AB programming?

Top Replies

It seems like you are heading in the right direction. If your User-Defined Type (UDT) includes 96 BOOL variables, you should be able to efficiently copy data using ARRAY[0] as the Source and the name of the UDT instance as the Destination with a Length of 1. (In this case, ARRAY refers to a DINT[3] array, and ARRAY[0] is the initial DINT value in the array.) This approach can help streamline your programming and optimize data transfer processes.

To copy the first 48 (96?) bits of the_array[0], the_array[1], and the_array[2] to the_udt, with the assumption that the UDT consists of 3 words, you can use the following code: Code:COP the_array[0] the_udt 1. This operation will transfer the specified data seamlessly.

Utilizing structured text for this task could be effective, but the customer specifically requests all information to be formatted in a ladder logic. In the ladder instruction related to COPy, I am able to indicate a length, but cannot determine a destination location if my User-Defined Type (UDT) is defined using individual BOOLS. It is possible that I may be misinterpreting your guidance. If it were possible to specify a destination address with the COPy function, this solution could potentially be successful.

Could you demonstrate a segment of your program in which you attempted to implement the concepts you discussed? Thank you.

In response to CM3's request for structured text, it is possible to provide ladder logic format as preferred by the customer. The data copied by a COP instruction is dependent on the destination data type. For example, if the destination is a 3 DINT long UDT, it will copy 3 DINTs of data starting at the Source (and repeating if Length is greater than 1). Specific members of the UDT do not need to be specified unless only a portion of the UDT needs to be copied.

Have you considered using Structured Text (ST) programming? While AB platforms tend to dominate with Ladder Logic, they do also effectively support ST coding which can handle large data and complex computations efficiently. This could potentially solve your problem, as you can manipulate the whole block of data directly, without requiring intermediate steps. It's true, Ladder Logic might still be necessary for certain elements of your programming as per the client's request, however, for this specific challenge, moving to ST, even briefly, could prove expedient.

I'd suggest looking into utilizing Structured Text (ST) programming in your AB project, if it isn't strictly ladder logic. ST should provide you the flexibility you need to handle multiple boolean values and conducting data manipulation at ease. With ST, you can easily access individual bits and perform operations much like in a high level language. If ladder logic is mandatory, creating a UDT structure and managing it through ladder is not the most effective way. Instead, I propose a solution using masking and moving functions. Using the Masked Move (MVM) or the Mask, Move Integer (MMI) instruction might simplify your task as you can apply a mask over your bits in each of the words and then move them as you need. Remember though, in the AB world, it's all about how efficiently you can handle your data rather than which fancy feature you are using.

It sounds like you're running into some classic challenges when transitioning to ladder logic and dealing with data structuring! Have you considered breaking down the process into smaller steps? Instead of trying to manipulate everything using UDTs right off the bat, maybe start by using a simple array of integers for your boolean values and process each word individually. Once you’ve extracted the boolean data, then you could populate your UDT for better organization later on. Also, while the COP instruction can be a bit restrictive, using a combination of MOV or BTD functions to handle your individual bits may simplify your data management. Sometimes, tackling it piecemeal can make everything feel less overwhelming!

More Replies →

Streamline Your Asset Management
See How Oxmaint Works!!

✅   Work Order Management

✅   Asset Tracking

✅   Preventive Maintenance

✅   Inspection Report

We have received your information. We will share Schedule Demo details on your Mail Id.

To add a comment, please sign in or register if you haven't already..   

Frequently Asked Questions (FAQ)

FAQ: 1. FAQ: Is it possible to use User-Defined Data Types (UDT) in AB Logix5000 programming to streamline data handling processes?

Answer: Answer: Yes, it is possible to utilize UDT structures in AB Logix5000 programming to streamline data handling tasks. UDTs can help organize and manage complex data structures efficiently.

FAQ: 2. FAQ: How can I efficiently handle a significant amount of data in AB Logix5000 when dealing with multiple integers worth of boolean values?

Answer: Answer: One approach could be to create a UDT structure that represents the data in a logical and organized manner. By using UDTs, you can simplify data handling tasks and improve code readability.

FAQ: 3. FAQ: What are some challenges faced when trying to use ControlLogix instructions like BTD or COP with User-Defined Data Types (UDT) in AB Logix5000 programming?

Answer: Answer: Some ControlLogix instructions like BTD may not be compatible with UDT type placement, and certain instructions like COP may have limitations when dealing with complex data structures. It's important to explore alternative methods or techniques to overcome these challenges.

FAQ: 4. FAQ: Are there any alternative methods or techniques for efficiently handling and transforming non-concurrent words into a UDT structure in AB Logix5000 programming?

Answer: Answer: One possible approach could be to explore different data manipulation techniques or consider breaking down the data into smaller chunks before transferring them into a UDT structure.

Ready to Simplify Maintenance?

Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.

Request Demo  â†’