isDefined — definition of the device operability.

Description

u8 isDefined(ID:SUBID[,PERIOD]);

Returns information about ID:SUBID device operability.

List of parameters

ID:SUBID

Sensor address.

PERIOD

Period after which the device is considered to be non operable, milliseconds. Maximum 10 minutes.

Return values:

· Returns 0 – if ID:SUBID device doesn’t respond.

· Returns value not 0 – if ID:SUBID device responds.

Note:

Attention:

time out for detecting the inoperability is 10 minutes by default.

Example

<item addr="524:248" LAMP="512:8" MS="512:32" name="Test for isDefined function"
			type="script">
		
V-ID/V-ADDR
{
		 if(opt0())
		 {
			 u8 definedMs = isDefined(MS);
			 u8 definedLamp = isDefined(LAMP);
			 u8 strForMess[100];
			
			 sprintf(strForMess, "%cLamp ", 1,);

			 if(definedLamp != 0)
				 strcat(&strForMess, "available, sensor");
			 else 
			 	strcat(&strForMess, "not available, sensor ");
		
			 if(definedMs != 0) 
			 	strcat(&strForMess, "available.");
			 else
				 strcat(&strForMess, "not available.");

			 setStatus(@exciterId():32, &strForMess);
		 }
}

</item>

The result of performing the example in the interface:

When clicking the element the messages whether LAMP and MS elements are available will be displayed in the interface.