Applies To:
  • CitectSCADA 1.00 1.01 1.10 1.11 1.20 2.00 2.01 3.00

Question: Is it possible to develop a generic piece of cicode which will work with devices when you don't know what the field names are. I would like a function that can just get the next field. At the moment the function DevGetField() needs the name of the field.  

You can use the functions DevInfo() to develop the code you require. DevInfo() can return the number of fields as well as the names of the fields. DevInfo(hDev, 6) will return the number of fields and then DevInfo(hDev, -ve) will return each field name. For example:

nFields = DevInfo(hDev, 6);
FOR hField = 0 TO nFields DO
   sName = DevInfo(hDev, -1 - hField);
   sData = DevGetField(hDev, sName);

With this type of code you can access the data in a device without knowing the names of the fields.