Showing results 1 to 6 of 6

Thread: Nested structured Data types

  1. #1
    Join Date
    19.10.2010
    Posts
    24

    Daumen runter Nested structured Data types

    Hello,

    I have create a Structure date type in Zenon 6.51.
    It type name is ckt it has two elements current int and kwh real.
    I then created a structure data type called panel it has one element called
    ckt1 of type ckt. What would like to do is create a variable of type panel named p1 in this example and access the values in this fashion.

    p1.ckt1.current and p1.ckt1.kwh

    So far when I look at this variable in Zenon the ckt1.current and ckt.kwh part are "greyed out" and I can not make them active. I am trying this with the modbus energy driver.

    Are there examples or rules for doing nested structure date types?
    Thanks.

  2. #2

    Default Re: Nested structured Data types

    which driver object type did you use for your variable "p1"?

    Note, that you can only use the driver object types (areas) "Register" or "Input Register" when you are using the modbus energy driver. Other areas, like "Coil" do not support the datatypes "real" and "int" which are required by the structure type "ckt".

    However when you create your variables through the user interface, you should not be able to pick the type "panel" when creating a variable "p1" from the type "coil".


    Did you set the option "activate all" on creating the variable?

    If you haven't, you should be able to activate the variables either in the context menu for each single item (current, kwh), or in the context menu of the variable "p1", or in the context menu of the structure element "ckt1" in the datatypes at the option "activate all items based on that"


    Click image for larger version

Name:	ScreenShot245.png
Views:	27
Size:	26.1 KB
ID:	554

    Click image for larger version

Name:	ScreenShot246.png
Views:	20
Size:	55.7 KB
ID:	556

  3. #3
    Join Date
    19.10.2010
    Posts
    24

    Default Re: Nested structured Data types

    Mark,
    I used the Modbus Energy drive for P1 of type registar. The first issue was not expanding the selection.
    P1.ckt1 is alway greyed out with no + sign. When I right click and click on expand selection or expand all I see my variables current and kwh. I can drag them on to numerical value symbol but can not pick the
    pick the variable from Variable/function property selector. All seems to be working except I have an addressing issue and am not seeing values in my device.

  4. #4

    Default Re: Nested structured Data types

    There are several ways of addressing structure variables.

    You can do it all manually for each structure element you can define all the addressing information, except the driver and the variable object type.

    You can also use automatic or semi-automatic addressing, based on the datatypes of the structure elements and a start offset. Automatic addressing is the default option for a new structure variable. This may however not fit how the information is located in your PLC.

    In case there are boolean variables in the structure, you can set whether each boolean variable should start with a new offset, or should use the bitnumber for 8 or 16 bits for one offset, depending on how the information is stored in the PLC. (byte oriented or word oriented)

    With automatic addressing you have a preview of the offsets for the structure elements. I would check this and if not correct, change to manual addressing for each structure element.

  5. #5
    Join Date
    19.10.2010
    Posts
    24

    Default Re: Nested structured Data types

    Mark,

    Thanks again for your reply. Automatic addressing is working for me know. I have found that when I change addresses and create runtime files and refresh this does not propagate the change. After I exit and restart the drive the variables start reading from the new addresses. I would prefer not to have to do this to make address changes show up in runtime. I am new with Zenon and there may be a better way.

    Bill

  6. #6

    Default Re: Nested structured Data types

    When you change the addressing information, then compile the changed runtime files, you should see in the output window that the "variables.cmp" file is compiled. If this is not the case, please make sure that the project where you make the changes is the active project, (for which the runtime files are compiled) or alternatively that you right click the project and choose the correct project to compile runtime files for.

    After compiling the runtime files, you may need to transfer these to the PC with the runtime first (if it is not running on the local PC). In case of a network project, you need to transfer the runtime files to the PC that is the server for the project.

    When the runtime files are on the runtime PC (or compiled when the runtime is on the same PC as the editor), you need to execute the zenon function "reload", to take over these changes.

    Please note, that the reload function is project specific. When you have multiple projects in the runtime (integration project and sub-projects) you need to execute the reload in the correct project.

Similar Threads

  1. Polling data
    By skywalker in forum zenon Energy Edition
    Replies: 1
    Last Post: 27th February 2010, 00:10
  2. Data highway??
    By scotttee in forum Drivers
    Replies: 1
    Last Post: 17th July 2009, 06:22
  3. Same pciture for different data
    By matholton in forum zenon Supervisor
    Replies: 2
    Last Post: 8th October 2008, 09:21
  4. Delete structured tag
    By fabios in forum VBA
    Replies: 8
    Last Post: 28th July 2008, 14:39

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •