Hello Guest it is April 19, 2024, 11:41:30 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Momboz

Pages: 1
1
General Mach Discussion / Setup soft limits per VB script
« on: August 30, 2013, 11:13:50 AM »
Hi

Try, try and no success.

Could someone, please, tell me what's wrong with my code (underneath in the quote). The issue is that I have to run twice the macro in order to get the operation done. The fist time says (almost) always in the status message that "Machine out of limits for SoftLimit Activation" and this is no the case when I check the softlimts values during macro execution.

The second time I execute the macro, everything's fine.

I have the feeling that somehow i have to wait until the process of setting softlimits values be finished and I can't find where to set this.

Any advice?

Many thanks in advance

Quote
'Set softlimits and toggle those ON

SLMax_X = 150 : SLMin_X = 156 : SLMax_Y = 151 : SLMin_Y = 157 : SLMax_Z = 152 : SLMin_Z = 158
DRO_X = 0 : DRO_Y = 1 : DRO_Z = 2 
SoftLimitsLED = 23 : SoftLimtsToggle = 119 : Delta = 1

If GetOEMLED(SoftLimitsLED) Then
  DoOEMButton(SoftLimtsToggle)
End If

SetOEMDRO(SLMin_X, 0) : SetOEMDRO(SLMin_Y, 0) : SetOEMDRO(SLMax_Z, 0)

Res = GetDRO(DRO_X) : SetOEMDRO(SLMax_X, Res+Delta)
Res = GetDRO(DRO_Y) : SetOEMDRO(SLMax_Y, Res+Delta)
Res = GetDRO(DRO_Z) : SetOEMDRO(SLMin_Z, Res-Delta)

If Not GetOEMLED(SoftLimitsLED) Then
  DoOEMButton(SoftLimtsToggle)
End If

Pages: 1