I've posted on the Mach3 forum, but suprisingly there doesn't seem to be the same amount of throuhput on there as there is on here, so I wonder if I could be so bold to post the predicament here.....

This particular screenset (which is on teh arsoft download page) kind of an incomplete project by some users ...but still has a lot of functionailty that does seem to work

The immediate issues, that 'hit me, that I'm puzzled about...


The problem - The the 'spool count' doesn't budge from '0' ? (the spool count in this isnatnce is a DRO of a motor, representing how many times a bobbin spool hasturned...or inessence the Stepper moto revolutions)


First the spool count DRO has the following attributes...


Global No
Function A DRO
OEM Code 0
Format %+.0f
Hotkey
DRO tabbing 1
image path none
Locked for Mouse no

I've bolded what I believe is the important bit. I guess this could be considered a general screenset question. Why would the DRO not update?

I'm possibly thinking is't not related to the above but the code at all. Now this is where I struggle, because not only does it involve VisualBasic (which is fairly new to me), but more importatnly G-Code output (which is very new to me!)

So if anyone with a more experienced eye can pick out what would set up the total spool count, ultimately resulting in G-Code that would start the spool count DRO counting, then I'd be grateful!

I've added some thoughts (not saying they're right - in fact they're just guesses)

dim width as double
dim guage as double
dim numturns as double
dim windspeed as double
dim amountfit as double
dim Xpos as double
dim Apos as double


all the above are just setting up some variables to be used in some calculations?


width = abs(getoemdro(1000))
guage = getoemdro(1003)
numturns = getoemdro(1001)
windspeeds = getoemdro(1002)



The above takes the user input & assigns it to the aformentioned variables.



OpenTeachFile "wind.tap"
Code "g00 X1.17"
Xpos = 1.17



That lot opens up a new G-Code file in readiness for the output of below file, gives it a name & finally sets up a 'constant? (offest...whatever you wish to call it)

call setdro(3,0) - no idea what this does!

amountfit = width / guage - some simple maths, derived from the user input, to establish how many winds of wire can fit into the spool width)

Now this is where it gets hairy for me...what's going on here....

Nc = 1

DO While( amountfit < numturns)
Apos = amountfit * Nc
If (Xpos = 1.17) Then
Xpos = (width + 1.17)
Else
Xpos = 1.17
end if
code "G01 X " & Xpos & " A " & Apos & " F50"
code "g01 g91 A -.0001"
code "g90"
numturns = numturns - amountfit
Nc = Nc +1
if (Nc = 99999) then
msgBox"I fed up"
End If
Loop
dist = guage * numturns

If (Xpos = 1.17) Then
Xpos = dist + 1.17
Else
Xpos = width - dist + 1.17
End If



I'm particularly interested in the following bitas I reckon this is what's setting up the spool count (is the bit that doesn't increment))


Apos = Apos + numturns
code "G91 A-.0001" - what' this line about ...specifically -.0001
code "g90"
code "G01 X" & Xpos & "A" & Apos
Code "M30"

CloseTeachFile

Call LoadTeachFile()


Many thanks for your help!