...
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Code Block | ||||
---|---|---|---|---|
| ||||
<ThingFacet Name="PhidgetRFID">
<Sid Name="RFIDId" />
<String Name="ReadTag" Update="auto" KnownBy="PhidgetReadRFIDTagAc" />
<String Name="WriteTag" KnownBy="PhidgetWriteRFIDTagAc" />
<String Name="RFIDURL" Default="phid://" />
<String Name="InterfaceType" />
<String Name="InterfaceIndex" />
<Unique Name="RFIDIndex" Value="InterfaceIndex" />
<DateTime Name="timestamp" Format="$SimpleDateFormat(yyyy-MM-dd'T'HH:mm:ss'Z')" />
<AA>
[:#o#Output.ActionArgument:]
</AA>
<Action Name="PhidgetReadRFIDTagAc" Documentation="Read the Tag Automatically in the vicinity">
<Workflow Limit="1" Live="1" Timeout="-1">
<Task name="Main" while="true">
<Event name="Argument" as="ActionArgument" />
<Invoke name="ReadValue" waitFor="Argument"
get="[%:Event.Argument.RFIDURL.Value:%]" SerialNumber="[%:Event.Argument.InterfaceIndex.Value:%]"
DeviceType="[%:Event.Argument.InterfaceType.Value:%]" />
<Output name="Result" as="ActionResult">
<Value>
<ReadTag>
[%:[%:@Output:%]Invoke.ReadValue.Message.Value:%]
</ReadTag>
</Value>
</Output>
</Task>
</Workflow>
</Action>
<Action Name="PhidgetWriteRFIDTagAc" Documentation="Write the Tag Value to RFID in the vicinity">
<Workflow Limit="1" Live="1" Timeout="-1">
<Task name="Main" while="true">
<Output name="ActionArgument" as="ActionArgument" />
<Invoke name="WriteValue" waitFor="ActionArgument"
skip-if="[%:[:AA:].WriteTag/no-value(Value):%]" post="[%:[:AA:].RFIDURL.Value:%]"
SerialNumber="[%:[:AA:].InterfaceIndex.Value:%]"
SensorType="WriteTag" DeviceType="[%:[:AA:].InterfaceType.Value:%]">
<Message Type="text" Value="[%:[:AA:].WriteTag.Value:%]" />
</Invoke>
<Output name="Result" as="ActionResult">
<Value>
<WriteTag>
[%:[%:@Output:%]Invoke.WriteValue.Message.Value:%]
</WriteTag>
</Value>
</Output>
</Task>
</Workflow>
</Action>
</ThingFacet> |