I have a situation where, there are multiple stations and I have to send the part to the empty station. I have written the stations in the table and have to write a method where the stations is checked in a loop if it is empty or occupied and the parts is sendto the empty station. How I can set the method for the inspection of the table '?
Solved! Go to Solution.
Maybe something like this
-- walk through table and move MUOBJ to the first empty station (if any) for local row := 1 to TABLEOBJ.yDim loop if TABLEOBJ[1, row].empty then if not MUOBJ.move(TABLEOBJ[1, row]) then debug; end; exitLoop; end; next;
Assuming the values are within the table as you said then the following should work.
var lowestTime: Time := -1 var tableRow: Integer := -1 for var row := 1 to tableObj.YDim if row = 1 OR tableObj[2, row] < lowestTime lowestTime := tableObj[2, row] tableRow := row end next
At the end 'tableRow' will point to the row in the table with the lowest time and 'lowestTime' will tell you what that time is.