PreviousNext
Batch
Help > Peripherals > OS > Batch

[sync]   Batch command allows executing more individual DPA Requests within one original DPA Request. Both the sender’s and addressee’s addresses of each embedded DPA Request equal the corresponding addresses of the original Batch DPA Request. It is not allowed to embed the Batch command itself within a series of individual DPA Requests (recursion is not possible). Using Run discovery is not allowed inside the batch command list. Batch command is useful not only to group commands but also to execute the asynchronous command(s) synchronously (after the Batch response is sent).

 

Request

 

NADR

PNUM

PCMD

HWPID

0

n

NADR

0x02

0x05

?

Requests

0

 

Requests                 It contains more DPA Requests to be executed. The format in which the DPA Requests are stored is the same as the format of IO Setup DPA Requests. See IO Setup for more information.

 

Example

 

The following example runs a simple broadcast set of 5 DPA Requests. It switches on the red LED at devices with HW profile ID 0x1234 or green LED at devices with HW profile ID 0x5678 respectively, then waits for 200 ms (using I/O peripheral) and finally switches the same LEDs off.

 

NADR=0x00FF, PNUM=0x02, PCMD=0x05, HWPID=0xFFFF, PData=
[1st command] {0x05
(length), 0x06(PNUM=LEDR), 0x01(PCMD=LED on), 0x1234(HWPID)},
[2nd command] {0x05
(length), 0x07(PNUM=LEDG), 0x01(PCMD=LED on), 0x5678(HWPID)},
[3rd command] {0x08
(length), 0x09(PNUM=I/O), 0x01(PCMD=Set),0xFFFF(HWPID),0xFF(Delay command),0x00C8(200 ms)}
[4th command] {0x05
(length), 0x06(PNUM=LEDR), 0x00(PCMD=LED off),0x1234HWPID)},
[5th command] {0x05
(length), 0x07(PNUM=LEDG), 0x00(PCMD=LED off),0x5678HWPID)},
{0x00
(end of the batch)}

 

Response

 

The general response to writing request with STATUS_NO_ERROR Error code.