NIC Programming

I'm planning to make use of the NIC to control and read devices (such as Ph Device, Airconditioners, etc.) since there are 2 input and 2 output if you use ethernet. Any help regarding how to control NIC. I believe it would be possible for Parallel printer port and serial port but I don't know if it's possible for Network INterface Card. Any information is highly appreciated. Thanks!
Who is Participating?
Jaime OlivaresSoftware ArchitectCommented:
You have not any possibility to control NIC to produce your own signals, because transmision protocol is hardwired in NIC's logic. It is not like serial or parallel where you have the possibility to control state of individual pins. Even more, Ethernet signal is differential type, so a pair of lines produces a signal together, no individual pin signal.
The best you can do with Ethernet is to use Embedded Ethernet microcontroller cards, like those produced by EDTP Electronics:
Then you have to program and connect each card ($70-$80 each) to each or more than one device. Microcontroller is programmed in C or Assembler. In your PC, just have to build an application with Visual C++ or VB with socket transmissions in UDP mode in order to "talk" with microcontroller cards.

As Jaime said, you'll be better off using the parallel port or a USB port of your PC for things like this.

Programming the parallel port can be a tricky; essentially, you need direct access to the hardware in order to control the individual bits. It's easy in MS-DOS (if that's sufficient for you), it's a bit more difficult in Windows (needs a driver).

Alternatively, it might be easier to use a USB device which already contains isolated inputs and outputs (check, for example, You have to spend some money, but you get a complete hardware device including drivers and software to control it.

Whenever possible, I'd suggest using a separate device which is very well insulated (it's probably cheaper to buy a new one than to replace the motherboard if something goes wrong).

Jaime OlivaresSoftware ArchitectCommented:
As a personal experience, I recommend you to use Ethernet ports instead of USB for many reasons:
- USB is harder to program than Ethernet, Ethernet is as easy as create a Socket object and use Send() function
- USB microcontrollers are harder to program than Ethernet
- USB is intended for near peripherals not for mid- and long-distances
- USB hardware is less fail tolerant, it is easier to build a ethernet cable than a USB cable
Well, it certainly depends on the requirements.

The USB module I thought of contains insulated inputs and outputs, so it shouldn't be sensible at all to external influences - you can even connect certain devices directly to the inputs, as long as the voltage is below 24V. The outputs are protected by relays, so you again can connect low-voltage devices directly without additional electronics. I would imagine that programming them with the included software modules is just a matter of a function call (something like Port1 = FALSE). I'm not sure about this, though; check the docs.

For most other ports (Ethernet, parallel port, serial port, etc.) you'll need additional hardware for the insulation and protection of the main board - add this to the cost of the chip, and you'll end up at similar prices ($100+), without accounting for the time required to assemble the device.

But of course, for long distances, Ethernet is a good solution. You could also use RS485 (can be used over Ethernet cable, is much less sensitive to electronic noise, allows for distances of several 100 feet). Or you could use a TCP/IP-to-Serial converter with additional logic and hardware and transmit the signals over a WLAN. Or use two TCP/IP-over-Powerline adapters and again a TCP/IP-to-serial converter. There are probably many more options. It all depends on what you need and want to spend in terms of money and effort.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.