Counter disarm

14 views
Skip to first unread message

Finn

unread,
Feb 3, 2012, 11:04:42 AM2/3/12
to comed...@googlegroups.com
Hi,

to be able to write to the counter it has to be disarmed. I needed this functionality to set the counter value to zero again without having to reset and reconfigure the counter completely. This can be done by the attached code. Possibly this functionality could be added as comedi_disarm function?

Regards

Finn

    comedi_insn insn;
    lsampl_t data;

    memset(&insn, 0, sizeof(comedi_insn));
    insn.insn = INSN_CONFIG;
    insn.subdev = subdevice;
    insn.chanspec = 0;
    insn.data = data;
    insn.n = 1;
    data = INSN_CONFIG_DISARM;

    if(comedi_do_insn(device, &insn) >= 0) return 0;
    else return -1;
Reply all
Reply to author
Forward
0 new messages