I've run into an issue with my HAL files for a project I'm working on. When using "loadrt and2 names=", it seems that listing more than 16 names causes the insmod call to fail, resulting in none of those HAL components being created. I don't think this is specific to and2, but maybe it is. See below for a command line printout showing the error. I'm assuming the 16 argument limit is hard-coded somewhere, but is there any way around it?
Some background: for what I'm trying to do, using names instead of count is necessary. I'm trying to split out some basic logic and timers into a separate HAL file, which requires using twopass to load all the components common to both files (like and2). I don't want to have to rewrite an entire file if the number of and2's (or any shared component) in the first file changes. I have been using classicladder for this logic up until now, but I wanted to move it to HAL to simplify things a bit - one less 'program' to maintain, and it's a little cumbersome that you need an operational LinuxCNC instance running in order to edit the ladder.
Code:
names=and2.0,and2.1,and2.2,and2.3,and2.4,and2.5,and2.6,and2.7,and2.8,and2.9,and2.10,and2.11,and2.12,and2.x1.fault,and2.x2.fault,and2.y.fault,and2.z.fault,and2.c.fault,and2.s1.fault.0,and2.s1.fault.1,and2.fault,and2.es.act,and2.es.reset,and2.s1.act,and2.s2.act,and2.s.on,and2.s.noton,and2.ll.on,and2.ll.off: can only take 16 arguments
twopass: load_the_modules cmd=<orig_loadrt and2 names=and2.0,and2.1,and2.2,and2.3,and2.4,and2.5,and2.6,and2.7,and2.8,and2.9,and2.10,and2.11,and2.12,and2.x1.fault,and2.x2.fault,and2.y.fault,and2.z.fault,and2.c.fault,and2.s1.fault.0,and2.s1.fault.1,and2.fault,and2.es.act,and2.es.reset,and2.s1.act,and2.s2.act,and2.s.on,and2.s.noton,and2.ll.on,and2.ll.off>
waitpid failed /usr/bin/rtapi_app and2
/usr/bin/rtapi_app exited without becoming ready
insmod for and2 failed, returned -1
creating ladder-state
HAL: ERROR: function 'and2.0' not found
twopass: Error in file ./customspray.hal:
addf failed