How to Design and Create a USI_OTMS_Controller for Handling Lotpacking Information
Design: Controller Creation: Create a controller named 'USI_OTMS_Controller'. Add two new TCP Drivers, one as 'TCP SERVER' and the other as 'TCP CLIENT'. Refer to User Story 287266: '[IoT-Baymax] Baymax Baseline' for other configurations.
Workflow Creation: Configure setup: basic TCP/IP communication parameters. Add a workflow to receive Lotpacking information. During the parsing process, extract the third 'step' field to determine the message type. If 'step'=2, After receiving device data, parse the second field as the 'material name'. Find the 'material object' in the system based on the 'material name'. Find the 'Product Group' and 'Step' to which the 'material' belongs. Determine if the 'material' is a 'lot', 'panel', or 'piece' (based on the 'Form' parameter of the 'material': 'Lot', 'Panel', 'Board') for concatenating the return value. (The 'M' in the cavity attribute represents 'Lot', 'P' represents 'Panel', and 'B' represents 'Piece', but this attribute is not currently parsed.) LOT: Find the 'Lot material' corresponding to the 'PanelSN' in the message and determine the 'system state' of the 'material'. Find the current 'step' based on the 'material' and find the 'resource list' under the 'step'. Determine if the 'resource list' contains the 'resource' corresponding to 'EQID'. If not, log the exception to the 'iot log'. If yes, proceed with the following steps. If it is in the 'queue' (not 'Dispatched'): Find the 'Baking resource' corresponding to the 'Baking device' in the current 'line', and 'dispatch' and 'track' the 'material' to the 'Baking resource'. If it is 'Dispatched' (not 'Trackin'): Find the 'Baking resource' corresponding to the 'Baking device' in the current 'line', and 'track' the 'material' to the 'Baking resource'. If it is 'in process' (already 'Trackin'): Find the 'Lot material' corresponding to the 'PanelSN' in the message and 'trackout&movenext' the 'material'. If it is 'processed' (not 'movenext'): Find the 'Lot material' corresponding to the 'PanelSN' in the message and 'movenext' the 'material'. The 'panels' under 'LOT' also need to go through the 'stations' with the 'lot'. PANEL: Find the 'Panel material' corresponding to the 'PanelSN' in the message and determine the 'system state' of the 'panel material'. If it is not 'Trackin', continue to determine the status of its 'parent material' ('lot material'): If the 'lot material' is not 'trackin': Find the 'Baking resource' corresponding to the 'Baking device' in the current 'line', and 'dispatch' and 'track' the 'material' to the 'Baking resource'. 'Trackin' the 'panel material' as well. If the 'lot material' is already 'trackin': 'Trackin' the 'panel material'. If it is already 'Trackin', 'trackout' the 'panel material' first, then check if all 'submaterials' under the 'parent material' ('lot material') have been 'trackout': Yes: 'Trackout' the 'lot material'. No: Do not perform any operation. PIECE: Same as 'panel', because there is no 'panel hierarchy' at this point, meaning the 'parent' of the 'board material' is the 'lot material' (not developed in this stage). Concatenate the format of the returned 'message' and reply to the corresponding 'message' (not developed in this stage, directly forward the value returned by the 'server' to the 'device'). If 'step'=7, (not processed in this stage, directly forward the 'server's return value' to the 'device'). After receiving 'device data', parse the second field as the 'material name'. Find the 'material object' in the system based on the 'material name'. Find the 'Product Group', 'Step', 'Product', and 'Production Order' to which the 'material' belongs. Concatenate the format of the returned 'message' and reply to the corresponding 'message'. After replying to the 'message', the 'device information' needs to be forwarded to the 'USI server' through another 'driver'.
原文地址: https://www.cveoy.top/t/topic/piS7 著作权归作者所有。请勿转载和采集!