Finn
unread,Feb 3, 2012, 11:04:42 AM2/3/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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;