Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Monitor data from Netduino in Visual Studio


  • Please log in to reply
3 replies to this topic

#1 vader7071

vader7071

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationDothan, AL

Posted 17 December 2013 - 08:24 PM

My background is Allen-Bradley PLC programming.  Old ladder logic.  One nice aspect of the programming software I use is I can watch the program run and see the values in various memory locations as they change.

 

Is there a way to do this on a Netduino and Visual Studio Pro 2012?  I have a program that generates random numbers and is there a way I can view those memory locations live as the program runs to see the effect?  The end game is I will be putting in an external signal into the Netduino (PWM signal in from an RC controller) and I want to see the values showing up so I can adjust what I need to.



#2 Kip

Kip

    Member

  • Members
  • PipPip
  • 22 posts
  • LocationItaly

Posted 17 December 2013 - 10:56 PM

You can set a breakpoint (click on the left side of a line of code, or press F9) to stop execution of the program at the point it is set.

Or you can use the Debugger.Break() function.

 

When execution is stopped you can check and alter the value of each of your variables.

 

If you just want to output values, you can use Debug.Print(), which will output a string on VS output console.

 

Of course none of these work during normal execution, you must be actively debugging your code (by pressing F5 while in VS)

 

If you want to output data even during normal Runtime, you can use the SerialPort class to send it via one of the Netduino serial ports. Then you can use any kind of serial adapter (RS-232 via MAX3232 chips, USB via FTDI chips or HC-05-like Bluetooth adapters) to receive those values on your pc (or any other kind of compatible device, like a smartphone)



#3 vader7071

vader7071

    Advanced Member

  • Members
  • PipPipPip
  • 132 posts
  • LocationDothan, AL

Posted 18 December 2013 - 02:48 PM

So short of connecting a display of some kind, there is no real way to watch real time what the values are?

 

But I can use the breakpoint and kinda "force" my values to see what is coming out?

 

Cool.  I'll play with this.  Thanks!!



#4 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 18 December 2013 - 03:40 PM

You can display variables in Visual Studio while the program is being executed with debugger attached using Autos, Locals and Watch windows. You can enter the variable name in the Watch window or right click a varible name in your code and select "Add Watch".

 

You can also display raw memory contents in Memory windows, enter a variable name (such as a byte array) in the Address field.

 

Usually, Autos, Locals and Watch windows appear automagically during debugging, i.e. when the program hits a breakpoint or is being stepped through. You might not notice them right away, depending on Visual Studio window layout settings, they can be in different tab or not visible initially, use menu commands to make them visible (menu Debug/Windows, after you start the application in the 'debug' mode, usually F5).






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.