"Take one and put down the other" is used in multi-variety machine tools

Hello, I would like to achieve the goal of AGV for "Take one and put down the other" of multi-variety machine tools (the same machine tool can process multiple parts, but they are not processed simultaneously). How can this be accomplished? 
At present, I can achieve the goal of "one pick-up and one placement" for AGVs in processing machines of a single type.

Operation method(Utilizing "Gantt Chart")

  • AGV(capacity:1/2) - Task selection mode: The nearest pending task of resources
  • Machine Gantt Chart: Transform(Part 1—Part2)---> Load 2(Part 1) ---> Unload 1(Part2) --->Unload 2(Part 1) --->buffer(Part 1)--->Transform(Part 1—Part2)---> ...circulation
  • Machine connection buffer configuration: Workpieces for unload 2

Detailed operation steps can be found in the video:

This is the original document:

A little pity.Unable to meet the requirements of flexible manufacturing for machine tools.

Meanwhile, I also tried this method,but I feel this method is not very reliable, especially when there are multiple machines in the factory.

Operation method(Utilizing logical control)

  • AGV - Task selection mode: The nearest pending task of the resources
  • Machine tool - transform1(When the activity ends)
     SG_MachineActiveT1=1
  • Gantt chart of the connection machine for the machine : Load 1 - Transfer 1 (same type of workpiece)(At the start of the operation)
     if(SG_MachineActiveT1 == 1)
     {
     S_StartActivity=false
     }
     else
     {    
     S_StartActivity=true
     }
  • AGV Decision Zone - Unload( At the beginning of the activity)
     SG_MachineActiveT1 = -1
     U_T1\\S_StartActivity=true

Detailed operation steps can be found in the video:

This is the original document:

Thank you for your help!