DYNET() Command

Used to send a DyNet message onto the network. If you know the opcode and bytes this can send any message. It can be used to send DyNet 1 and DyNet 2 packets, both logical and physical. It can also be used to send 0x6c messages which are great for debugging.
With this command you can send virtually any DyNet packet.
You do not need to add the checksum, it will be calculated automatically by the compiler.

You can use a DyNet message as an architypal message and save it to a set of memories using the Copy command so you can edit the bytes and send it out via the TX command.

Syntax

Basic Use: DyNet 1 Packet Dynet(x,x,x,x,x,x,x)
Where the x’s are the bytes of the packet. The first byte denotes the type of packet (0x1C=Logical, 0x5C=Physical).
DyNet 1 Logical message: DyNet(0x1C,A,D1,OP,D2,D3,J)

Logical Packet Structure
  • 0x1C - Denotes a logical packet

  • A - Area for the message

  • D1 - Data byte 1 for the message

  • OP - OpCode of the message (What it does)

  • D2 - Data byte 2 of the message

  • D3 - Data byte 3 of the message

  • J - Join value of the message

DyNet 1 Physical message: DyNet(0x5C,DC,BN,OP,D1,D2,D3)

Physical Packet Structure
  • 0x5C - Denotes a physical packet

  • DC - Device Code for the message to target

  • BN - Box Number for the message to target

  • OP - OpCode of the message (What it does)

  • D1 - Data byte 1 of the message

  • D2 - Data byte 2 of the message

  • D3 - Data byte 3 of the message

Advanced Use: DyNet 2 Packet Dynet(0xAC,x,x,x,x,x,x,…​)
Where the x’s are the bytes of the packet. The first byte denotes it is a DyNet 2 packet. As D2 packets have variable lengths there isn’t a fixed schema to the bytes.

Advanced Use: Block Data Packet Dynet(0x6c,"6chars")
The message in quotes must be exactly 6 characters long. If you don’t need 6 characters you can fill the test with empty spaces.
A block data packet is used for debugging code. It puts a 6 byte message onto the network that doesn’t control anything but is human readable. Inserting these in your code is a great way to test that your logic is working correctly in a task.

You can also build the bytes of a 0x6C packet in tilde memories and use the TX command to send it out. This allows you to see the current state of memories and ports while testing code.

Examples

Example 1

This sends out a message sending Channel 2 of Area 4 to Preset 4.

{
DyNet(0x1C,4,0x01,0x6B,0x03,0x64,0xFF)   //OneTouch A4,Ch2,P4,F2s
}

Example 2

This sends out a message changing the page on an Antumbra Display.

{
DyNet(0x5C,0xFD,0x00,0x62,0x00,0x00,0x02)   //Antumbra Display Box number #0 go to page 2
}

Example 3

This sends out a D2 message to interact with a global area on the trunk.

{
DyNet(0xAC,0x03,0x20,0x00,0x00,0x00,0xFD,0xE9,0xFF,0x00,0x00,0x01,0x00,0x00)    // (Area 65001)Request Current Preset
}

Example 3

This sends out a block data message that will say "Debug " in the network log.

{
DyNet(0x6c,"Debug ")   //Will send a message onto the network saying "Debug".  The extra space makes it exactly 6 characters.
}

Example 4

This uses a DyNet message as an architype to edit and TX out.

SendPage: DyNet(0x5C,0xFD,0x00,0x62,0x00,0x00,0x01)
{
Copy SendPage,~40,7	//Load the message into some tilde locations so we can edit and TX it out.
LDA ^14,0   //Get Box number
STA ~42	    //Store to the box number slot in our SendPage command
Null
}