How to send/receive data from/to an outside source
-
Hi there. I'm pretty new to coding, I'm trying to (slowly but surely) design a program to receive data from a chassis dyno that I'm fabricating. I'm guessing I'd best use the serial port, from what I read using USB 2.0 is pretty much harder. I'd be putting together a microsystem using either a microprocessor or my own electronics. I'd have to transmit data like engine rpm, air/fuel ratio, dyno drum speed etc. Is there a way to read analogue signals with a pc or can it only use digital signals? If anyone has some good links or books on communicating with the outside world using a pc, I'd love to have some. Thanks a bunch! Brian
Yup, I'm a NEWB
-
Hi there. I'm pretty new to coding, I'm trying to (slowly but surely) design a program to receive data from a chassis dyno that I'm fabricating. I'm guessing I'd best use the serial port, from what I read using USB 2.0 is pretty much harder. I'd be putting together a microsystem using either a microprocessor or my own electronics. I'd have to transmit data like engine rpm, air/fuel ratio, dyno drum speed etc. Is there a way to read analogue signals with a pc or can it only use digital signals? If anyone has some good links or books on communicating with the outside world using a pc, I'd love to have some. Thanks a bunch! Brian
Yup, I'm a NEWB
The serial/parallel ports are digital only. If you want/need to send analog output you'd need an external box to take and convert the digital commands into analog signals. Assuming you can get one inexpensively a programmable USB control box would probably be the way to go since legacy ports are in the process of being phased out of new PCs. Programming on USB directly isn't easy since you need to write a device driver to talk to a device on the port instead of being able to directly access it.
-- You have to explain to them [VB coders] what you mean by "typed". their first response is likely to be something like, "Of course my code is typed. Do you think i magically project it onto the screen with the power of my mind?" --- John Simmons / outlaw programmer
-
Hi there. I'm pretty new to coding, I'm trying to (slowly but surely) design a program to receive data from a chassis dyno that I'm fabricating. I'm guessing I'd best use the serial port, from what I read using USB 2.0 is pretty much harder. I'd be putting together a microsystem using either a microprocessor or my own electronics. I'd have to transmit data like engine rpm, air/fuel ratio, dyno drum speed etc. Is there a way to read analogue signals with a pc or can it only use digital signals? If anyone has some good links or books on communicating with the outside world using a pc, I'd love to have some. Thanks a bunch! Brian
Yup, I'm a NEWB
Hi, you can add an analog/digital convertor to your PC but that has a lot of disadvantages; for one it ties your solution to your PC, you can not easily move it to another PC, a laptop, etc. The better solution is to encapsulate the required functionality in a "peripheral". It could be built around a microcontroller that has both an A/D convertor and an RS232C interface on board. Of course such device needs its own code, it may require assembly or C code (it would not support the .NET languages !) If you are in control of the details of command/response coding, you can make sure each of them use readable/printable characters only AND have a single common terminator (such as a newline character), making it a lot easier to communicate (and debug!). If the required bandwidth is low (only a few tens or hundreds of chars/sec), and if the real-time requirements are easy (you don't need the PC to react within a few tens of milliseconds), then the serial port is easy and in fact a very good way for interfacing a peripheral to a PC. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
-
Hi, you can add an analog/digital convertor to your PC but that has a lot of disadvantages; for one it ties your solution to your PC, you can not easily move it to another PC, a laptop, etc. The better solution is to encapsulate the required functionality in a "peripheral". It could be built around a microcontroller that has both an A/D convertor and an RS232C interface on board. Of course such device needs its own code, it may require assembly or C code (it would not support the .NET languages !) If you are in control of the details of command/response coding, you can make sure each of them use readable/printable characters only AND have a single common terminator (such as a newline character), making it a lot easier to communicate (and debug!). If the required bandwidth is low (only a few tens or hundreds of chars/sec), and if the real-time requirements are easy (you don't need the PC to react within a few tens of milliseconds), then the serial port is easy and in fact a very good way for interfacing a peripheral to a PC. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
Hi, I have to read every output (sensors on the dyno) about once every 50ms. Is serial fast enough? How bout any books about interfacing with serial and/or USB? Thanks!
Yup, I'm a NEWB
-
Hi, I have to read every output (sensors on the dyno) about once every 50ms. Is serial fast enough? How bout any books about interfacing with serial and/or USB? Thanks!
Yup, I'm a NEWB
Hi, a Windows PC would be capable of reading say 10 characters every 50 msec on average; but sometimes it will have more urgent things to do, and it will read and process the input with a delay of more than 50 msec; if you need a reaction on every measurement (as is often the case in control engineering jobs), you would be better to organize that in the microcontroller, and have it communicate with the PC on a higher level, with no (or more relaxed) timing constraints. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
-
Hi, a Windows PC would be capable of reading say 10 characters every 50 msec on average; but sometimes it will have more urgent things to do, and it will read and process the input with a delay of more than 50 msec; if you need a reaction on every measurement (as is often the case in control engineering jobs), you would be better to organize that in the microcontroller, and have it communicate with the PC on a higher level, with no (or more relaxed) timing constraints. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
Thanks! Now that I know what to do, I just need to find out how to do it :laugh: I found a couple of books on C++, and I found Serial Complete and USB complete on amazon. I should be able to get through this with those two hehe :) Thanks a lot! Brian
Yup, I'm a NEWB
-
Hi there. I'm pretty new to coding, I'm trying to (slowly but surely) design a program to receive data from a chassis dyno that I'm fabricating. I'm guessing I'd best use the serial port, from what I read using USB 2.0 is pretty much harder. I'd be putting together a microsystem using either a microprocessor or my own electronics. I'd have to transmit data like engine rpm, air/fuel ratio, dyno drum speed etc. Is there a way to read analogue signals with a pc or can it only use digital signals? If anyone has some good links or books on communicating with the outside world using a pc, I'd love to have some. Thanks a bunch! Brian
Yup, I'm a NEWB
If you can read German or feel competent enough to interpret a German article based on circuit layout etc.: http://www.heise.de/ct/projekte/ct-lab/[^] ADA Motherboard with up to 5 optional daughter cards (AD / DA / IO), a SDK and other goodies, free of charge (the plans, not any of the hardware - but you can solder the stuff yourself).
Cheers, Sebastian -- "If it was two men, the non-driver would have challenged the driver to simply crash through the gates. The macho image thing, you know." - Marc Clifton