opt — access to byte of event status.

Description:

u8 opt (u8 byte);

Returns the value of specified word byte (byte) of element status sent the event.

List of parameters:

value

Byte number in the word of event status starting from zero.

Return values:

Returns the value of word byte of element status. Type of return value u8.

Note:

opt is also the pointer to the array of device status, for example:

u8 *status=opt;

status – array of device status.

Example:

<!-- Example: 1 -->
<item addr="524:248" name="Test for opt function" type="script">

V-ID/V-ADDR 
{
	u8 status = opt(0);
	if(status)
	setStatus(@exciterId():32, {1, “Device is activated”});
	else
	setStatus(@exciterId():32, {1, “Device is disactivated”});
}

</item>

<!-- Example 2 usage of opt as the pointer to the array of device event status  -->
<item addr="524:248" COND="524:200" name="Test for opt function" type="script">

V-ID/COND 
{
	u8 *status = opt;
	u8 syzeOfStatus = optl; 
	u8 strForMess[200];

	sprintf(strForMess, "%cEvent size of conditioner - %d. ", 1, syzeOfStatus); 

	u8 i = 0;

	for(i = 0; i < optl; ++i) 
	{
		sprintf(strForMess, "%sBYTE[%d] = %d. ", strForMess, i + 1, status[i]);
	}
		setStatus(@exciterId():32, &strForMess);
}
</item>

The result of performing the example in the interface:

Example 1: when clicking the element script the message with its current status will appear in the interface.

Example 2: when clicking the element COND in the interface the message with its current status will appear in the interface.