View topic - help needed by novice on serial programming in qnx

help needed by novice on serial programming in qnx

anything that doesn't fit to other groups.

help needed by novice on serial programming in qnx

Postby santa1666 » Tue Feb 24, 2004 2:19 am

hi,
I am a newbie to QNX. I want to know if someone knows of a routine where i can do the following. I am collecting data remotely from a AD/DA board attached to a QNX machine

- read the serial port for incoming remote command.
- compare it with given options
- if the command is collect data, collect the latest numerical value stored in a memory location(buffer) and write it to the serail port.

The AD/DA code is already running. it will be storing values in a buffer. All I need is somehow transfer the value via serial port eerytime its asked to. the command to collect will be sent remotely every 1/2 second or 1 sec

thanks
santa1666
New Member
 
Posts: 3
Joined: Tue Feb 24, 2004 2:12 am

Postby cdm » Tue Feb 24, 2004 2:53 pm

Open the device, set it to raw mode and read/write it. Take a look at Stevens book "Advanced Programming in the UNIX Environment".
cdm
QNX Master
 
Posts: 789
Joined: Fri Jul 05, 2002 9:38 am

Postby santa1666 » Tue Feb 24, 2004 3:41 pm

what do u mean by raw mode?

A pupil is best taught by examples. Any exmaples u are aware of that I might look at
I do not know device programming at all in QNX
santa1666
New Member
 
Posts: 3
Joined: Tue Feb 24, 2004 2:12 am

Postby santa1666 » Tue Feb 24, 2004 6:14 pm

I also forgot to mention that the receiving side is always looking for incoming data. That is, I am looking for event driven or a polled solution.

the serial port is constantly looking for the data. when it receive data, it compares and if the collection request is made, it just write the latest value out the serial port

I can figure out the read and write parts, just need help with event driven part where the serial port is always looking for incoming
santa1666
New Member
 
Posts: 3
Joined: Tue Feb 24, 2004 2:12 am

Postby mario » Tue Feb 24, 2004 8:37 pm

santa1666 wrote: A pupil is best taught by examples.


Not always, an example is very shallow, it doesn't explain such concept as raw mode, what is raw mode, why it exists. In most cases it turns people into xerox machinem blindly cutting and pasting ;-)

Read a BOOK ;-)

santa1666 wrote: I do not know device programming at all in QNX


That's not QNX specific , this is generic UNIX stuff.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am


Return to General Programming

Who is online

Users browsing this forum: No registered users and 1 guest