It's not possible to use the contouring mode in an onboard program like you did it in your example. The reason is that while the program is downloaded the write buffer.flx is NOT executed. Thus it can't download the buffer data stored in your front panel arrays. When you start the onboard program later it doesn't have access to your buffer data on the front panel.
In fact I don't see a real advantage why you would like to run the write buffer.flx in an onboard program. You could configure and download the buffer on the host and then use it in an onboard program.
Best regards,
Jochen Klier
NI-Germany