Open and close an electrical circuit - c#

I have an application that one of it's features needs to control an electrical circuit of some device (open and close a circuit). Since i have no background in electronics i really don't know where to start.
I looked at some articles and found that i might need some kind of an RS232 relay device but i really don't have a clue if this is the right approach.
any help or guidance would be appreciated.

I will assume that this is a low-budget project - something like this would work :
http://www.easydaq.biz/PagesUSB/USBRelayCardProductsFRAME2.htm
Relay cards are available in USB, PCI, etc. Google will help you find something in your price range, deliverable in your region, and with a suitable number of outputs.
There are DIY ultra-cheap options, however. This would generally involve using the LPT printer port as a DIO port. The 5V lines can be used to activate power transistors that drive coils in similar relays. Have to solder your own for this kind of project. LPT bits can be set with very simple low-level memory writes.
For commercial or industrial application the prices go up (as does reliability) and the correct unit would depend heavily on the specific application and environment.

Related

C# interfacing between pc and Omron servopack sgdh

I need help to write code c# interfacing between PC and Omron Servopack by rs232 to USB connection enter image description hereto drive ac servomotor
Using RS232 (CN3) to control this servo is not the best practice as it is not immune to EMC interference and is a port for driver setup (you will not be able to take graphics, and adjust the servo tuning while controlling through this port).
Consider researching the driver model you have and, if you have a fieldbus (Mecatrolink, DeviceNet, Profibus...), you could check how to use these protocols in a software (which I'll warn you, it's not trivial).
It all depends on your purpose, which could have been better explained in the question, as there are countless other approaches we can take...

Digital Input device to c#

The Problem:
I'm writing an application that needs to receive electrical input from a machine every time the machine does something.
I have a Limit switch set up to the machine and it currently completes a circuit every time the machine does it's thing
I need it to input into a computer using usb as oppose to just complete a circuit.
I had a dataq 'dl-148u-sp' And i got the c# code to produce a graph using ActiveX controls but all i really need is the digital output from the circuit being completed (which for the life of me i couldn't figure out how to do)..
I ended up frying the device(i think) even the software it came with doesn't recognize it anymore...
I need a new device, and it turns out they discontinued the one i had, and the next one up after shipping is like 90$.
The Question:
Is there a Better/Cheaper/Easier way of doing this? Or can anyone suggest a Good device that's easy to get the output using c# code so i can incorporate it into a program i made?
It's not clear if you are asking for a hardware or software solution here. Are you asking what the best way to facilitate that data transfer from your machine to the PC? If so, this may not be the place to ask, but you might look at a USB to GPIO module.
http://numato.com/8-channel-usb-gpio-module is an example.
I'd recommend an Arduino:
http://www.arduino.cc/playground/Main/InterfacingWithHardware
They dev kits are cheap and there's a ton of open/free libraries that interface the Arduino to C#.
More expensive and complex board is IOFirebug with c# library and many functions. Input voltage range is from 5V to 30V.

Printer Communication Capture

If I need to post this elsewhere let me know.
We have some old software thats being re-written, that uses a printerdriver to a propriatery printer.
I need to rewrite the software bypassing the print driver and go directly to the printer. I do have the specs for the printer communication, thats fine, but what Id like to do is monitor the communications to the printer to view its contents (from the existing software that Im re-writing) and compare it to the specs, and what I will be sending it for validation.
I have to make sure Im not missing anything.
Any ideas on how I might be able to accomplish this?
Thanks
To capture the traffic you have to basic options.
1. Use software
If you are using ethernet, you can use a program like WireShark or USBTrace to capture the packets that are being sent out. There are similar programs for USB.
2. Use hardware
Another option would be to use an external logic analyzer. It's basically a box that sits in-between the computer and the printer that captures all the data, then uses software to decode it. There are some inexpensive options available (USBEE, Bus Pirate, and Total Phase Beagle.
I own a USBEE and I've used it to debug a simple USB device. It works well enough for that. The software is a little clunky though.

Zabbix and time series data

We should monitor and log ~1000 devices (1..4 sensor per device). SMS and email alert and the common functions are required if anything going wrong.
I think we instead of developing the whole ecosystem in .NET/C# it would be nice to use an existing one - for example Zabbix. But is it possible without any bigger hack?
I think that the main problem is that the devices are old-school and using RS232 for communication.
Any idea or any other flexible monitoring software?
Zabbix is a good monitoring tool, and it's easy to configure sms and email alerts. You'll need to script the serial port check, as there is no built in support for that. This may help: http://ramblings.narrabilis.com/node/310

Print Using Modem and Printer Through BTS

In my scenario to print something, I don't want the printer has to be connected with a computer. Rather I am trying to connect that with a Modem(GSM or any other). when a sms arrives to the modem, the print command will fire and the sms will be printed.My question is, is it possible to implement the diagram with our existing technology? If not, i will be delighted if you provide some alternatives.
Unless you can customize the firmware of the GSM modem or the printer, it is likely you will need a small computer in between. If both can talk over serial ports, this can be really tiny - PIC, AVR (including packaged version such as Arduino), etc. If at least one needs USB you may be better off with a bare-metal Arm board. This is going to range from $2 at the low end to maybe $70 at the high. (There are also a few Arm boards that run an embedded .NET framework if that is your background... how well they run it I'm not sure)
If you need to do formatting, or the printer depends on the computer to do a lot of the work, or your engineers aren't familiar with the mindset of tiny embedded systems, you probably want something capable of running an operating system - ie, a faster Arm chip with hundreds of megabytes of memory - think Beagleboard, plugputer, Chumby Hacker Board, etc or one of those micro-servers that are basically x86 netbooks refactored for better cooling. Depending on how careful you are, this puts you anywhere from $50-$250.
You could also use an android phone (pick one with known USB host capability) and fold in the GSM capability, but may spend a lot of time tripping over the android components when all you really want is an embedded linux with a full libc. A more "linux-y" linux smartphone might be preferable if you can find one you expect will continue to be available.

Categories

Resources