OpenECoSys-NetworkViewer Support for Arduino (Scope Demo)

Graynomad:
Hi Dominic,

Very interesting.

visualization of internal variables in real-time.

How do you gain access to the internal variables? I ask because I have a monitor program

http://arduino.cc/forum/index.php/topic,54005.0.html

that does this to a degree and is very non-intrusive but I'm interested in other approaches.

Another interest I have in NetworkViewer is as a start for a GUI for my debugging tool

http://arduino.cc/forum/index.php/topic,72014.0.html

I planned to write this in .NET but hate the fact that it's bound to Windows and QT seems like a much better option.

Could I use your code as a base for my GUI?


Rob

Hello Rob,

You gain access by defining a shared memory area where the serial / CAN / Ethernet protocol can read and write using the NetworkViewer. The idea is simply to make sure the shared memory is protected (no interrupts can occur) when the protocol accesses it. Be careful, the protection is not yet implemented in the Arduino version since I didn't know how to block interrupts in an "hardware independent" manner (reusable code for PIC32 & Atmel based microcontrollers). So everything runs in the main loop. This would be problematic if you access the shared memory from an interrupt for instance. If you know how to fix that, please tell me!

In your program, you simply use the variables in the shared memory area, so they correspond to the state of the system when they are read by the protocol. I hope this makes sense!

For the GUI, you can use the GPL code of the NetworkViewer. You can also build a plugin for the NetworkViewer that would display the GUI interface you need using all the communication abstraction and plugin mechanism built into the NetworkViewer. I can help you getting started if required.

I agree that Qt is much better suited for portable applications. Using Qt allowed NetworkViewer to run on Linux, Mac, Windows with very little portability problems. However, mono is also interesting if you prefer coding with .NET. http://monodevelop.com/

Dominic