{#- FB_ILS_MTRO_2Sep2Swi - Aufrufstelle in FB_Main ACHTUNG: KEINE Referenz-Aufrufstelle. Der Baustein existiert noch nicht in der ILSLib (Anlass: Mubea 500573, Beruehrpunkt Kreisel2/Kreisel1 - zwei Separatoren laufen auf Ausschleuselement und Kreisel-Weiche zu). Darum gibt es hier keinen Rundlauf-Test wie bei den anderen Templates, nur das Rendern fuer die echten Anlagen (tests/test_scl_templates.py) und die Golden-Datei. Die Schnittstelle ist aus den beiden Nachbarbausteinen ZUSAMMENGESETZT und muss beim Anlegen des FB so (oder geaendert hier) umgesetzt werden: zwei Separatoren wie FB_ILS_MTRO_2Sep1Swi (Quelle data/): stInSeparator1/2, stInSettings.bSep1Type/bSep2Type, arInOutJamEntr1/2, stInBarcodeReader1/2, stInOutCognexInterface1/2, xOutStopper1/2 zwei Weichen wie FB_ILS_MTRO_1Sep2Swi (Referenz TRO 267): stInSwitch1/2 mit xNewSwitch, stInSenJam und arInOutJamExit je Ausgang, xInCarouselRun1/2, xOutSw1ExTo3/xOutSw2ExTo3 Entscheidungen zu den ortsgebundenen Zeilen (doc/SCL_Templates.md ยง6): Separatorzeiten 100/50 ms wie die anderen Templates (m.separator), "pruefen" nSwitchNo fuer BEIDE Weichen (FC_Direction braucht die Nummer; in TRO 267 fehlt sie bei Weiche 2 - dort offen, Frage 9) nTo1Destinations Aufteilung der Abgaenge auf die Weichen offen bSepType.%X2 TRUE wie bSepType.%X2 in TRO 267, Bedeutung klaeren xInCarouselRun je Weiche einer - hier sitzen beide an je einem Kreisel Vorfahrtsregelung nicht verdrahtet: 2Sep1Swi hat stInPriorityManagerDir1..4, 1Sep2Swi ein einzelnes stInPriorityManager - offen FC_Direction je Weiche einer, Ziel nInDirection1/2 Alle noch mit den SPS-Kollegen zu bestaetigen. -#} {% import "_macros.scl.j2" as m %} REGION {{ t.region_title }} {{ m.kopf(t) }} // ACHTUNG: FB_ILS_MTRO_2Sep2Swi existiert noch nicht in der ILSLib - Schnittstelle // angenommen (2Sep1Swi + 1Sep2Swi), mit den SPS-Kollegen abzustimmen. {% for s in t.separators %} {{ m.separator(t, s) }} {% if not loop.last %} {% endif %} {% endfor %} {{ m.jam_sensors(t) }} {% for w in t.switches %} #{{ t.id }}.stInSwitch{{ w.n }}.Settings.nSwitchNo := "{{ w.no.value }}";{{ m.todo(w.no) }} #{{ t.id }}.stInSwitch{{ w.n }}.Settings.xPluggedExSen3 := FALSE; #{{ t.id }}.stInSwitch{{ w.n }}.Settings.xPluggedExSen4 := FALSE; #{{ t.id }}.stInSwitch{{ w.n }}.Settings.xNewSwitch := TRUE; {% if w.to1_destinations is not none %} #{{ t.id }}.stInSwitch{{ w.n }}.Settings.nTo1Destinations := {{ w.to1_destinations }}; // Info noetig fuer HMI - {{ TODO }}: pruefen {% else %} #{{ t.id }}.stInSwitch{{ w.n }}.Settings.nTo1Destinations := _; // {{ TODO }}: {{ t.successors|length }} Abgaenge auf {{ t.switches|length }} Weichen - Aufteilung festlegen {% endif %} {% endfor %} {{ m.ziele(t) }} {% for sc in t.scanners %} #{{ t.id }}.stInBarcodeReader{{ sc.n }}.Settings.xActivateCheckASCI := TRUE; #{{ t.id }}.stInBarcodeReader{{ sc.n }}.Settings.tTimeout := T#5s; {{ m.cognex_in(m.cognex(sc), sc) }} {% endfor %} // Vorfahrtsregelung: nicht verdrahtet - {{ TODO }}: Schnittstelle des FB klaeren {% for s in t.separators %} #{{ t.id }}.stInSettings.bSep{{ s.n }}Type.%X2 := TRUE; // {{ TODO }}: pruefen (Bedeutung) {% endfor %} {% set z = [] %} {% set _ = z.append(('nInMainTroNo := "' ~ t.main_tro.value ~ '"', m.note(t.main_tro))) %} {% set _ = z.append(("xInSftyOk := " ~ t.safety.value, m.note(t.safety))) %} {% set _ = z.append(("xInAllRdyToStart := TRUE", "")) %} {% set _ = z.append(('xInCancel := "cTodoFalse"', "")) %} {% set _ = z.append(("xInRelease := " ~ t.release, "")) %} {% for w in t.switches %} {% set _ = z.append(("xInCarouselRun" ~ w.n ~ " := " ~ t.carousel_run.value, m.note(t.carousel_run, "Kreisel an Weiche " ~ w.n))) %} {% endfor %} {% set _ = z.append(("stInOutMachineState := " ~ t.machine_state.value, m.note(t.machine_state, "Schaltschrank"))) %} {% for s in t.separators %} {% if t.scanners|length >= s.n %} {% set sc = t.scanners[s.n - 1] %} {% set _ = z.append(("stInOutCognexInterface" ~ s.n ~ " := " ~ m.cognex(sc), m.note(sc.interface))) %} {% else %} {% set _ = z.append(("stInOutCognexInterface" ~ s.n ~ " := #stCognexInterfaceDummy", "")) %} {% endif %} {% endfor %} {% for j in t.jam_entries %} {% set _ = z.append(("arInOutJamEntr" ~ j.n ~ " := " ~ j.carriers.value, m.note(j.carriers, j.title ~ " von " ~ j.neighbour))) %} {% set _ = z.append(("stInOutJamEntr" ~ j.n ~ " := " ~ j.data.value, m.note(j.data))) %} {% endfor %} {% for j in t.jam_exits %} {% set _ = z.append(("arInOutJamExit" ~ j.n ~ " := " ~ j.carriers.value, m.note(j.carriers, j.title ~ " vor " ~ j.neighbour))) %} {% set _ = z.append(("stInOutJamExit" ~ j.n ~ " := " ~ j.data.value, m.note(j.data))) %} {% endfor %} {% for s in t.separators %} {% set _ = z.append(("xOutStopper" ~ s.n ~ ' => "' ~ s.stopper.value ~ '"', m.note(s.stopper))) %} {% endfor %} {% for w in t.switches %} {% set _ = z.append(("xOutSw" ~ w.n ~ 'ExTo3 => "' ~ w.valve.value ~ '"', m.note(w.valve))) %} {% endfor %} {% set _ = z.append(('stInOutHMI := "DB_Interface_HMI".stTRO.' ~ t.id, "")) %} {% set _ = z.append(('nOutStateLast => "DB_GLOB_TroState".arTroState["' ~ t.main_tro.value ~ '"]', m.note(t.main_tro))) %} {{ m.call(t, z) }} {% for sc in t.scanners %} {{ m.cognex_out(m.cognex(sc), sc) }} {% if not loop.last %} {% endif %} {% endfor %} {{ m.direction(t) }} END_REGION