« Last post by peadard on February 16, 2014, 01:45:36 pm »
I inserted yopur code but for some reason it only returns the contents of Zone 32 which I presume is the last entry in the array.
I ended up getting it working with the method below which writes the array to a txt file and I then email the contents of that file.
I will look into your method more as it is a cleaner way of doing things and reckon the issue is where I am inserting the code in the loop.
Thanks again for your help.
//Loop through devices to get a list of all M1 panels
WindowsOpen = new Array();
devicesContainers = System.GetSecurityDeviceContainers( );
x = WindowsOpen.HighestIndex;
for (i=0; i < devicesContainers.Length; i++)
M1 = devicesContainers[i].GetDevice();
// Get the name of the Device
device = M1.DeviceDisplayName;
// Assign the name of the Zone to Variable names
names = M1.ZoneNames;
//Assign the Temperature of the Zone to the Variable Temperature
status = M1.Zonephysicalstatuses;
//loop through Zones while you are getting a return in the temperature variable value
for (zoneID=1; zoneID<status.length; zoneID++)
// Get the name
name = names[zoneID];
current = status[zoneID];
//temp = new String(current);
hasreed = name.Contains("WR");
if (hasreed == true)
if (current == 2)
TextFileWriter.AppendFile("C:\ProgramData\Codecore Technologies\Elve\WindowsOpen.txt", WindowsOpen[ZoneID]);
TextFileWriter.AppendFile("C:\ProgramData\Codecore Technologies\Elve\WindowsOpen.txt", "\r\n");
s = TextFileReader.ReadAllText("C:\ProgramData\Codecore Technologies\Elve\WindowsOpen.txt");
TextFileWriter.WriteAllText("C:\ProgramData\Codecore Technologies\Elve\WindowsOpen.txt", "");