locked
MRDS with ethernet device RRS feed

  • Question

  • I'm new at MRDS.  I want to send/receive data via ethernet and am wondering how to do it.  I have a board (Modtronix SBC65EC) which runs a web server on board with a microcontroller.  Using DHCP, one can just open a browser, enter the URL of http:://mxboard and then click on buttons in the web app to manipulate I/O lines.  The manual for the board lists GET and also UDP commands.  I'm wondering how to set up a service to do this. 

    Thanks, Kerwin
    Thursday, August 20, 2009 9:29 PM

Answers

  • I'd say start by looking at the WebCam sample.  It's showing how to connect to a web device and get/post pages.  That should get you communicating with it.

    As for the exposed service, that depends on the board.  In your case you've got quite the multitude of sensors exposed: Digital I/O, Analog, PWM.  Again for myself, I'd make a dedicated service to talk to the board which exposed 'private' interface to a set of public services that present the known interfaces (e.g. ContactButton, Motor, ...).  Those public services would then be available generically for whatever you write as the high level.  This would give you the option of swapping out the board with something else if you desire.  All that you'd need is something to present the same high-level interfaces.

    Ed
    Friday, August 21, 2009 2:19 PM
  • Maybe Ed was thinking of the IP Camera sample which does web requests to a particular IP address. It's not quite a general-purpose Ethernet send/receive sample though. You might also want to look at the ASP.NET sample which shows how to do aynchronous web requests.

    .NET has built-in support for UDP that is quite easy to use. Getting it into the CCR/DSS environment is a little more tricky because you need to use a wrapper.

    Trevor
    Wednesday, August 26, 2009 1:28 AM

All replies

  • I'd say start by looking at the WebCam sample.  It's showing how to connect to a web device and get/post pages.  That should get you communicating with it.

    As for the exposed service, that depends on the board.  In your case you've got quite the multitude of sensors exposed: Digital I/O, Analog, PWM.  Again for myself, I'd make a dedicated service to talk to the board which exposed 'private' interface to a set of public services that present the known interfaces (e.g. ContactButton, Motor, ...).  Those public services would then be available generically for whatever you write as the high level.  This would give you the option of swapping out the board with something else if you desire.  All that you'd need is something to present the same high-level interfaces.

    Ed
    Friday, August 21, 2009 2:19 PM
  • Maybe Ed was thinking of the IP Camera sample which does web requests to a particular IP address. It's not quite a general-purpose Ethernet send/receive sample though. You might also want to look at the ASP.NET sample which shows how to do aynchronous web requests.

    .NET has built-in support for UDP that is quite easy to use. Getting it into the CCR/DSS environment is a little more tricky because you need to use a wrapper.

    Trevor
    Wednesday, August 26, 2009 1:28 AM