Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: terrapigui on September 01, 2017, 04:02:32 AM

Title: is possible vbscript for dobutton(23) ?
Post by: terrapigui on September 01, 2017, 04:02:32 AM
Hi
sorry for my bad english.
i need a equivalent code vbscript for dobutton(23) for modify the feedrate when active signal trough inductive sensor.
i need improve accuracy
is possible?
thanks

Additional Information...

After a long time, I have had to restart the cnc I made a few years ago. I am using the mach3 and I have adapted capacitive sensors on the X axis and the Y axis, I use them as a reference to position my mandrino the one Point x = 0 and = 0 that I get when I run the ref all home button.
The problem is that I need a maximum precision because I use it to mill pcb boards, I have noticed that when I stop motors, or I interrupt the program and I want to start again, when I return to give ref all home it returns in theory to the point x = 0 and = 0, but in reality there is a margin of error, so doing another pass ruined the work done.
I have come to the conclusion that when I refer to 0 with the sensors, the feedrate speed is high to have an accuracy, so I want to adapt a script that does the following:
When sensor X is detected (the sensor led lights up), stop and then move very slowly until the sensor led is turned off, the same with the Y axis.
Someone could lend me a hand with that script? I'm very stuck with the topic of macros and scripts.

Title: Re: is possible vbscript for dobutton(23) ?
Post by: Dewlosin on September 07, 2017, 06:34:40 AM
Would you recommend this to me to understand more?
Title: Re: is possible vbscript for dobutton(23) ?
Post by: Tweakie.CNC on September 07, 2017, 06:43:50 AM
Would you recommend this to me to understand more?

@Dewlosin - I have absolutely no idea - perhaps you could explain in more detail.

Tweakie.
Title: Re: is possible vbscript for dobutton(23) ?
Post by: Ghantos on September 19, 2018, 04:33:13 AM
Dear Friends,
i ask if any body have an idea how to make a "Counting" of inputs trigs.

what i need is thay every time input #1 is active to increase the DRO by 1

please Note that the input trig  maybe longs 2-3 seconds but i want to count only when its change the Status( it means i cant use a loop and to check the signal "IsActive").

please its very important
thanks

Title: Re: is possible vbscript for dobutton(23) ?
Post by: TPS on September 23, 2018, 04:12:52 AM
something like this should work:

If IsActive(INPUT1) and (GetUserLed(2000) = false) Then
 SetOEMDro(2000,GetOEMDro(2000)+1)
End If

If IsActive(INPUT1)  Then
 SetUserLed(2000,1)
Else
 SetUserLed(2000,0)
End If

not tested, just written down