viewof digitalInputs = Inputs.range([0, 10000], {
value: 500,
step: 10,
label: "Digital inputs (1 bit each):"
})
viewof digitalOutputs = Inputs.range([0, 10000], {
value: 300,
step: 10,
label: "Digital outputs (1 bit each):"
})
viewof analogInputs = Inputs.range([0, 1000], {
value: 100,
step: 5,
label: "Analog inputs (16-bit each):"
})
viewof analogOutputs = Inputs.range([0, 1000], {
value: 50,
step: 5,
label: "Analog outputs (16-bit each):"
})
viewof targetCycle = Inputs.range([0.1, 100], {
value: 1,
step: 0.1,
label: "Target cycle time (ms):"
})
// Calculate total data per cycle
digitalBits = digitalInputs + digitalOutputs
analogBits = (analogInputs + analogOutputs) * 16
totalDataBits = digitalBits + analogBits
totalDataBytes = Math.ceil(totalDataBits / 8)
// Add Ethernet overhead (header 14 bytes + FCS 4 bytes + IFG 12 bytes = 30 bytes minimum)
// Plus typical IP/UDP overhead if not using raw Ethernet
protocolOverhead = 60 // bytes (conservative estimate)
totalFrameBytes = totalDataBytes + protocolOverhead
// Calculate required bandwidth
cyclesPerSecond = 1000 / targetCycle
bitsPerSecond = totalFrameBytes * 8 * cyclesPerSecond
mbps = bitsPerSecond / 1000000
// Calculate utilization at different link speeds
util_10mbps = (bitsPerSecond / 10000000) * 100
util_100mbps = (bitsPerSecond / 100000000) * 100
util_1gbps = (bitsPerSecond / 1000000000) * 100
html`<div style="background: linear-gradient(135deg, #2C3E50 0%, #16A085 100%); color: white; padding: 20px; border-radius: 8px; margin: 20px 0;">
<h3 style="margin-top: 0; color: white;">Network Bandwidth Analysis</h3>
<div style="background: rgba(255,255,255,0.1); padding: 15px; border-radius: 6px; margin: 15px 0;">
<div style="font-size: 0.9em; opacity: 0.9;">Data Payload per Cycle</div>
<div style="font-size: 2em; font-weight: bold; color: #E67E22;">${totalDataBytes} bytes</div>
<div style="font-size: 0.8em; opacity: 0.8; margin-top: 5px;">
${digitalBits} digital bits + ${analogBits} analog bits = ${totalDataBits} bits
</div>
</div>
<div style="background: rgba(255,255,255,0.1); padding: 15px; border-radius: 6px; margin: 15px 0;">
<div style="font-size: 0.9em; opacity: 0.9;">Total Frame Size (with overhead)</div>
<div style="font-size: 2em; font-weight: bold; color: #3498DB;">${totalFrameBytes} bytes</div>
<div style="font-size: 0.8em; opacity: 0.8; margin-top: 5px;">
${totalDataBytes} payload + ${protocolOverhead} protocol overhead
</div>
</div>
<div style="background: rgba(255,255,255,0.15); padding: 20px; border-radius: 6px; margin: 15px 0;">
<div style="font-size: 0.9em; opacity: 0.9;">Required Bandwidth</div>
<div style="font-size: 2.5em; font-weight: bold; color: #fff;">${mbps.toFixed(2)} Mbps</div>
<div style="font-size: 0.8em; opacity: 0.8; margin-top: 5px;">
${cyclesPerSecond.toFixed(1)} cycles/sec × ${totalFrameBytes} bytes
</div>
</div>
<div style="margin-top: 20px;">
<div style="font-size: 1.1em; font-weight: bold; margin-bottom: 10px;">Link Utilization</div>
<div style="background: rgba(255,255,255,0.1); padding: 12px; border-radius: 6px; margin: 8px 0;">
<div style="display: flex; justify-content: space-between; margin-bottom: 5px;">
<span>10 Mbps Ethernet:</span>
<span style="font-weight: bold; color: ${util_10mbps > 80 ? '#E74C3C' : util_10mbps > 50 ? '#E67E22' : '#16A085'}">
${util_10mbps.toFixed(1)}%
</span>
</div>
<div style="background: rgba(0,0,0,0.2); height: 8px; border-radius: 4px;">
<div style="background: ${util_10mbps > 80 ? '#E74C3C' : util_10mbps > 50 ? '#E67E22' : '#16A085'};
width: ${Math.min(util_10mbps, 100)}%; height: 100%; border-radius: 4px;"></div>
</div>
</div>
<div style="background: rgba(255,255,255,0.1); padding: 12px; border-radius: 6px; margin: 8px 0;">
<div style="display: flex; justify-content: space-between; margin-bottom: 5px;">
<span>100 Mbps Fast Ethernet:</span>
<span style="font-weight: bold; color: ${util_100mbps > 80 ? '#E74C3C' : util_100mbps > 50 ? '#E67E22' : '#16A085'}">
${util_100mbps.toFixed(1)}%
</span>
</div>
<div style="background: rgba(0,0,0,0.2); height: 8px; border-radius: 4px;">
<div style="background: ${util_100mbps > 80 ? '#E74C3C' : util_100mbps > 50 ? '#E67E22' : '#16A085'};
width: ${Math.min(util_100mbps, 100)}%; height: 100%; border-radius: 4px;"></div>
</div>
</div>
<div style="background: rgba(255,255,255,0.1); padding: 12px; border-radius: 6px; margin: 8px 0;">
<div style="display: flex; justify-content: space-between; margin-bottom: 5px;">
<span>1 Gbps Gigabit Ethernet:</span>
<span style="font-weight: bold; color: ${util_1gbps > 80 ? '#E74C3C' : util_1gbps > 50 ? '#E67E22' : '#16A085'}">
${util_1gbps.toFixed(2)}%
</span>
</div>
<div style="background: rgba(0,0,0,0.2); height: 8px; border-radius: 4px;">
<div style="background: ${util_1gbps > 80 ? '#E74C3C' : util_1gbps > 50 ? '#E67E22' : '#16A085'};
width: ${Math.min(util_1gbps, 100)}%; height: 100%; border-radius: 4px;"></div>
</div>
</div>
</div>
<div style="background: rgba(255,255,255,0.1); padding: 15px; border-radius: 6px; margin-top: 20px; font-size: 0.9em;">
<strong>Recommendation:</strong>
${util_100mbps < 50 ?
'Fast Ethernet (100 Mbps) provides adequate headroom for this configuration.' :
util_100mbps < 80 ?
'Fast Ethernet (100 Mbps) is sufficient but monitor for future expansion.' :
'Consider Gigabit Ethernet (1 Gbps) for better performance margin and future growth.'}
</div>
</div>`Industrial Network Bandwidth
Industrial Network Bandwidth
animation
iiot
industrial
protocols
Try Change Target cycle time (ms): while keeping I/O points fixed. Then press Calculate required bandwidth.
Observe After pressing Calculate required bandwidth, watch required bandwidth and link utilization as Target cycle time (ms): changes.
Explain Explain why reducing Target cycle time (ms): increases cycles per second and required bandwidth after you press Calculate required bandwidth.
Technical boundaries. The calculation adds a fixed 60 bytes of protocol overhead per frame. Real-world overhead includes headers, retransmissions, and management traffic and should be measured for the selected frames and link.