开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

New Macro Commands.


Art
 

Hi All:

I have implemented 2 new Macro commands for those who have the knowhow to
use them...

BYTE GetPortByte(USHORT PortAddress)

SHORT PutPortByte(USHORT PortAddress, BYTE data)

GetPortByte will retrieve a byte from a port address. A command like

A = GetPortByte( 888 ) will return the byte from printer port 0x378 for
example.

PutPortByte is the reverse.

A = PutPortByte( 889 , 255 ) will put 255 out port 0x379 and retyurn a 1 if
successful and 0 otherwise.

These commands actually have a powerfull use if you know how to control
your IO48 cards or your second printer port. If you don't tell Mach2 to
control your second port, you can then use that port as all inputs, all
outputs, or a mixture. You can send binary words out the second port. If you
have a PCI IO board you should be able to program its configuration and then
use it as well for as many outputs or inputs as you like. You will only have
access within macro's, but this would be usable for toolchangers and the
like to control external events or devices. These were added to allow the
possibility of sending speed control words to binary controlled spindles if
desired.

Thanks,

Art



Art
www.artofcnc.ca