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

Class Library for WinForms App


  • Please log in to reply
5 replies to this topic

#1 F4r14

F4r14

    New Member

  • Members
  • Pip
  • 3 posts

Posted 14 September 2011 - 10:53 AM

Hello, I'm trying to create a class library to monitor a netduino digital inputs and throw an event (not a native one but one I've created) everytime a DI passes from Low to High state. In my opinion it would be quite simple but for some reason when I try call the class in a WinForm app I've created in a new solution I get the security exception "ECall methods must be packaged into a system module." Any ideas? Thanks in advance.

#2 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 14 September 2011 - 11:05 AM

Hi F4r14 and welcome to the Netduino boards! If I read this correctly you want a windows app controlling the Netduino-pins? That will be difficult; the Netduino runs code on it's own board without computer. So you deploy an application to the Netduino and will be executed there, not on the PC. You could create a link, with a serial port for example, but then you need to code both a windows app and a netduino app.
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#3 F4r14

F4r14

    New Member

  • Members
  • Pip
  • 3 posts

Posted 14 September 2011 - 11:41 AM

Hi F4r14 and welcome to the Netduino boards!

If I read this correctly you want a windows app controlling the Netduino-pins? That will be difficult; the Netduino runs code on it's own board without computer. So you deploy an application to the Netduino and will be executed there, not on the PC.

You could create a link, with a serial port for example, but then you need to code both a windows app and a netduino app.


Thank you for your quick reply. Yes, that was what i inteded. For some reason i got the idea i could access the pins state through USB using the code shown in the examples.
If i was using Netduino plus would i be able to send the data through TCP/IP? The methods used to program TCP/IP communication in Netduino are the System.Net.Sockets?
Regards.

#4 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 14 September 2011 - 12:37 PM

If i was using Netduino plus would i be able to send the data through TCP/IP? The methods used to program TCP/IP communication in Netduino are the System.Net.Sockets?

Yes you could open a socket over TCP/IP and send data in both ways.
With a normal Netduino you could use a serial connection (can also be USB!) but it won't be using the Netduino API on the Windows PC; you should write your own transfer protocol and communicate from the PC to the app inside the netduino.
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#5 F4r14

F4r14

    New Member

  • Members
  • Pip
  • 3 posts

Posted 14 September 2011 - 03:10 PM

Yes you could open a socket over TCP/IP and send data in both ways.
With a normal Netduino you could use a serial connection (can also be USB!) but it won't be using the Netduino API on the Windows PC; you should write your own transfer protocol and communicate from the PC to the app inside the netduino.


Just found an example using a "FTDI Basic breakout 3.3V". If i got it right it uses a Serial Port Emulator (PC) to receive the data sent from Netduino. It's a regular USB cable, right? So I would need a Netduino, the FTDI BB 3.3, USB cable, VCP driver and some lines of code for Netduino and PC app. Am I missing something?

[http://forums.netdui...t-code-review/]

Regards.

#6 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 14 September 2011 - 03:16 PM

Just found an example using a "FTDI Basic breakout 3.3V". If i got it right it uses a Serial Port Emulator (PC) to receive the data sent from Netduino. It's a regular USB cable, right? So I would need a Netduino, the FTDI BB 3.3, USB cable, VCP driver and some lines of code for Netduino and PC app. Am I missing something?

[http://forums.netdui...t-code-review/]

Regards.

You are quite correct. The break-out offers a serial-to-mini-USB connector:
http://wiki.netduino...-to-Serial.ashx
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs




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.