Click here to Skip to main content
15,868,016 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# WPF - Creating controls based upon SQL results Pin
patrickalexson25-Oct-12 6:03
patrickalexson25-Oct-12 6:03 
QuestionHi All Pin
Saied Ghazal24-Oct-12 13:09
Saied Ghazal24-Oct-12 13:09 
AnswerRe: Hi All Pin
Richard Andrew x6424-Oct-12 16:12
professionalRichard Andrew x6424-Oct-12 16:12 
AnswerRe: Hi All Pin
OriginalGriff24-Oct-12 19:39
mveOriginalGriff24-Oct-12 19:39 
AnswerRe: Hi All Pin
V.24-Oct-12 21:12
professionalV.24-Oct-12 21:12 
QuestionOne 8-Bit Byte Across The Serial Port Pin
C-P-User-324-Oct-12 12:58
C-P-User-324-Oct-12 12:58 
AnswerRe: One 8-Bit Byte Across The Serial Port Pin
Dave Kreskowiak24-Oct-12 13:35
mveDave Kreskowiak24-Oct-12 13:35 
GeneralRe: One 8-Bit Byte Across The Serial Port Pin
C-P-User-325-Oct-12 11:51
C-P-User-325-Oct-12 11:51 
Thank you Dave and Gerry for your feedback.

My original post was long enough as is (as was ?) so I didn't want to jam in any additional details.

The wires are working.

I am (totally) confident of the physical wires and connections, because I have been using them with various software packages to send and receive data from an external embedded system. Those packages have demonstrated successful sending and receiving from the device; as in,,,

--- I send out a specifically formatted group of bytes

--- The device responds with the proper sequence of bytes

i.e., things are working fine and it's time for me to get on with the user interface

I have pretty extensive control over the external box; to the point of single stepping the CPU instructions if I need that.

I can set up the UARTs (the external box has several of them) to generate an interrupt (i.e., an int in the external box) when various things happen; including the reception of a byte. If the byte is no good, it typically means that the frames are wrong, and even more typically almost every time because the start/stop/data/parity settings are off. When the speeds are out of whack it gets downright bizzare (as one would expect).

So, with that in mind, I want to assure you that I have indeed done much more than a loopback test in Hyperterminal: I've used these very machines and these very wires to communicate with the device being developed.

But then again, yes, that's the first culprit when bytes don't go across.



Gerry Schmitz wrote...

"...one typically doesn't just "send"; ... almost always a "response" ..."

Correct.

Walk before we run.

This is why I want to develop one app that just sends one byte as the result of clicking one button just one time.

The examples I've seen here are almost universally embellished with extensive controls, boxes, etc., and that's great.

My point is that by focusing on the bare minimum, at the start, the process of reading, turns to writing, turns to observing, turns to practicing, turns to refining, turns to learning, and ultimately turns into understanding.

The fully functional app is not good for that at all.




Dave Kreskowiak wrote...

"...Actually, there's tons of them. Such as this one[^] and this one[^]...."

Correct, and that's where the learning curve goes vertical, or even Bezier, as in backwards or way off the path of the desired goal.

Yes, they contain the specific concept that I want to explore, but that concept is enshrouded with lots of other stuff (which I totally understand; they want to demonstrate a working useful app; not a specific isolated single concept) which requires ancillary and extraneous factors. This is what thwarts learning; at least for me: i.e., hiding the trees in the forest.

The "forest", in this case, is the C# vocabulary. The trees all look alike, so you can't find the one you want. In like manner, the specific syntactical invocation of the method/class/whatever is hidden because of the interactions of the seventeen other things the application has to do.

Yes, you are correct, nobody on earth is going to buy an app that sends one byte out the serial port when you click one button.

However, I believe that that "app" would be exactly the first one that should be studied by anyone who really wants to understand the construction of a C# user interface that is communicating with a device outside the computer.

More to the point, in one of those examples, I find a line of code which is exactly what I want to do, Here's that line...


// Write a set of bytes
port.Write(new byte[] {0x0A, 0xE2, 0xFF}, 0, 3);


So, I think, "Yes, that's what I want" and try to put something similar in my code. Nope, errors. So I try cutting and pasting that exact line, verbatim. Again; Nope ! When I attempt to put it into my code, total Ka-Bong, life goes fail, fail, and more fail.


Again, I can set up my external box to interrupt me when I get the first byte from its UART, and I'm also quite confident of the physical medium connecting it based on consistently observed behavior established over several months now; I'll just toss out a guess of 10 million bytes properly transmitted and received.

I hope this is not rambling or needless philosophical debate.

I'm just trying to write an app where I click one button one time and get one byte out of the serial port.


Following true engineering psychology, nerds everywhere jump on anything simple and immediatly go, "Oh boy ! That's easy ! Let's add fifty steps of complexity to the problem !", which is what I sortta'kinda see happening everywhere I ask this question.

If I don't miss my guess, the final stuff here will be less than twenty lines of code when I get it figured out and actually type them at the keyboard.

Perhaps this is where we could really...

[A] help me, a lot and

[B] increase the popularity of this site.

I want an idea of the twenty lines of code that will send one byte when I click on one button. You have hundreds, thousands, maybe millions of lines of code here.

Can you show me the ones that I want right now ?
GeneralRe: One 8-Bit Byte Across The Serial Port Pin
Dave Kreskowiak26-Oct-12 2:26
mveDave Kreskowiak26-Oct-12 2:26 
GeneralRe: One 8-Bit Byte Across The Serial Port Pin
C-P-User-326-Oct-12 6:23
C-P-User-326-Oct-12 6:23 
GeneralRe: One 8-Bit Byte Across The Serial Port Pin
Dave Kreskowiak26-Oct-12 8:47
mveDave Kreskowiak26-Oct-12 8:47 
AnswerRe: One 8-Bit Byte Across The Serial Port Pin
Gerry Schmitz24-Oct-12 15:19
mveGerry Schmitz24-Oct-12 15:19 
GeneralRe: One 8-Bit Byte Across The Serial Port Pin
C-P-User-330-Oct-12 8:32
C-P-User-330-Oct-12 8:32 
GeneralRe: One 8-Bit Byte Across The Serial Port Pin
Gerry Schmitz30-Oct-12 11:01
mveGerry Schmitz30-Oct-12 11:01 
QuestionC# exe app Pin
Michael Kurdík24-Oct-12 10:10
Michael Kurdík24-Oct-12 10:10 
AnswerRe: C# exe app Pin
Pete O'Hanlon24-Oct-12 10:49
subeditorPete O'Hanlon24-Oct-12 10:49 
AnswerRe: C# exe app Pin
Abhinav S24-Oct-12 19:58
Abhinav S24-Oct-12 19:58 
QuestionWinforms or WPF Pin
Orjan Westin24-Oct-12 0:09
professionalOrjan Westin24-Oct-12 0:09 
AnswerRe: Winforms or WPF Pin
BobJanova24-Oct-12 0:52
BobJanova24-Oct-12 0:52 
AnswerRe: Winforms or WPF Pin
Pete O'Hanlon24-Oct-12 1:11
subeditorPete O'Hanlon24-Oct-12 1:11 
GeneralRe: Winforms or WPF Pin
Orjan Westin25-Oct-12 3:25
professionalOrjan Westin25-Oct-12 3:25 
AnswerRe: Winforms or WPF Pin
Eddy Vluggen24-Oct-12 1:18
professionalEddy Vluggen24-Oct-12 1:18 
AnswerRe: Winforms or WPF Pin
V.24-Oct-12 2:42
professionalV.24-Oct-12 2:42 
AnswerRe: Winforms or WPF Pin
Keith Barrow24-Oct-12 6:49
professionalKeith Barrow24-Oct-12 6:49 
AnswerRe: Winforms or WPF Pin
Gerry Schmitz24-Oct-12 15:37
mveGerry Schmitz24-Oct-12 15:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.