Monday, February 24, 2014

Best Programming Practices

  1. Always use a UDINT variable named "NumRegisters" to set the size of the register (indirect) array (app.253.x)
  2. Always use a String variable named "PartNumber" to set the program's part number that is also used to select the INI file in PCCU. For example for Well Test: "2509032-001"
    1. Don't use numbers that start with 1,000,000 or 2,000,000 - those are for ABB.
    2. Don't do this will developing. Wait until you are ready to do a custom INI.
  3. INI Files:
    1. Always lock the INI index of all variables using the "Address" field of each variable, using a type code as part of the address.
    2. Use the program: "Gen INI G4.exe" to generate the first pass of a custom INI.
    3. Include Auto tree only in expert mode, if desired, normally only in the developer's INI: xxxxxxx-255.ini.
    4. Never include the "Symbol Table" or "System Variables" portion of the trees.
    5. Always include IEC pgm Command/Status page: (Msg Reads, IEC state, Start/Stop, Resource, Rescan, ...)
    6. Write protect items that the user should not change using command: rwa:1;
    7. Define unused columns with a blank comment and a write protect.
    8. Use Rowloop command for repeating lines.
  4. Package Files:
    1. Make both XFC and XRC packages if you have both kinds of meters.
    2. Only include the IEC pgm. Not ISAGRAF runtime.
  5. Always set the ISaGRAF resources for the project as follows:
    1. Embed Symbol Table = True
    2. Embedded Table Table Type = Complete
    3. Check Array Index = True
    4. Target = TOTALFLOW
    5. Memory for Retain = "\tfData\iec-%\2509xxx-rrr" (replace with correct part number)
    6. Cycle Time = 1000 ms (1 sec)

No comments:

Post a Comment