Port Flows
Putaway Process with Task Interface
//Open the port with empty bin content code
taskApi.openPort(port_id, new List<int>() { emptyBinContentCode });
//Do this as long as we are putting away
while (putaway)
{
//Open bin, we are not using any parameters so AutoStore
//decides what empty bin to bring from the empty bin content code
var selectedBin = taskApi.openBin(port_id).parameters.bin_id;
do
{
//For this example i am using a query, it is recommended to
//use LogPublisher to monitor bin states and more.
var binStateResponse = taskApi.getBinState(selectedBin);
}
//Wait til the bin is open in correct port
while (!(binStateResponse.parameters.bins.bin[0].bin_mode == "O"
&& binStateResponse.parameters.bins.bin[0].port_id == port_id));
//Put content into the bin, enter to continue when finished
Console.ReadKey();
//Close bin, with a non empty bin content code
taskApi.closeBin(port_id, selectedBin, null, notEmptyBinContentCode);
}
//Close port when we finish putaway
taskApi.closePort(port_id);Picking Process with Task Interface
//Create taskgroups for atleast 30 minutes of operation and give 30 minutes to prepare
//Open the port in the category you want to pick from
taskApi.openPort(port_id, null, new List<int>() { category });
//Do this as long as we are picking
while (picking)
{
//Open bin, we are not using any parameters so AutoStore
//decides what task to bring from the selected category
var openBinResponse = taskApi.openBin(port_id);
do
{
//For this example i am using a query, it is recommended to
//use LogPublisher to monitor bin states and more.
var binStateResponse = taskApi.getBinState(openBinResponse.parameters.bin_id);
}
//Wait til the bin is open in correct port
while (!(binStateResponse.parameters.bins.bin[0].bin_mode == "O"
&& binStateResponse.parameters.bins.bin[0].port_id == port_id));
//Pick content from the bin, enter to continue when finished
Console.ReadKey();
//Close bin with bin id and task id to remove the task from the system
taskApi.closeBin(port_id, openBinResponse.parameters.bin_id, openBinResponse.parameters.task_id);
//Replenish a taskgroup if we have finished what we worked on
if (taskgroupEnd)
{
taskApi.createTaskgroup(taskgroup_id, category, DateTime.Now.AddMinutes(30),
priority, new List<task>() { new task(task_id, bin_id) });
}
}
//Close port when we finish picking
taskApi.closePort(port_id);Inserting bins through an AutoStore port with Task Interface
//Open the port in mode INSERT
taskApi.openPort(portId,null, null, null, "INSERT");
//Do this as long as we are inserting bins
while (insertingBins)
{
//Place the bin in the port, click enter when it is safe to insert
Console.ReadKey();
//Insert bin to the grid, if bin is allready created
//you only need to pass portId and binId
taskApi.insertBin(portId, binId, contentCode, binType);
}
//Close port when we finish inserting bins
//Very important in port mode INSERT as robots
//will buffer at port and wait "forever"
taskApi.closePort(portId);Updated 2 months ago