@paul53 sagte in Blockly Script Hilfe:
@Marko79:
Das system gibt die Kennung des RFID-Chips als Wert aus…zb:xxxxx828. `
Innerhalb eines JSON-Strings als svalue ?
Dann sollte es so funktionieren:
[image: 493_blockly_rfid_toggle.jpg]
Export, in den noch die richtigen Datenpunkt-IDs eingesetzt werden müssen:
! ````
<xml xmlns="http://www.w3.org/1999/xhtml"><block type="procedures_defcustomreturn" id="l?Ac#Qpv`P_23fG!XjE=" x="113" y="-12"><mutation statements="false"><arg name="x"></arg></mutation>
<field name="NAME">getsvalue</field>
<field name="SCRIPT">dmFyIG9iaiA9IEpTT04ucGFyc2UoeCk7CnJldHVybiBvYmouc3ZhbHVlOw==</field>
<comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment></block>
<block type="comment" id="CH-iW]4jo[;@S1F0-y91" x="113" y="38"><field name="COMMENT">ID TV_LICHT</field>
<next><block type="variables_set" id="l3jLI7#u~iy^,f3J!7["><field name="VAR">tvlicht</field>
<value name="VALUE"><block type="get_value" id="p?UCXs5nOa#{/D@M6yy"><field name="ATTR">val</field>
<field name="OID">ID auswählen</field></block></value>
<next><block type="on_ext" id="~+qq5:QThYeF#(+,)uRQ"><mutation items="1"></mutation>
<field name="CONDITION">ne</field>
<value name="OID0"><shadow type="field_oid" id="g1RpA^Nt*mIcFS~*;v*3"><field name="oid">default</field></shadow></value>
<statement name="STATEMENT"><block type="variables_set" id="42=%~f?|E=J[,VuI]2A)"><field name="VAR">tvlicht</field>
<value name="VALUE"><block type="variables_get" id="R:p=%:U6Fc[]k-CW%3cI"><field name="VAR">value</field></block></value></block></statement>
<next><block type="comment" id="87X{9^FNZTsi@;3Q4xg~"><field name="COMMENT">ID RFID</field>
<next><block type="on_ext" id="Pw:E`2.yC07ztSCrpEts"><mutation items="1"></mutation>
<field name="CONDITION">any</field>
<value name="OID0"><shadow type="field_oid" id="}=/~)AoP:;tzU*c~S`O="><field name="oid">default</field></shadow></value>
<statement name="STATEMENT"><block type="controls_if" id="qgi*s?%:lkvS#uB^FrJ!"><value name="IF0"><block type="logic_compare" id="L.7,Q:r3xr3}]6/ToV;Q"><field name="OP">EQ</field>
<value name="A"><block type="procedures_callcustomreturn" id="2cKBZdr8e{~4-9ZOA/RI"><mutation name="getsvalue"><arg name="x"></arg></mutation>
<value name="ARG0"><block type="variables_get" id="p;!;F#7Q3;vYQ`Z319pa"><field name="VAR">value</field></block></value></block></value>
<value name="B"><block type="text" id="!p=@M;jymJW?j{#y`DGQ"><field name="TEXT">909222828</field></block></value></block></value>
<statement name="DO0"><block type="controls_if" id="sPVa!N?MI6pRuiuc#D@S"><mutation else="1"></mutation>
<value name="IF0"><block type="variables_get" id="L2|_S!U^TM[q(5)RX=%K"><field name="VAR">tvlicht</field></block></value>
<statement name="DO0"><block type="control" id=".INS.Z#D}`VG1MH/^jF^"><mutation delay_input="false"></mutation>
<field name="OID">Object ID</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE"><block type="logic_boolean" id=":pIF,Yog8u[,_44xe3~1"><field name="BOOL">FALSE</field></block></value></block></statement>
<statement name="ELSE"><block type="control" id=".bo,ILfOXw,;77q(!SkU"><mutation delay_input="false"></mutation>
<field name="OID">Object ID</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE"><block type="logic_boolean" id="0{jaed*l3LJhf~@*sd@,"><field name="BOOL">TRUE</field></block></value></block></statement></block></statement></block></statement></block></next></block></next></block></next></block></next></block>
<block type="comment" id="8qdZjH:CCMPOfk8`^=(V" x="313" y="488"><field name="COMMENT">ID TV_LICHT</field></block></xml>