did some more web searching and found this info
now just to figure out how to associate it to the ouput pins
specificly m10 and m11 as I have a lathe with a turret head on it with a servo drive and encoders.
the lock and unlock is an air solenoid so I just need to turn that solenoid on and off ( reason for m code ) I can then associate the servo with the y or a axises in the g code and use the g01 command to rotate it to the desired position. as I can set the counts to a numeric value matching the station number and use the G01 command. ie
station 1 or zero depending on how you look at it is home
station 2 would be say 2 and that would equal 1000 counts from the encoder to reach that position
station 3 would be say 3 and that would equal 2000 counts from the encoder to reach that position and so on you get the picture hear
where we usually associate the counts to a inch increment we now associate it with a station number or you can make it equal to degrees if you like but in short all the same.
CNC M Codes
M00 - Program stop; Mill and Lathe
M01 - Optional program stop; Lathe and Mill
M02 - Program end; Lathe and Mill
M03 - Spindle on clockwise; Lathe and Mill
M04 - Spindle on counterclockwise; Lathe and Mill
M05 - Spindle off; Lathe and Mill
M06 - Toolchange; Mill
M08 - Coolant on; Lathe and Mill
M09 - Coolant off; Lathe and Mi
M10 - Chuck or rotary table clamp; Lathe and Mill
M11 - Chuck or rotary table clamp off; Lathe and Mill[/color]
M19 - Orient spindle; Lathe and Mill
M30 - Program end, return to start; Lathe and Mill
M97 - Local sub-routine call; Lathe and Mill
M98 - Sub-program call; Lathe and Mill
M99 - End of sub program; Lathe and Mill