[prev in list] [next in list] [prev in thread] [next in thread] 

List:       comedi
Subject:    Re: Easy example for analog out needed, please
From:       Heinrich du Toit <heinrichdt () tlabs ! ac ! za>
Date:       2007-09-20 14:16:04
Message-ID: 1190297764.5917.13.camel () aglar
[Download RAW message or body]

Arguments is a pretty standard C programming technique

http://www.lysator.liu.se/c/bwk-tutor.html (sec 18)
http://einstein.drexel.edu/courses/CompPhys/General/C_basics/c_tutorial.html (sec 11)

struct parsed_options is declared in examples.h
here it is:
struct parsed_options
{
        char *filename;
        double value;
        int subdevice;
        int channel;
        int aref;
        int range;
        int physical;
        int verbose;
        int n_chan;
        int n_scan;
        double freq;
};

all that inti_pased_options and parse_options does it to populate it
with values according to the parameters specified to the program
the code is in common.c

there you will see that it works with

ok so it comes down to:
command:./outp -v 3.0 -s 1 -c 1 -r 0 -a 1


the output:
writing 3 to device=/dev/comedi0 subdevice=1 channel=1 range=0 analog
reference=1
3

v = value
s = subdevice
c = channel
r = range
a = aref

check common.c for more information.
If your values are wrong outp will NOT work. but simply say something
like "invalid channel" or something stupid.



On Thu, 2007-09-20 at 13:44 +0000, Johannes wrote:
> Hi Heinrich,
> 
> thanks for your reply.
> 
> the card is working fine, comedi and comedilib are installed, I just dont
> know how to use it.
> 
> I took a look at outp.c, but I dont understand the
> struct parsed_options options;     and
> data = options.value;
> used, I need to have hard coded values to understand it. I dont have a clue
> which argument parameter I have to use. Where are such things explained?
> 
> Thanks a lot
> 
> 
> ---------------------------------------------
> Free POP3 Email from www.Gawab.com 
> Sign up NOW and get your account @gawab.com!!


_______________________________________________
comedi mailing list
comedi@comedi.org
https://mail.comedi.org/cgi-bin/mailman/listinfo/comedi
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic