You want to switch the solonoids once, then skip over the code each following loop, untill you let go of the trigger and push it down again, right?
Our team is doing exactly that with our pneumatics. Here's how we're doing it. (blatantly stolen from the v2.4 default code

)
Code:
//somewhere at the top of user_routines.c
int latch = 0;
//somewhere in default_routine()
if(p1_sw_trig)
{
latch++;
if(latch==1)
{
relay1_fwd=!relay1_fwd;
relay1_rev=!relay1_fwd;
}
latch=1;
}
else
{
relay1_fwd=relay1_rev=0;
latch=0;
}
Works pretty good for us.
