Analog IO

This is a discussion on Analog IO within the C++ Programming forums, part of the General Programming Boards category; Ok, I'm looking for a way to send a simple signal across serial IO. Whatever I can do. I have ...

  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    6

    Analog IO

    Ok, I'm looking for a way to send a simple signal across serial IO. Whatever I can do. I have NO clue how possible this is however here are my limitations.

    Language: c++
    Interface Choices: Serial* (COMM/Parallel), USB (*prefered)
    Goal: Constant current signal max voltage for a given time interval

    That's it. does anyone have any ideas?

  2. #2
    Registered User
    Join Date
    Apr 2004
    Posts
    6
    Alternative:

    The other option is this. . .

    Any way I can send a simple digital signal. I just want to send like 00010. I'm sending it to a circut board. With this one, I could even use like the NIC interface. I dunno. I'm just trying to figure out how to do this. I'm trying to control some relay's is all.

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,434
    Which operating system and compiler?

    > I'm sending it to a circut board.
    Is this something you've made, or is it something commercial with a web page we can go look at?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    Registered User
    Join Date
    Apr 2004
    Posts
    6
    Quote Originally Posted by Salem
    Which operating system and compiler?
    Good points, sorry about that.

    I'm working with WinXP at the moment however eventually I'll be using Linux as well. However, WinXP is the most important at the moment.

    I'm building the boards myself. This is why I have so many options about what I want to do. My biggest problem is I really don't know what to expect as output comming out of the devices. The best thing I could possibly get is something like this.

    0010

    That's it, nothing else, just a simple simple binary signal over any kind of interface. I've got the ability to design my boards to interpet signals like this and trigger relays accordingly. The binary signal would be the best as it would eliminate the varriance in output voltages across different kinds of serial ports/ethernet cables as well.

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,434
    In order of complexity

    Parallel (easy)
    Serial
    USB
    NIC (I haven't a clue)

    Parallel is pretty nice, because in effect it becomes a shared byte between the PC and your card. The PC can write a byte to the parallel port, and your card can read that byte directly out of its version of the parallel port.

    This should give you all you need to interface your own card to the parallel port of a PC
    http://www.lvr.com/parport.htm

    > I'm working with WinXP at the moment however eventually I'll be using Linux as well
    So long as you write your own
    Code:
    void parallel_write_byte ( unsigned char );
    unsigned char parallel_read_byte( void );
    Then you can use those throughout your code. When it's time to port to Linux, then you have only a small amount of work to do - just reimplement those for the new OS.

    Same goes for any other code which is Operating system specific.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  6. #6
    Registered User
    Join Date
    Apr 2004
    Posts
    6
    Perfect. Thanks Salem

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program crashing when I use IO
    By legit in forum C++ Programming
    Replies: 9
    Last Post: 05-31-2009, 07:54 AM
  2. flushing the file io?
    By doubleanti in forum Tech Board
    Replies: 4
    Last Post: 04-23-2007, 12:27 AM
  3. File IO with .Net SDK and platform SDK
    By AtomRiot in forum Windows Programming
    Replies: 5
    Last Post: 12-14-2004, 09:18 AM
  4. Totally puzzling IO problem
    By Vorok in forum C++ Programming
    Replies: 5
    Last Post: 01-06-2003, 06:10 PM
  5. more newbie questions - file io
    By sunzoner in forum C++ Programming
    Replies: 1
    Last Post: 06-13-2002, 04:33 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21