Greetings everyone. I have a specific program in my PLC routine that involves storing position registers and then utilizing them with the Case operand. I am unsure if it is feasible, but I am interested in being able to position the robot along the Y and Z axes, press a button on the panelview, and automatically load the current encoder values to these registers. Is there a solution to achieve this considering that Ycmd and Zcmd are temporary storage registers that are manipulated in the PLC program for positional movements? For instance, I envision a scenario where I move the robot to a desired position, press a button, and have it load, let's say, Case 2: Ycmd and Zcmd registers with the current encoder position. I am struggling to come up with a method to instruct the system to save these two registers within a specific case. I hope this explanation is clear. Thank you.
Convert Ysave and Zsave into global arrays. Transfer the Yencoder and Zencoder values to Ysave[0] and Zsave[0] when button "0" is pressed. Repeat this process for buttons "1," "2," and so on. Update the Ncode to the following format: Code: IF N is between -1 and Ncountmax THEN Ycmd will equal Ysave[N] Zcmd will equal Zsave[N] COP(RobotTextMessages[N-1], HMI.RobotPosString, 1) END_IF
Thank you for responding. I was wondering if the case number can function as a tag on its own, but upon reflection, I realize it may not be the most thoughtful question. It could lead to confusion, especially if another case operand is used in a different routine, causing uncertainty about which case is being referenced.
drbitboy recommended transforming Ysave and Zsave into global arrays for better accessibility. When button "0" is pressed, the current Yencoder and Zencoder input values should be transferred to Ysave[0] and Zsave[0], respectively. This process should be repeated for buttons "1," "2," and so on. This adjustment will simplify the code structure. For instance, the following code snippet indicates that if N is within a certain range, Ycmd and Zcmd will be assigned values from Ysave[N] and Zsave[N] respectively. Additionally, a conditional statement is used instead of a CASE statement for increased efficiency. This modification also allows for the utilization of the placeholder "N" in place of specific tags.
Hello! The scenario you're describing seems entirely achievable. You'll need a conditional statement within your PLC program to trigger when the button on the panelview is pressed. Once that condition is flagged, you should be able to execute a command that saves the current values of Ycmd and Zcmd to the desired position registers, essentially snapshotting their values at that moment. This could be coded within the Case 2 structure by having a copy function tied to your trigger condition, i.e., the button press. Make sure to perform adequate testing to ensure everything works as expected. It might be useful to add some fail-safes or warnings for scenarios wherein the button is pressed unintentionally or at an undesired position. Let me know if this helps or if you have other questions!
Sure, it sounds like you're on the right track. You would need to assign a button in your PanelView that is tied to a bit in the PLC. When this bit is true, it could trigger a routine that copies the Y and Z encoder values into spare registers. Next, you can use a Move instruction to place these encoder values into your Case 2 positions. Essentially, the button prompts the PLC to store the encoder values at that moment, and later on, those values can be called upon for positioning. Remember to reset the bit after each usage to avoid continuous copying of values.
✅ 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: - To save encoder values to specific cases in Logix Designer, you can utilize the Case operand in your PLC program. By defining the logic to store the current encoder values into designated registers when a specific condition is met, you can achieve the functionality you described.
Answer: - Yes, it is feasible to automatically load encoder values to position registers upon pressing a button on the panelview by implementing the necessary logic in your PLC program. You can define the sequence of actions to capture and store the encoder values when the button is pressed.
Answer: - You can store encoder values within specific cases for positional movements in a robot system by designing your PLC program to handle the capture and storage of encoder values based on predefined conditions or triggers. By associating the encoder values with the desired cases, you can achieve the functionality you are looking for.
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.