Arrays and Buffers

Read a Storage Slot

easy

Reads a part ID from a selected storage slot and reports an invalid selection.

What it teaches

A numbered storage rack is a list: index 0 is its first slot. The array belongs to the program using this one: read it without changing it, check both index bounds, and distinguish an empty slot from an invalid selection. An indexed move or assignment supplies the selected value.

Parameters

TagDirectionTypeDefaultDescription
In_IndexInputDINT0Zero-based slot to inspect
Out_PartIdOutputDINT0Part ID, or 0 for an invalid index
Sts_ValidOutputBOOL01 when the index is within the rack
Ref_SlotsInOutDINT[8]Read-only storage slots; 0 means empty

Required behavior