Computer Communication

Hello all,

So I got my Panda, made LEDS blink off and on, setup my DC motor driver component with some help here (thanks), and also got the temperature component to work, so fun.

Well, I have a quick question…

Being a completely new person to computer programming, how would I approach a Windows form program with FEZ, I realize it would be a C# program for the Form and a NETMF program for the FEZ.

Say I want to create a field on a Windows form app to display the temperature reading that the FEZ is collecting.

What is the best (easiest) strategy for having a computer program communicate with the FEZ program. I read alot of Serial in the ebook or was it the tutorial, or is there a way to use the USB on the Panda to talk with the computer?

If serial, then I would have to have the FEZ Panda setup to send/receive serial comm and also a Windows Form app?

Any direction would be great.

This would be for stand alone programs, not for debugging but actually install the program on the FEZ then install the Form App on a laptop.

Mike in MN

When I develop a windows program to display various items… I tend to use VB. Like Visual C# the VB2010 express edition is free to download. Its very easy to create quick interfaces and you can produce stand alone programs (there is an inexhaustable supply of sample programs in VB on the net)…

Vb has serial and USB components installed.

Cheers Ian

Thanks IanR, I will look into it.

Do you have any direction where to look to understand how to interface with VB or C# for that matter with USB?

Mike in MN

Mike, I think you are confusing yourself. Put it simple, what are you trying to do?

Well ultimately build my underwater ROV but…

In the short term learn how to have the FEZ communicate a reading like temperature to a computer program to display it in a Windows Form Application (GUI).

I am trying to start out slow, maybe not slow enough. But I figured maybe something simple like transmitting an integer like the temperature reading, and transmit it to a Windows Form could be pretty basic via either Serial via RS232 or USB?

Overall I figure if I can get something like one number transmitted, then anything else should be possible??

Like I said, I am a newbie, that gets confused with all the programming stuff. I will say that the blinking lights and temp component was FEZ, I just wish it all was…LOL

So just for a practical application, have FEZ read temperature, plug FEZ in to laptop and have an app on the screen that shows the reading. Almost like using a display on FEZ, but having a Windows app display it. (ok, maybe not practical, but just trying to learn with what I got).

Mike in MN

start with a standard serial (RS-232) connection between the fez and your pc. You will then need to work out a protocol between your devices. Start with something easy like ’ temp:23.75’ on each line. Your fez writes that out the serial port and your pc reads it, sees the ‘temp:’ part, converts the numbers into a float amd writes it into a text box.

Ok good then your first step should be to send some data to pc and display the data using teraterm software.

After that is working we can talk about writing your own pc software. I highly do not recommend vb. You are already learning c# for fez then why not use the same language to program your pc

Thanks Gus and Heffo, I will try that.

I agree, since I am trying to learn the language, should stick with one, no need confusing myself even more.

I will start playing with just transmitting a simple text string, but not “Hello World!”…lol

Maybe “FEZ will show me the way!”

Then work on the collecting and transmitting the temperature part later once I get the transfer part understood.

Mike in MN

Darn, don’t have a serial port on my main computer, gonna have to set up on one of the other ones…lol

Mike in MN

Mike, i’d also recommend writing the windows app in C#. You’re already doing C# it’s just going to confuse you to learn another language that you don’t need to.

Get yourself a USB to TTL serial port. If you can’t find one, paypal me $20 and i’ll mail you a very nice one with flashy led’s that tell you there is data going (very important to know that something is happening lol).

If you get a standard serial port you’re going to need to get a MAX232 (or other) level converter for it to convert it to TTL serial from RS-232.

MarkH… I did buy the RS232 shield, so would that be enough instead of the MAX232 TTL serial converter??

And trying to understand all of it, I have 2 computers set up here, (without the Express or GHI software on them) with serial ports.

If I just set one of those up with C# Express and loaded it with the SDKs (GHI and NETMF) with TeraTerm, that configuration should work in the interm, just to get things rolling?? Right?

Mike in MN

PS, told you I was a newbie… :-[

Hi CNCMike,

the RS232 shield replaces the need for a MAX232->TTL converter. If you check out the CuteDigi website you can see their schematics, they actually use a MAX232 chip.

are you actually a CNC guy? I’d love to see a CNC with a Fez running it.
I would love to build a CNC some day, but I reckon you want someone with a CNC to cut the parts for a CNC (I have no machining/accurate cutting capability or tools). Almost like the old reprap / chicken-and-egg thing :slight_smile:

Ref Gus:

Why are you so quick to dismis VB… It serves me very well and its the best RAD tool out there.

As a programmer of nearly 20 years I find the knowledge of several languages a boon… It will certainly help the younger ones to under stand class culture better. MY current apprentice has used VB to grasp the understanding, and now has a better knowledge of C#…

I also agree that visual c# has all the functionality of VB, but I doesn’t hurt knwing both.

Cheers Ian

No one said vb is no good. Learning 2 languages at the same time is a very bad idea. Our friend is already learning c# so don’t you think it will be to much for now to ask him to learn vb?

I suppose

Looks like he’s already decided… If he needs help with either I’ll still be listening…

Like I’ve said before… Too long I have walked alone.

Cheers Ian

For a professional developer C# is better :smiley:

C# developpers are payed better than VB.Net developpers [url]http://www.devtopics.com/software-developer-salaries/[/url]

Possibly…

But some people aren’t professionals
Like I said… I consider myself “Professional” and I use VB quite a bit, primarily for low level interfacing ie … RS232 and it serves me well…
You have to give people all the options to compete in the comercial world…

I personally preffer VB to C# but I can work with both ( far more flexable to know several languages)

Cheers Ian

As far as RAD goes - VB and C# are identical in speed and code aspects. He’s already learning C# for FEZ so there is no point learning VB.Net.

@ Brett…yes, I am a CNC machinist, primarily milling machining centers. I go back a forth on the floor now a days, I have been a full time CNC programmer for a couple years now, using Mastercam, with a little aid from Solidworks for design.

G-Code programming is far different then computer programming. Programming machines is much easier, it’s basically graphing with the use of a little bit of code.

@ Everyone else… well thanks for the direction and suggestions. I hope no one gets fired up between VB and C#, but for some reason this stuff is difficult for me. Reading some books and tutorials and websites, it’s just hard to grasp. I think now that I have a FEZ, and a nice support area like TinyClr.com, in doing it and actually playing with it, I might get it. Remember I am barely a hobbyist, I just think it’s fascinating and lookup to you all that can do all this robotic/computer programming stuff.

Thanks all,

Mike in MN