Hello Guest it is April 18, 2024, 04:58:39 PM

Author Topic: Help with Input/Output control...  (Read 6965 times)

0 Members and 1 Guest are viewing this topic.

Offline xavi

*
  •  17 17
    • View Profile
Help with Input/Output control...
« on: December 16, 2010, 01:27:41 PM »
Dear All;

I am new on CNC machine and Mach-3. I have built a X-Y table positioner which we will be using to move antennas into predefined positions and making measurement with network analyser.  The X-Y table is to be controlled through Mach3. In practice we want to move the antenna in one position, waiting for the network analyzer to make the measurement, then moving the antenna to another position and repeat the measurement. We are thinking of having a sort of handshake protocol between Mach3 and the network analyser instrument.. so that Mach3 moves the antenna into a position and then sends a signal into the network analyser to start measurements. Once it finishes measuring, this sends a signal back into Mach3 so that it moves into the next position, and this cycle is repeated for all the positions.

The Mach3 is interfaced with DSPMC/IP controller which has lot of spare input and output ports that we can use for the communication. The problem is I am not familiar with Mach3 codes to output a signal to a port and wait for an input signal before it moves. I have read the G-code and M-code in the manual but this seems to be code related to the movement of the axis.  I appreaciate any of your suggestions.

Thanks in advance.

Xavi   

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Help with Input/Output control...
« Reply #1 on: December 17, 2010, 05:02:34 AM »
Hi Xavi

set up an input and an output in ports n pins and then

if your gcode looked something like this:

Code: [Select]
G1 X100
M666
G1 Y100
M666
G1 X0
M30

and you created a macro called M666.m1s that looked something like this:

Code: [Select]
'signal network analyser with say a 100 ms pulse
activateSignal(OUTPUT3)
sleep 100
deactivateSignal(OUTPUT3)

'here the analyser does it's thing and then activates an input pulse when it's done

While Not isActive(INPUT4) 'Mach waits for the incoming handshake from the analyser
  sleep 100
Wend

'macro ends and the next gcode commanded movement is free to go

that should get you started if I've understood your requirement correctly

Cheers

Ian

Offline xavi

*
  •  17 17
    • View Profile
Re: Help with Input/Output control...
« Reply #2 on: December 17, 2010, 09:12:04 AM »
Hello Ian;

Thanks you very much for your replaying. It is what I was looking for. I will trie it up. 

Thanks

Xavi