Start a new topic

Can't add variable to waveform?

I'm working on a small demo project.  On my Nextion page, I've got a waveform control, a progress bar, a timer and a variable.

I started out trying to do this in the timer event:
  add 4,0,va0.val         //4 is the ID of the waveform control
...but the number added to the waveform always appears to be zero.

So then I tried (in the timer event):
  add 4,0,va0.val    //Also tried "add 4,0,j0.val", same result

With that code, I can see the progress bar increasing in value, but again the waveform just shows a flat line at the bottom.

It looks to me like the "add" command doesn't work with variables?  It would be nice to have that fixed if possible.

3 people have this problem

I'm sorry, I've tested it, and it's really no good, we'll think of a way to update it in a later version. I hope you are patient. Thank you for your letter!

2 people like this

Tu, You have spaces within your add command.

With the exception of the single space after add, there should be no other spaces.

This is a general rule for all commands - no embedded spaces within the parameters.

1 person likes this

BUG still exist in version 0.34.

Pleas Nextion DEV help us!

1 person likes this

The current waveform implementation is expecting numeric values and cannot be parsed variable.


   add 1,0,0 ... add 1,0,37 ... add 1,0,255

The way it was implemented allows a connecting MCU to pass values, but not via Nextion variables.

Thanks for your reply.

But I tried with the number, also same error :(

Oopps, remove spaces and it works!

Great thanks! Sorry for silly question :P

I have the same problem.

Bug is still in the latest version V0.31 :-(


9 months are a very long time, solved the problem in 2016 ?

Devs promised to fix in the next release

Same problem in 0.36 :( any workarounds?

Hello ! Is this problem solved in Version V0.30 ? Thank You !


Now I use 0.39. And cannot add value to waveform also.

It's always said: "Error: Invalid Variables: 0( Double click to jump to code)"

add 1, 0, h0.val

Waveform ID is 1, 1 channel.

h0 is a slider with min=0, max=255

Also tried which others options, but still cannot.