txtrone wrote: Thanks Rod, much appreciated. What model Airtac is that you are using? Is it connected to a Mesa card?
Sorry not sure what you mean about the Airtec.
So just doing some early thinking about this. First convert to inches being your machine units. You said you have 8 vents and the table is 144 inches long and 72 inches wide.
So let there be 8 zones numbered 0 to 7 with 0 in the front left and 7 at the rear right.
We can make an array of hal pins to agree with this structure
The zone boundaries on the Y axis will be at 36", 72" and 108"
The zone boundary on the X axis will be at 36"
We can also set an array of pins to set there pins in you hal files using setp.
We need to convert a position to a zone.
The X axis is easy
Code:
int xzone = (axis.x.pos-cmd < 36) ? 0:1;
The Y axis is a bit trickier
Code:
int yzone;
if(axis.y.pos-cmd < 36)
yzone = 0;
else if(axis.y.pos-cmd < 72)
yzone = 2;
else if(axis.y.pos-cmd < 108)
yzone = 4;
else
yzone = 6;
so now we need to resolve the zone number
Code:
int thezone = xzone+ yzone;
So now its time to set the pins
Code:
int i;
for( i = 0, i < 7, i++){
pin[i] = (i == thezone)? 1:0;
So there are probably a few typos above
I think the logic is right, I just have to flesh it out into a component another time.