viewof isa_level = Inputs.select(["Level 0: Field Devices","Level 1: Control","Level 2: SCADA","Level 3: MES","Level 4: ERP"], {label: "ISA-95 Level", value: "Level 1: Control"})
viewof isa_function = Inputs.text({label: "Function/Operation", placeholder: "e.g., Motor speed control", value: "Motor speed control"})
viewof isa_latency_ms = Inputs.range([0.1, 10000], {value: 5, step: 0.1, label: "Actual latency (ms)"})
{
const latency_requirements = {
"Level 0: Field Devices": {max:1, typical:0.5, color:"#16A085", name:"Field"},
"Level 1: Control": {max:10, typical:2, color:"#16A085", name:"Control"},
"Level 2: SCADA": {max:100, typical:50, color:"#E67E22", name:"SCADA"},
"Level 3: MES": {max:1000, typical:500, color:"#2C3E50", name:"MES"},
"Level 4: ERP": {max:60000, typical:10000, color:"#7F8C8D", name:"ERP"}
};
const req = latency_requirements[isa_level];
const is_compliant = isa_latency_ms <= req.max;
const is_typical = isa_latency_ms <= req.typical;
const c = {navy:"#2C3E50", teal:"#16A085", orange:"#E67E22", blue:"#3498DB", gray:"#7F8C8D", red:"#E74C3C"};
return html`<div style="font-family:Arial;padding:20px;background:#f8f9fa;border-radius:8px;border-left:4px solid ${req.color}"><div style="color:${c.navy};margin-top:0;font-size:1.1em;font-weight:bold">ISA-95 Latency Validator</div><div style="background:white;padding:20px;border-radius:6px;margin-top:15px"><div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:20px"><div><div style="color:${c.gray};font-size:0.85em">Selected Level</div><div style="color:${req.color};font-size:1.5em;font-weight:bold">${isa_level}</div><div style="color:${c.gray};font-size:0.85em;margin-top:5px">Function: ${isa_function}</div></div><div style="text-align:right"><div style="color:${c.gray};font-size:0.85em">Your Latency</div><div style="color:${is_compliant?c.teal:c.red};font-size:1.5em;font-weight:bold">${isa_latency_ms.toFixed(1)} ms</div></div></div><div style="margin:20px 0"><div style="display:flex;justify-content:space-between;margin-bottom:8px"><span style="color:${c.gray};font-size:0.85em">Latency Range</span><span style="color:${c.gray};font-size:0.85em">Max: ${req.max} ms</span></div><div style="height:30px;background:linear-gradient(to right,${c.teal},${c.orange},${c.red});border-radius:4px;position:relative"><div style="position:absolute;left:${Math.min((isa_latency_ms/req.max)*100,100)}%;top:-5px;width:3px;height:40px;background:${c.navy};border-radius:2px"></div><div style="position:absolute;left:${(req.typical/req.max)*100}%;top:-8px;height:46px;border-left:2px dashed white"></div></div><div style="display:flex;justify-content:space-between;margin-top:8px"><span style="color:${c.teal};font-size:0.75em">0 ms (ideal)</span><span style="color:${c.orange};font-size:0.75em">${req.typical} ms (typical)</span><span style="color:${c.red};font-size:0.75em">${req.max} ms (max)</span></div></div><div style="margin-top:20px;padding:15px;background:${is_compliant?'#d4edda':'#f8d7da'};border-radius:6px;border-left:4px solid ${is_compliant?c.teal:c.red}"><div style="display:flex;align-items:center;gap:10px"><div style="font-size:2em">${is_compliant?'✓':'✗'}</div><div><strong style="color:${c.navy}">${is_compliant?'COMPLIANT':'NON-COMPLIANT'}</strong><div style="color:${c.gray};font-size:0.9em;margin-top:5px">${is_compliant?(is_typical?`Latency is within typical range for ${req.name} level operations.`:`Latency meets maximum requirement but exceeds typical ${req.typical}ms. Consider optimization.`):`Latency of ${isa_latency_ms.toFixed(1)}ms exceeds ${req.max}ms maximum for ${req.name}. This function must be moved to a higher ISA level or latency must be reduced.`}</div></div></div></div></div><div style="margin-top:15px;padding:12px;background:white;border-radius:6px;font-size:0.85em;color:${c.gray}"><strong style="color:${c.navy}">ISA-95 Requirements:</strong><br>Level 0-1 (Field/Control): <1-10ms | Level 2 (SCADA): <100ms | Level 3 (MES): <1s | Level 4 (ERP): minutes-hours</div></div>`;
}ISA-95 Latency Validator
ISA-95 Latency Validator
Try Change ISA-95 Level and Actual latency (ms) to compare latency requirements.
Observe After pressing Calculate latency compliance, watch compliance and the latency range as Actual latency (ms) changes.
Explain Explain why ISA-95 Level changes the maximum latency requirement.
Technical boundaries. Compliance compares actual latency with fixed maximum and typical values for each level. Function text does not change these requirements.
NoteISA-95 Latency Validator
Validate whether your system’s latency meets ISA-95 requirements.