StartX() - The StartX Command

The StartX() command actively listens to an incoming binary or hex messages on a port and will start the task when a matching message is received. You can also manually start the task and it will just run past this command. It can trigger of a message of up to 64 bytes but only the first 16 can be used to compare against.
A dedicated TCP IPv4 or comm port configured as "Text and Binary Integration" is required for it to work for Ethernet devices. The command will also work on an RS-232 port configured for RS-232.

Configuration

Configure the port as "Text and Binary Integration"

Screenshot of port configured as Text and Binary Integration
Devices confirmed to work with StartX
Device Status

PDEG

Confirmed

PDEB

Confirmed

PDDEG-S

Confirmed

DDRC-GRMS-E

Confirmed

DDBC320-DALI

Confirmed

PDTS

Confirmed

DDNG485 v3

Confirmed

PDZG-E

Not Tested

DDNG232

Confirmed (works as RS-232 port)

Syntax

StartX(x,x,…​n)
An "x" is a wild card and can trigger off of any value. You can specify any portion of the packet and use wildcards for the rest.
The packet can be up to 64 bytes in length and be made up of decimal or hex byte values.

There is a 16 byte limit to the triggering on this command. Anything beyond 16 will loop back and compare to the bytes at the start. Use wildcards for everything past 16. If you need data from beyond the first 16 bytes use the copy command after this command starting at byte 16 (@15).

Examples

Example 1

Task2()
{
Name="Trigger from IP packet"
StartX(0x01,x,0x03,x,x,x,0x07) //Task will start off an IP packet received on the "Text and Binary Integration" Port.
}

Example 2

This example triggers off packets sent from a Vingcard server.

Task14()
{
Name="VingCard Integration"
	//Listen to the room events//
	//VisiOnline packets have a 10 Byte header and a 3 byte footer
	//Third byte in the actual message is the event number and 8th and 9th byte gives the room number//
	//9th byte is the first byte for room number and if it is above 255, then 8th byte will be used//

	//*****Event Number & Description***
	//	0	: Guest Entrance
	//	1	: Staff Entrance
	//	2	: Inside Open
	//	3	: Deadbolt Thrown
	//	4	: Deadbolt Released
	//	5	: Door Closed
	//
	Startx(x,x,x,x,x,x,x,x,x,x,0x00,0x00,x,0x00,0x00,0x00,0x00,x,x,x,x,x)
	Copy @0,~0,19
	//Get the room number
	LDA ~17
	STA ~RoomNumHighByte
	LDA ~18
	STA ~RoomNumLowByte

	LDA ~12 //Get the Event Number
	CMP #0x00 //Guest Entrance
	BRZ Guest
	CMP #0x01
	BRZ Staff
	CMP #0x02
	BRZ InsideOpen
	CMP #0x03
	BRZ DeadboltThrown
	CMP #0x04
	BRZ DeadboltRelease
	CMP #0x05
	BRZ DoorClosed
	Null

	Guest:
		Copy LinearPresetMessage,~30, 7
		LDA #VingCardAreaNumber
		STA ~31
		LDA #GuestEntrancePreset
		STA ~32
		LDA ~RoomNumHighByte
		STA ~34
		LDA ~RoomNumLowByte
		STA ~35
		TX ~30,8,7
		Null
        ...
}