/* Below is a query to list all of the device types in the system and their firmware/template information. ExceptionType  {5u void "} indicates an issue retrieving firmware/template information.
  For PM or CM devices, the major and minor releases are not separated by '.'
  10430 = Firmware 10.43
*/
Use ION_Network
Select s.displayname, di.deviceType, di.Revision, di.SerialNumber, g.address,  p.Address as port, d.Address as DeviceID
from device d
join IRM_DeviceInfo di on d.Name = di.Name 
join SRC_Source s on s.name = d.name
join Port p on d.PortID = p.ID
join gate g on p.GateID = g.ID
--Following filter
where DeviceType not like 'VIP'
-- and not (di.Revision = 'V1.0.0' or di.Revision = 'V1.1.4' or di.Revision = 'V1.1.1' or di.Revision like '1.0.0.0') --uncomment if you want to exclude modbus
--devices with drivers not providing firmware version.
-- and DeviceType like 'PM8%'  --Uncomment if you want to filter search by device type
order by s.displayname  -- could also order by Revision or DeviceType