Wrapping SoftwareSerial arduino library for Arduino Compiler for LabView
So I spent last two days playing with Arduino compiler for LabVIEW. From beginning I thinked that it would be pretty easy. After that I found problems which looked first terrible, but solution was pretty easy (how other :D) So basically I spent two days looking for wrong path to find the right one in front of me.
So what I was trying? I know that one of most useful libraries in arduino API is SoftwareSerial, because we can use it with every part which has UART attached. So I started with reading how to port arduino libraries into LabVIEW. There is VI called 'Template' which is running everytime when LabVIEW is looking for native arduino functions. This VI is only generating arduino code file which is after that compiled by arduino compiler.
So I have to somehow put somewhere inside code SoftwareSerial variable a wrote wrapping functions. In the end I solved this situation putting pointer for SoftwareSerial after 'includes' directives and in setup I created new object SoftwareSerial. It's really important put pointer definition into global space to see this UART from whole application.
Here are som notices for Arduino Compiler for LabVIEW:
- Whole new library has to be placed in folder '..\Program Files\National Instruments\LabVIEW 2014\vi.lib\Aledyne-TSXperts\Arduino Compatible Compiler for LabVIEW\' at least mine is there, this is location where these interface VI's has to be placed to compiler knows that they are representing arduino functions
- Be patience when porting Arduino libraries for LabVIEW
- Test, test, test ... more different boards better
It's still not finished and I have to test it, but what I learned in short:
- Embedded is memory constrained, code doesn't have to be cool pretty, more depends if it's running and how much memory it occupies
- Many things are not running how I think in beginning
- Sometimes restart MCU or my working PC is more than 2hours sitting and thinking where is mistake
Attachements, links
Spat