Start a new topic

Waveform

Hello, I have design a waveform chart with 420x255 pixels (420 for X axies & 255 for Y one)

I dialog with a SBRIO and labview with RS232. When the screen is ready , it send a FE FF FF FF , The sbrio send the data and the screen return FD FF FF FF and so on.... At the end of the 420's datas , nothing happens. I saw on the debug mode that the screen slides on the right or on the left. It doesn't work for me , i didn't receive FE FF FF FF......


Regards


 just post your HMI ... otherwise it is hard to say what goes wrong ...

NX4832K035_011R ehanced model

 HMI is not the Display-Model ... HMI is your Nextion-Editor Project-File ... :-)

sorry

rar
I just checked quickly ...

when you send the data correctly, the waveform also act correctly ...

 

mp4

yes waveform act corretly . I receive FE FF FF FF, then SBRIO send the value. After I receive FD FF FF FF......... but At the end of the graph, nothing happens.

The demo mode works correctly as your video.

check your code logic ...
the Nextion is doing exactly what you code ...

if the result is not as expected, obviousely something inside your logic must be wrong ...


 

off course, but I idon't know what happens with the debug mode (generation of  random number)

Shall I do something special at th end of the graph to have rolling?

Re-Review add and addt commands of the Nextion Instruction Set

These are the only two commands that can insert data into a Waveform.

add inserts single value

addt inserts many values, (the one you use - 0xFE and 0xFD is addt)


regardless of any other code on waveform page

       your command of addt 1,0,1 will go through entire steps of

         - wait for 0xFE 0xFF 0xFF 0xFF

         - then you must send the 1 single requested byte value

         - wait for 0xFD 0xFF 0xFF 0xFF

       according to your code this 1 single byte value is inserted left on waveform.

   this you do in a loop until va5 is 421

     - so starting at 0, you must repeat your "wait-send_byte-wait" for each of the 420 bytes

AND all of that is what you request to accomplish every 50ms of timer when start is =1

Furthermore, I have to imagine that the release event bytes interfere part way between


To accomplish 420 waveform byte values in the manner you attempt

 - at best conditions with zero delays you have 3787 bytes (420*(4+1+4)+7)

   in 50ms, needing a baudrate of 757400 in perfect scenario

     much too fast Nextion baudrate.


Waveform works like this.

  - add a value for a channel,

      it is placed next to draw.

      it is drawn at next position

  THIS keeps going across the waveform canvas until FULL.

  when full, 

     add value to channel,

        it is placed next to draw

       position to draw at is last of waveform canvas

       all of waveform values slide one pixel

       value is drawn at last position.

  THIS is accomplished without user intervention

    user only needs to add values and ta-da!


Your code should probably be concerned with adding value when it has value to add.

For this, I recommended re-review add and addt commands


when only adding 1 byte there is no sense in using an addt multibyte

    - wait for 0xFE just to send one byte value, and wait again for 0xFD.

instead the add command carries only one byte value.

  seems more perfect for 1 byte.


But when trying to add 420 values (assuming 420 values are available)

then addt can request multiple bytes (there is a max in single shot)

  addt 1,0,100  will go like this

     wait for 0xFE

     send 100 byte values at once

     wait for 0xFD


which scenario is right for you, depends on when data is available.

   

Hello, i understand that with this code here; the graph stop after 420 values


if(va5.val<420)

{

  if(bt0.val==1)

  {

    va5.val++

    addt 1,0,1

  }else

  {

    va5.val=421

  } 

}


How can I use add function (without FE FF FF FF & FD FF FF FF) and receive data from uart?

Does I send in EEPROM my data and after do this?


add 1,0,data in eeprom


If I succeed with it, I can start sending value from SBRIO when the operator touch the "start button" by the function called "send component ID" and stop it when SBRIO receive the ID of "retour button"


Hello, I try to play with add function and UART. I put a double state button. In tm0, i check the state of it , I send printh 7F to uart to say to the SBRIO that It could send a data to eeprom. I read this data and I put it in add 1,0,va0.val. It doesn't work well. I think I have to find a good value for  tm0.tim

 

Regards

HMI

image


Sorry,  you are much confused in your understandings.


add 1,0,data  ... does not go to eeprom,

   it goes to waveform of current page with id 1 on channel 0

   and adds the point data at next position.


An EEPROM available on the Nextion Enhanced models is

    a 1K chip that is completely independent of a waveform

  - eeprom commands in the Nextion Instruction Set

     include:  wept, rept, wepo and repo


Commands add and addt are specific to a waveform.


You are tripping over your coding logic,

   now trying to get multiple band-aids on broken code.

Perhaps starting from scratch may produce faster path to results.

 - waveform has been plaguing you for over a month now.


An MCU is going to do exactly as told to do, nothing more nothing less

What is not purposefully programmed will produce unexpected results.

Tossing in bells and whistles before functionality, get in your way.

 - you have events working out of your control - hence does work right.

Strip it back to the basics and rebuild it back up - but purposefully.


So what is the specs of an SBRIO, and what is purpose of waveform?


Login or Signup to post a comment