1846
« on: November 26, 2014, 09:35:53 PM »
This is a sample script that looks at an input and IF the condition exists it writes a new line of XY axis data to a simple comma delimited file. Each time it goes active it adds a new line of data to the file.
Using it in a macropump the code will run 10 times per sec. So you need to add an interlock to prevent writing one than 1 time per occurance of the limit trip. Then when the limit resets it realeases the interlock to write.
If GetOemLED(28) = false Then ' Look for X limt to be inactive for testing code
' Normally this would = true
DataX = GetDro(0) ' X axis position 'Gather Axis Data
DataY = GetDro(1) ' Y axis position
Open "c:\Mach3\TestLog.txt" For Append As #1 'Write axis data to file
Print #1,"" &DataX &" , " &DataY
Close #1
end if
(;-) Tested and working correctly, (;-) TP