Giter Club home page Giter Club logo

omjson's Introduction

Info

Package is provided by Loupe
https://loupe.team
[email protected]
1-800-240-7042

Description

This repo provides packages for communicating with a B&R PLC using WebSockets and a JSON interface. This allows the PLC to act as a server for a Loupe UX client.

Library Package

The OMJSON library package bundles up the function blocks needed in order to run the WebSocket server and read/write to PLC variables.

Program Package

This repo also contains a program package that can be deployed to run the OMJSON-based webserver.

Installation

To install the program package using the Loupe Package Manager (LPM), in an initialized Automation Studio project directory run lpm install luxprog. Note that this will also pull in the library package as a dependency. If you only want to install the library package, run lpm install omjson.

For more information about LPM, see https://loupeteam.github.io/LoupeDocs/tools/lpm.html.

Documentation

For more documentation and examples, see https://loupeteam.github.io/LoupeDocs/libraries/omjson.html (or you can run lpm docs omjson).

Licensing

This project is licensed under the MIT License.

omjson's People

Contributors

andrewmusser avatar anmusser avatar jcjakeway avatar lawrencegsullivan avatar sanhhphan avatar sclaiborne avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

omjson's Issues

Clients dont know their connection ids

What

The webhmi server (OMJSON) should send a clientID variable back to the Client.

Why

A webhmi client needs to know its so it can "take" resources and potentially do other smart things with the PLC

WriteResponse does not properly type variabels in message

WriteResponse currently can contain variables with the incorrect type representation. For example if you have a variable num of type UDINT.

{
  "type": "write",
  "data": {
    "num": 52,
}
{
  "type": "writeresponse",
  "data": {
    "num": 52,
}

as it should but...

{
  "type": "write",
  "data": {
    "num": "52",
}
{
  "type": "writeresponse",
  "data": {
    "num": "52",
}

This is incorrect, the write response as the server should always respond with the the value and the correct type. I would expect:

{
  "type": "write",
  "data": {
    "num": "52",
}
{
  "type": "writeresponse",
  "data": {
    "num": 52,
}

Lux client connection error

Describe the bug

The jsonWebSocketServer FUB reports error 50004 when a Lux client first attempts to connect. The ErrorString reported is THAT$'s NOT POSSIBLE. The issue only appears intermittently, and appears to primarily occur after doing a clean, rebuild, followed by an offline install. Note that this has only been tested/seen in simulation.

When the issue first appears, the jsonWebSocketServer.ClientInfo[0].ClientPort is continually incrementing, which shows the the ws connections are getting closed or dropped, and being re-established.

To reproduce

Follow the LPM bootstrap guide here: https://loupeteam.github.io/LoupeDocs/tools/lpm/guides/bootstrapping-a-project-with-lpm.html

Expected behavior

The client should connect automatically when the HMI is started, and the ClientPort should keep a fixed value. There should be no error on the FUB.

Additional information

Happens with version 1.4.0 of OMJSON.

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.