Migration of a class from CS < V3.0 to CS V3.0

  1. Make sure to fulfill the coding conventions.
  2. Specific methods to change.
    1. CLASSNAME.ProcCases: The format of the "Data" control has changed from string to "CoreDefs.rawDataType.ctl".
    2. CLASSNAME.ProcEvents: The format of event definitions has changed. If you are in extreme hurry, you may use the "BaseProcess.evt create compatibility.vi".
  3. Replace unflatten/flatten string VIs:
    1. "flatten to string" by "CoreLib.data 2 byte array" (simple data types),
    2. "unflatten from string" by "CoreLib.byte array 2 data" (simple data types),
  4. Go through all methods, if one is not executable, the errors need to be fixed.
  5. "inheritance" folder: Due to changes in the inheritance tool, quite a few VIs in the "intheritance" folder of a class may be deleted using the file explorer.
    1. All (12) VIs of the attribute handling.
    2. All (2) VIs of the event definition XXX.ProcEvents.vi.
    3. All (2) VIs for the periodic loop XXX.ProcPeriodic.vi.
  6. Other Changes
    1. BaseProcess.constructor: In case "data in" equals
      1. "N/A", the attribute data is not initialized.
      2. "", the attribute data is obtained from the database.
      3. something else, the data input is interpreted as attribute data flattened to string.
    2. BaseGUI.constructor: In case "data in" equals
      1. "", the name of the panel template is "THISCLASSNAME.panel.vit".
      2. something else, the data input is interpreted as a string in the form "CLASSNAME.PANELNAME.vit".
  7. SCADA backend.
    1. For each item (tag) that should be written:
      1. Add an integer (i32) number to the attribute data. That integer will contain the value of a DIM service ID.
      2. In the constructor of a class, create a DIM service by using "LVDimInterface.dis_add_service.vi" and write the serviceID to the attribute data. You have to specify a default value for the service, typecast (!) the value to a string and wire that string to "LVDimInterface.dis_add_service.vi",
      3. In the destructor of a class, destroy the DIM service by using "LVDimInterface.dis_remove_service.vi" and using the serviceID from the attribute data.
      4. Replace all code writing to the SCADA backend by "LVDimInterface.dis_update_service.vi" using the serviceID from the attribute data. You have to typecast (!) your data to a string and wire that string to "LVDimInterface.dis_update_service.vi".
    2. For each item (tag) that should be received:
      1. In the constructor (or CLASSNAME.ProcEvents), you have to define a "trendmsg" (buffered) or "trendnot" (unbuffered) event.
      2. Assuming your class has inherited from the BaseProcess (or child) class, you will have a method called CLASSNAME.ProcCases. Open that method and go to the "case" with the selector defined in the event definition in the previous step.
      3. The updated values will be received via the "data" input. Use the "CAEObj.unfold trend data.vi" method to obtain information about the received data (timestamp, quality, DIM service name, type descriptor and the "no link" flag). Wire the data output of that VI to the input of a "typecast.vi". Specify the data type of the typecast operation by wiring a "constant" value to the type specifier input of the "typecast.vi". It may be a good idea to check the correct data type prior to typecasting by analyzing the "type descriptor" output of the "CAEObj.unfold trend data.vi".
      4. You do not have to care about unsubscribing from a DIM service, since this is taken care of in the desctructor method of the CAEObj class.
    3. Now, you need to connect DIM services to the SCADA backend. If you use the NI-DSC module as SCADA backend together with the DSCIntProc class, please refer to the HOW-TO of the database and tag tools.

-- AlexanderSchwinn, DietrichBeck - 04 Sep 2006
Topic revision: r16 - 2007-07-12, DietrichBeck - This page was cached on 2024-04-19 - 16:28.

This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback | Legal notice | Privacy Policy (german)