Kirk Wallace wrote: >On Thu, 2007-08-23 at 18:13 -0400, Stephen Wille Padnos wrote: >... snip > >Just using wsum made a big difference in the shell script. I was >consistently just one tool position off with the rotate direct to >station routine, and it only gets better from here. > > > >>If the >>turret can't move in both directions, then you can do the whole thing >>with HAL components - no classicladder needed. You'll have to write a >>simple component to compare two s32 numbers (strange but true - there's >>an 8-bit pattern match with cascade input component, but no integer >>comparison :) ) Look at something like xor2.comp for an example of a >>simple .comp component. >> >> > >Like this? > >~~~~~ s32equal.comp ~~~~~ >component s32equal "Check if two s32's are equal"; >pin in s32 in0; >pin in s32 in1; >pin out bit out; >function _ nofp; >license "GPL"; >;; >FUNCTION(_) { > if (in0 == in1) > out = 0; > else > out = 1; >} >~~~~~ s32equal.comp ~~~~~ > > or
FUNCTION(_) { out = (in0 == in1); } The result is a boolean, after all :) This also eliminates potential problems with false being 0, nonzero, 1, not 1, -1, etc. I think you can install a comp with an incantation like comp --install mycomp.comp, but don't quote me on that. Otherwise, a recompile should pick up the new comp if it's in the right directory (hal/components is one such directory). - Steve ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users