|
To add to what I said in the last reply:
The Parallel port is hardware: if you do not tell it to change, then it won't.
So if you tell the port "switch the fan on" then a physical signal (presumably one of the parallel port pins) is set to high or low. If you do not tell it to change, that is where it stays.
If your app exits without changing the pin back to "off" then the pin will stay high, until the PC is reset probably. Stopping the debugger exits your app immediately, it does not give it a chance to reset any signals you might normally change in your end-program code.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
yes the signal is set high even if i stop debugging. that's y i was asking what should i do to set the signal low. i cant remove parallel port every time to set it low. there should be something logical.
|
|
|
|
|
Whatever code you used to set the signal high, reverse it!
If you think you will stop the app via "Debug...stop debugging" often, then write a small app that just sets everything "Safe" and run it manually immediately after you stop it.
In your "real" app, then the main form Close event should probably do pretty much the same thing.
What code are you using to set it high?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
Manfred R. Bihy: "Looks as if OP is learning resistant."
|
|
|
|
|
hmmm thanks i try. i m using the following line to set it high
PortAccess.Output(888, 0);
|
|
|
|
|
|
yes i took help from this article.
thanks my problem solved this is very good article.
|
|
|
|
|
And that is yet another reason to prefer a serial port, where you can teach the port to behave in a certain way for as long as it is yours. It may be that the control outputs have a default state all by themselves, I don't recall; if not, you sure can give the SerialPort a finalizer that returns everything to a quiescent state when your app is done or closes the port.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Or you can just abandon the serial and parallel ports entirely (since todays PC's don't even have parallel ports anymore!) and use something like a Phidget Interface and motor controller. Go to Phidgets.com[^]. That way, you won't risk burning up the port that is on your motherboard.
|
|
|
|
|
Hey, that's pretty nifty. Thanks.
|
|
|
|
|
Cool Stuff.
All the best,
Dan
|
|
|
|
|
Also, it would be best if, in the startup of your app, you set the parallel port to a known state before you really get into your main code.
|
|
|
|
|
How do I install a game I've made in XNA(using Visual Studio 2008) on a computer that does not have Visual Studio? Please help. the simplest way would be the most Awesome
|
|
|
|
|
I don't know about XNA in particular.
In general, one does not need Visual Studio to execute a program developed with Visual Studio.
For managed code (such as C#), one needs the .NET FrameWork, which comes in several versions; one needs the version that was targeted, there is no automatic substitution if your system happens to have a higher version.
AFAIK you need to install .NET separately, you can't just ship it with your app and make it look as a single install. Microsoft does not give redistribution rights for .NET, you'd have to install from their site.
BTW: modern Windows versions (Vista, 7) normally come with a number of .NET versions pre-installed, typically all that were available when the Windows version became available itself. So if e.g. you build for .NET 2.0, it should just run fine on any Vista/7 system as is.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I would think you would need the XNA Framework[^].
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
for execution of a .net program u doesn't need to install visual studio you just need to install the .NET framework versions like .Net2.0 or .Net 3.0 or .NEt3.5
|
|
|
|
|
Like Silverlight and Windows Phone 7, XNA has its own .NET framework
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello,
I need to send string messages from Java program to C# program in real time.
There are many examples in the Internet but I can't find anything good for my purpose that is (probably) Java client (sockets code) and c# server (sockets code).
For example, I tred this: http://mediakey.dk/~cc/java-and-c-client-server-socket-programming/ but without success. (It seems connection can't be established when using that code).
I would be especially grateful if anyone could give me a simple working code for this task.
Thank you.
|
|
|
|
|
I'm not sure I understand. Socket communication isn't language specific; one side cannot tell what programming language the other side has been using. As a net result, you could look for an entirely C# example, and use half of it; and then look for an entirely Java example, and use the other half of it.
So maybe you should connect two PCs running a C# app; then the same two PCs running a Java app. And finally mix the apps up (or choose a non-PC target if that is what you want).
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
Thanks. it is very simple. There are two programs running on one PC. One program written on Java and needs to pass string data to a program written on C#.
|
|
|
|
|
So? if its only one PC, then first get it to work between 2 C# apps on the same PC. Then try again with 2 Java apps on the same PC. Now take one each and that should work too.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
There could be a problem if he's trying to send the string with default serialization
|
|
|
|
|
Um...sockets is C technically
Yes, communication protocols are language independent, but not sockets. (of course I'm busting your chops Luc )
Regardless, the OP needs to focus on protocol, not languages...
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Um...sockets is C technically
Are you sure? I have used sockets between a Java client on Windows and a C server on UNIX with no problems.
The best things in life are not things.
|
|
|
|
|
It's been wrapped and/or implemented by frameworks like Win32 (WinSock), Java,.NET, etc., but Berkeley sockets was originally C. Just sayin...
Of course, "socket" these days pretty much is used generically to describe a communication endpoint.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Point taken.
The best things in life are not things.
|
|
|
|