• Skip to primary navigation
  • Skip to main content

Cursos Online para mentes inquietas

  • Cursos
  • Mi cuenta
    • Mi cuenta
    • Foros
    • Curso de AWL
    • Curso Express de TIA Portal
    • Curso de iniciación a la Industria 4.0.
    • Curso de comunicaciones IE y Profinet
    • Curso de WinCC Flexible 2008
    • Crear HMI con OPC y VB.NET
    • Crear HMI con Snap7 y VB.NET
    • Curso HMI con ViSnap7
    • Curso TIA Portal CPU 1200
    • Curso de Step 7 V5.x
  • Contacto
  •  

Realizar gráfica con función senoidal dashboard node-red

¡Uppsss! No estás logueado ¿eres usuario registrado?

Si eres usuario de la plataforma, HAZ CLIC AQUI PARA ACCEDER A TU CUENTA
Después, vuelve a acceder a la plataforma de cursos.

Home › Foros › Curso IOT e Industria 4.0 › Módulo 2. Raspberry e IOT2040 › Realizar gráfica con función senoidal dashboard node-red

  • Este debate tiene 2 respuestas, 1 mensaje y ha sido actualizado por última vez el hace 2 años, 10 meses por JUANPAVQ.
Viendo 3 entradas - de la 1 a la 3 (de un total de 3)
  • Autor
    Entradas
  • 17 julio, 2019 a las 16:36 #8689
    JUANPAVQ
    Participante

    Hola Iñigo,

    Importé los flujos para dibujar la gráfica que generas con:

    var msg1={ payload: msg.payload,topic:msg.topic };
    var msg2={ payload: msg.payload,topic:msg.topic };
    var msg3={ payload: msg.payload,topic:msg.topic };

    var angulo_ant=Number(flow.get(«angulo_anterior»));
    var angulo=angulo_ant+1;
    flow.set(«angulo_anterior»,angulo);

    msg1.topic=»Variable 1″
    msg1.payload =10000+10000*Math.sin(angulo/360)+1000*Math.sin(angulo/36);
    msg2.topic=»Variable 2″
    msg2.payload =10000-(10000*Math.sin(angulo/360)+1000*Math.sin(angulo/36));
    if (angulo%2===0)
    {msg3=msg1;}
    else
    {msg3=msg2;}
    return [msg1,msg2,msg3];

    No me genera la gráfica, al utilizar el nodo de debug veo que los mensajes me arrojan NaN en el payload.

    <span class=»debug-message-topic»>Variable 2 : msg : Object</span>

    <span class=»debug-message-payload»><span class=»debug-message-element debug-message-top-level built»><span class=»debug-message-row debug-message-expandable»><i class=»fa fa-caret-right debug-message-object-handle»></i><span class=»debug-message-type-meta debug-message-object-type-header»>object</span></span></span></span>

    <span class=»debug-message-element»><span class=»debug-message-row»><span class=»debug-message-object-key»>payload</span>: <span class=»debug-message-object-value»><span class=»debug-message-type-number debug-message-object-header»>NaN</span></span></span></span>

    <span class=»debug-message-element»><span class=»debug-message-row»><span class=»debug-message-object-key»>topic</span>: <span class=»debug-message-object-value»><span class=»debug-message-type-string debug-message-object-header»>»Variable 2″</span></span></span></span>

    <span class=»debug-message-payload»><span class=»debug-message-element debug-message-top-level built»><span class=»debug-message-element»><span class=»debug-message-row»><span class=»debug-message-object-key»>_msgid</span>: <span class=»debug-message-object-value»><span class=»debug-message-type-string debug-message-object-header»>»8ad5c224.e36b»</span></span></span></span></span></span>

    ¿Tendrás alguna idea de porque ocurre?

     

    Saludos

    JPVQ

     

    Ing. Electromecánico

    17 julio, 2019 a las 16:38 #8690
    JUANPAVQ
    Participante

    {«payload»:null,»topic»:»Variable 2″,»_msgid»:»3bb13746.a32328″}

    Ing. Electromecánico

    17 julio, 2019 a las 16:47 #8691
    JUANPAVQ
    Participante

    Creo que ya encontré la solución, presioné el botón de reset para inicializar la variable «angulo anterior» y empezó a arrojar valores como corresponde.

     

    Saludos

    JPVQ

    Ing. Electromecánico

  • Autor
    Entradas
Viendo 3 entradas - de la 1 a la 3 (de un total de 3)
  • Debes estar registrado para responder a este debate.
Acceder
  • Aviso Legal y Política de Privacidad
  • Condiciones de Venta
  • Política de cookies

Copyright © 2022 · Programación Siemens · Todos los derechos reservados

· ¿Quién soy? · Misión, Visión y valores

Utilizamos cookies propios y de terceros para mejorar nuestros servicios y tu experiencia de usuario. Si continuas navegando, consideramos que aceptas su uso. Aceptar Más información
Política de Cookies

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Siempre activado
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
GUARDAR Y ACEPTAR