Code Monkey home page Code Monkey logo

structreferencetest's Introduction

Problem Description

PLC:

  • ST_StopStatus: PLC custom type containing 5 boolean variables.

  • ReferenceBlock: PLC function block containing two variables:

    • stStopStatus: ST_StopStatus
    • refStopStatus: REFERENCE TO ST_StopStatus

    refStopStatus is set to reference stStopStatus

We have one instance of ReferenceBlock in MAIN, called fbRef

HMI:

In our HMI Project, we map PLC1.MAIN.fbRef from the PLC.

We have two custom usercontrols:

  • StopStatus.usercontrol: 5 checkboxes, mapped to the booleans from ST_StopStatus
    • Parameter: ST_StopStatus, using PLC ST_StopStatus type
  • StructAndReference.usercontrol: Contains 2 of StopStatus.usercontrol. The left one is mapped to Dev_ReferenceBlock::stStopStatus, the right one is mapped to Dev_ReferenceBlock::refStopStatus
    • Parameter: Dev_ReferenceBlock, using PLC ReferenceBlock type

On our Desktop.view, we have one StructAndReference.usercontrol. This is mapped to PLC1.MAIN.fbRef. Below that, we have two of StopStatus.usercontrol, mapped directly to PLC1.MAIN.fbRef::stStopStatus and PLC1.MAIN.fbRef::refStopStatus.

The two controls on the bottom are able to access the PLC variables, including the "REFERENCE TO" variable. When mapping the entire PLC1.MAIN.fbRef to the StructAndReference usercontrol instance, the stStopStatus mappings work as expected, but the refStopStatus variable is not mapped through.

Looking at the Live View debugger, it seems that TwinCAT HMI is not actually creating the symbol for refStopStatus when it is mapped through a usercontrol parameter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.