Skip to content

Translator improvements

Lubomir Jagos edited this page Jun 27, 2016 · 3 revisions

Translator is part of every library which provides way how to translate VI blocks into arduino code. For every user defined VI there has to be case in case structure with code lines to say compiler how to transcript blocks. Whole translator looks like this:

translator

There are inputs and outputs for actually translated block and result output code. You can also include library files.

When I started to implement my own functions I needed to use some global variables to be able implement intended functionality. Many libraries for arduino are implemented as classes so to use them you need create object. First I was thinking that I would be able to create VI which will create this object but after thinking I didn't find how to that so instead I modified slightly Translator.vi and put there this: translator improvement

If I want to declare global variable it's including empty.h file, which is really empty header file and after that put my code. In this way I can put into beginning of generate sketch my own code. I write here into beginning, because list of include files is processed by Arduino Compiler for LabVIEW and is put at beginning of sketch.