Control from UI Builder

Information and discussion regarding the ACE PackXpert software

Control from UI Builder

Postby duncan » Mon Feb 23, 2015 8:44 pm

Hi all,

I am using UI Builder for a product selection screen on a PackXpert install. Is there an easy way to adjust the z-height of a PackXpert place operation from UI Builder?

Potentially related, I also need to issue a retry command to an IO Feeder which has stopped, and would like to do this from UI Builder rather than ACE.

I'm sure other requirements will arise, where is the best place to look for this info? Online help, or one of the user guides?

Thanks for any advice!

Duncan
duncan
 
Posts: 11
Joined: Mon Jun 09, 2014 6:11 pm

Re: Control from UI Builder

Postby duncan » Tue Feb 24, 2015 5:22 pm

The ACE Reference guide is quite helpful for this, but still took me a few goes to get it running cleanly.
Have attached final code below in the hope that it might be helpful for someone.

Code scans all processes looking for a particular target name, then adjusts the Z-Axis offset by 10mm for that target.
Code also included to set a fixed z-height rather than using an offset.

Cheers
Duncan
-----
Code: Select all
private void button2_Click(System.Object sender, System.EventArgs e) {
   Trace.WriteLine("button2.Click Event Handler");
   IAceObject part, target;
   IProcessManager manager = (IProcessManager) ace["/Process Manager"];
      
   foreach (IPartProcess partProc in manager.Processes){
      part = partProc.PickConfiguration.SinglePickPart as IAceObject;
      target = partProc.PlaceConfiguration.SinglePlaceTarget as IAceObject;

      // Find a specific configuration item: The "Place Motion Parameters" for a robot picking the part "/Part" and placing at "/Target"
      IConfigurationItemMotionSequence placeSequence = manager.ConfigurationItems.GetMatchingConfigurationItem("Place Motion Parameters", robot1, part, target) as IConfigurationItemMotionSequence;
   
      Trace.WriteLine("");
      Trace.WriteLine("Part: " + part.Name);
      Trace.WriteLine("Target: " + target.Name);
   
      string partToFind = "Target Clip";
      if (target.Name.Contains(partToFind))
      {
         Trace.WriteLine("Found!");
         Trace.WriteLine("Pos: " + placeSequence.PositionOffset);
         
         // Adjust position by 10mm in z-axis
         placeSequence.PositionOffset = placeSequence.PositionOffset.Shift(0,0,10);
         Trace.WriteLine("Pos: " + placeSequence.PositionOffset);

         /* This section sets a fixed z-height rather than applying an offset
         // Modify Z coordinate
         double[] placePos = placeSequence.PositionOffset.ToArray();
         placePos[2] = 190;
         
         // Update position
         Transform3D placeNew = new Transform3D(placePos[0], placePos[1], placePos[2], placePos[3], placePos[4], placePos[5]);
         placeSequence.PositionOffset = placeNew;            
         Trace.WriteLine("Pos: " + placeSequence.PositionOffset);
         */

         // Trigger an update so it is written to the controller
         placeSequence.IsModified = true;

      }
   }
}
      
duncan
 
Posts: 11
Joined: Mon Jun 09, 2014 6:11 pm


Return to ACE PackXpert

Who is online

Users browsing this forum: No registered users and 1 guest