Giter VIP home page Giter VIP logo

Comments (3)

simon-smith avatar simon-smith commented on August 28, 2024 1

Hi
I now realise where you got the example code from. This is example is pre-CFX agreement. It is from the early days of when we were looking at message structures. I have asked that this example be removed from the documentation.
Currently there is no mechanisium for adding alternative State enumerations. Having said that we are looking to add new states in V1.1. I already have a list of additional states required. If you let us know what you would like adding the A-team (the CFX overwatch team) will look at them and add as required.
Sorry for the confusion.
Simon

from cfx.

simon-smith avatar simon-smith commented on August 28, 2024

Hi
I am not sure you fully understand the methodology for the StationStateChanged and StageStateChanged messages.
A typical message would be:
{
"OldState": 2200,
"OldStateDuration": "00:01:25",
"NewState": 1100,
"RelatedFault": null
}
Where the OldState and NewState enumerations are defined here. [http://www.connectedfactoryexchange.com/CFXDemo/sdk/html/T_CFX_Structures_ResourceState.htm]
So in the example above:
OldState was "Standby. No Product (Resource is Starved)"
New State is "Productive Time. Regular Work"
It is not a case of state On or Off, but what condition the system of stage is currently in and what was it's previous state.

I hope this helps.
Simon

from cfx.

PhotonDan avatar PhotonDan commented on August 28, 2024

Thanks for the response!

I do understand that ResourceState is an enumeration of values corresponding to system condition descriptions, but what I was stuck on is that within the list of enumerated values you have things like SBY_NoProduct = 2200 and PRD_RegularWork = 1100, but there is no value defined for On or Off... yet the On and Off appear in the example code shown on the Getting Started with the SDK page.

private void btnSend_Click(object sender, EventArgs e)
{
CFXEnvelope msg = new CFXEnvelope(new StationStateChanged()
{
NewState = ResourceState.On,
OldState = ResourceState.Off,

OldStateDuration = TimeSpan.FromMinutes(43)
});

 theEndpoint.Publish(env);

}

I was trying to determine if it is considered acceptable practice to have ResourceState values that are not explicitly listed on the original enumeration definition.

from cfx.

Related Issues (20)

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.