Hello everyone, I need assistance with my CompactLogix processor for my robot cell. Operators are required to place a faulty part into the machine every 200 cycles to ensure the quality check cameras are functioning properly. I want to display on the C-More HMI when the last sensor check passed, with the time being updated by the PLC automatically. I am currently using a GSV to store the date and time values in an array format. How can I concatenate these array elements with text to display the last sensor check passed time on the HMI? I am looking for a solution that doesn't involve multiple individual text boxes for each date and time component. Any suggestions would be greatly appreciated. Thank you!
One effective method is to create the complete text within the PLC and utilize a dynamic text object for its presentation. This approach can streamline the efficiency of text generation and display in the system.
A potential solution is to create the complete text within the Programmable Logic Controller (PLC) and then utilize a dynamic text object to showcase it. I was considering this approach as well, but I am unsure about the implementation process. Are there any suggestions, examples, or screenshots available to guide me through this task?
Consider using the CONCAT instruction to join strings together efficiently. To optimize memory usage, you can define smaller custom STRING types. Convert each time array value to a STRING using DTOS and incorporate constant values like slash and colon. Finally, merge all these elements into a single string.
I successfully managed to make it work, although the process was a bit rudimentary. In case others are facing a similar issue, I utilized DTOS to transfer values to a string (such as DAY, MONTH, YEAR, etc.) individually. Additionally, I created separate strings for characters like "Slash", "Space", "At", and so on. By using about 10 lines of code with CONCAT, I concatenated these strings together, generating a longer string each time. It may take some time to build, but you can observe the string length increasing gradually. This particular date/time string required the creation of 11 temporary strings before reaching the final result. Once the desired string is obtained, navigate to the HMI program and ensure to add it as a tag in the tag database, setting it as 82-character ASCII. The Dynamic Text box should be activated by a constantly active element, like "SYSTEM_BIT_ALWAYS_ON". Although the process may seem perplexing, it effectively achieves the goal. Furthermore, the displayed format is in military time, rather than AM/PM. It would be beneficial if Allen-Bradley provided some pre-written code to capture date/time values and seamlessly transfer them to an HMI for presentation. Displayed on the screen is the following:
nutcase511 mentioned that they were able to get it working, albeit in a slightly crude manner. In case others encounter a similar issue, they used DTOS to transfer values to a string (such as DAY, MONTH, YEAR, etc) for each item. Additional strings were created for characters like "Slash," "Space," and "At." Approximately 10 lines of code were used to utilize CONCAT and merge the strings together, with the output going to a new string each time. It may take some time to assemble, but you can observe the string length increasing gradually. In this case, a total of 11 temporary strings were utilized to construct the final date/time string. Once the desired string is obtained, it should be added as a tag in the HMI program by accessing the tag database, setting it as an 82-character ASCII type, and ensuring that the Dynamic Text box is activated by a constant element, like "SYSTEM_BIT_ALWAYS_ON". Although the process may be perplexing, it does yield results. It is worth noting that the displayed time format is in military time, rather than AM/PM. Suggestions were also made for Allen-Bradley to offer pre-made code for capturing date/time values and easily transmitting them to an HMI for presentation. Looking ahead, the query was posed regarding whether there is a more streamlined method for concatenating multiple strings, using fewer code rungs. Is it possible to consolidate the process, similar to Source A and Source B, by expanding to include more alphabet letters?
Hi, one method you could consider is using the STRING data type on the CompactLogix PLC to construct your text message within the PLC itself and read that on your HMI. You can use 'Copy' instruction to compose your string piece by piece. For instance, you first copy your static text part such as "Last Sensor Check at", then append the date, a space, and then the time. Avoid any format conversion on the HMI side. Instead, have the PLC handle the conversion of your date and time values to strings before passing them to the HMI. This way you get a single tag that contains your whole message. Hope this helps!
Hey there! You could potentially create a string in the PLC that has the desired format, then update that string whenever your check passes. Then, you'd only need a single text box on the HMI to display that string. Using the "CONCAT" instruction, you can join your array elements with text directly into one fully formatted date/time string. Remember to ensure that your string has sufficient length to accommodate the concatenated strings. Subsequently, retrieve this composed string and display it on your HMI. I hope this helps!
✅ Work Order Management
✅ Asset Tracking
✅ Preventive Maintenance
✅ Inspection Report
We have received your information. We will share Schedule Demo details on your Mail Id.
Answer: Answer: To display the last sensor check passed time on a C-More HMI using array concatenation, you can concatenate the array elements containing the date and time values with text to create a single string that represents the last sensor check passed time.
Answer: Answer: Yes, you can update the last sensor check passed time on the HMI automatically using a PLC by storing the date and time values in an array format and then concatenating them with text to display on the HMI.
Answer: Answer: You can avoid using multiple individual text boxes by concatenating the array elements containing the date and time values with text to create a single string that represents the last sensor check passed time on the HMI. This approach allows you to display the information in a more organized and concise manner.
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.