📄 Build Check 15/7/2025

SIW : Build Check


Review date: 15/07/2025

ER Diagram

Andon Chart (MES Core)

Data Flow 


Scheduling

จะขึ้น Schedule ID Row ใหม่ ทุกๆ 00:00, 04:00, 12:00, 20:00 ของทุกวัน โดยใช้ Gateway Event

Production Run

* Production Run จะขึ้น Row ใหม่ทุกๆ 1 ชั่วโมง โดยใช้ Gateway Event

*ผมจะ execute script ทุกๆ 1 ชั่วโมง 

โดยถ้าเป็นช่วงเวลา 00:00, 04:00, 12:00, 20:00 จะให้ขึ้น schedule id ใหม่ก่อนแล้วค่อย ขึ้น run id ใหม่

ถ้าเวลาอื่นๆจะขึ้นแค่ run id ใหม่

เพื่อใช้สำหรับการลำดับการ execute script

State History


* Script ของ State History



* State History จะขึ้น Row ใหม่เมื่อ Tag Change โดยใช้ Tag Change Script

States


Code สำหรับการ Query Machine State Timeline

SELECT
start_datetime as fromDate,
end_datetime as toDate,
state_name as reason,
color_hex as color
FROM state_history
INNER JOIN states
ON state_history.state_code = states.state_code
INNER JOIN line
ON state_history.line_no = line.line_no
WHERE
state_history.line_no = :line_no
AND start_datetime > '2025-07-06'
AND end_datetime <= '2025-07-08';

เมื่อลอง Query จะได้ Output เป็น


จากนั้นก็นำมา Binding Machine State Chart


SCW

ER Diagram

Data Flow