How to Transfer Input Data to a User Defined Type (UDT) with Specific Bit Selections

Question:

I am in need of assistance as I am experiencing tunnel vision and struggling to remember the process. I have an 8-point input card and an 8-point output card, and I am attempting to transfer the data into a User Defined Type (UDT) with elements labeled Input and Output. Currently, I am facing challenges with invalid data types. I understand that the copy function duplicates elements and BTD copies individual bits, but I am having difficulty recalling the specific method I have used in the past. The issue lies in the fact that I am not simply copying data point by point; I specifically require bits 4-8 from the input card and bits 0-5 from the output card. Therefore, I need to be able to designate a source bit for the transfer process. Any assistance in resolving this issue would be greatly appreciated.

Top Replies

I've decided to utilize BTD to separate the IO into two distinct tags for inputs and outputs, rather than attempting to use a single INT. This way, I can avoid the hassle of selecting a specific source bit when copying to my UDT. This adjustment ensures a smoother copy instruction process.

In a recent conversation, patrickmoneyy mentioned a more efficient approach to organizing inputs and outputs within BTD, suggesting the use of separate tags for inputs and outputs instead of a single INT. This results in easier mapping of IO, with specific UDTs created for each device type like Pumps, Tanks, and Conveyors, each holding booleans for common IO functions. By utilizing simple XIC OT E combinations for mapping modules, technicians benefit from easily identifying the state of each function. This method not only speeds up development by simplifying the cut-and-paste process for new mappings but also serves as a sanity check during coding. Additionally, this system facilitates cross-referencing without the hassle of scrolling through long lists of controller tags, making it a convenient solution for efficient programming.

Certainly, in hindsight, it would have been more practical to assign one byte for input and one byte for output in my User-Defined Type (UDT) and utilize dedicated 8-point cards for my IO operations, enabling a simple 1-1 copy process. However, I was hesitant to rearrange wires and incorporate an additional input card. Despite encountering a temporary setback, I was determined to find a solution, even if it meant not choosing the most efficient approach.

patrickmoneyy is seeking assistance with a specific I/O issue they are facing. They have an 8-point input card and an 8-point output card, and they are attempting to transfer the data into a User Defined Type (UDT) with elements labeled as Input and Output. However, they are encountering difficulties with invalid data types. While they are aware of the functions of the "copy" and "BTD" commands, they are struggling to recall the precise method for achieving their desired outcome. The crux of the issue lies in their need to selectively copy certain bits from the input and output cards, specifically bits 4-8 from the input card and bits 0-5 from the output card. This requires the ability to designate a source bit for the transfer process. They are hopeful that someone can aid them in overcoming this obstacle.

JeremyM inquired about the specific Input/Output (IO) configuration for a Kinetix 5100. In a situation where the controller couldn't be upgraded to support the Add-On Profile (AOP), I was working on setting up hard-wired inputs and outputs. Considering exploring messaging as an alternative solution for the application, although I haven't delved into it much yet. It should be an exciting learning opportunity if feasible.

It sounds like you're having quite a bit of trouble. If I'm understanding correctly, you're trying to transfer specific bits from your input and output cards to your User Defined Type (UDT). One way to approach this could be by using the 'GET' and 'PUT' instructions, which allow you to specify both the source and destination for individual bits. This method might require some more manual configuration since you're not dealing with contiguous bits, but it should work for what you're trying to achieve. You can use 'GET' to pull bits from both the input and output, placing them into temporary M bits, then 'PUT' to organize these in your UDT. I hope this helps or at least points you in the right direction!

I'd suggest checking your data types, particularly the UDT ones. Ensure that they match what's expected from your input and output cards. You might be dealing with different data types hence causing the incompatibility. Furthermore, since you're trying to specify the bits you need from your input and output card, a MOV instruction could be suitable here as they can take a specific bit of data and move it to another location. If you're using PLC, that instruction could be your solution.

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. How can I transfer input data to a User Defined Type (UDT) with specific bit selections?

Answer: - You can achieve this by utilizing the copy function to duplicate elements and BTD to copy individual bits. Remember to designate the specific source bits for the transfer process, such as bits 4-8 from the input card and bits 0-5 from the output card.

FAQ: 2. What are some common challenges faced when transferring data to a UDT with specific bit selections?

Answer: - One common challenge is dealing with invalid data types during the transfer process. It's important to ensure that your data types align correctly to avoid issues.

FAQ: 3. How can I overcome difficulties in recalling the method for transferring data to a UDT with specific bit selections?

Answer: - You can review your past methods and approach, focusing on the use of copy functions and bit selection techniques. Additionally, documenting your process can help in remembering and replicating the method in the future.

FAQ: 4. Why is it important to specify the source bits for the transfer process when working with UDTs and specific bit selections?

Answer: - Specifying the exact source bits helps ensure that you are transferring the correct data points according to your requirements. It allows for precise extraction and assignment of bits from different input and output sources.

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  â†’