Hello Guest it is April 26, 2024, 07:27:44 PM

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.


Messages - TPS

2171
CS-Lab / Re: ATC Macro - How to Count Pulses?
« on: July 02, 2017, 11:26:36 AM »
If ((GetInBit(90,0) = 1) and (GetOEMDro(2200) = 0) and (MotorturnCW=1)) then
    SetOEMDro(2201) = GetOEMDro(2201) +1
End If

If ((GetInBit(90,0) = 1) and (GetOEMDro(2200) = 0) and (MotorturnCCW=1)) then
    SetOEMDro(2201) = GetOEMDro(2201) -1
End If

If (GetInBit(90,0) = 1)  then
    SetOEMDro(2200) = 1
Else
    SetOEMDro(2200) = 0
End If

something like this should work, not tested just written down,
but i think you have to find a criteria to "reference" OemDRO(2200)

Thomas

2172
Mach4 Toolbox / Re: Axis movment indicator LED
« on: July 02, 2017, 10:47:28 AM »
my fault,

did not notice that it was posted under Mach4 General Discussion.

but i think something simular under LUA should work.

i have no idea from LUA.

Sorry.

2173
Mach4 Toolbox / Re: Axis movment indicator LED
« on: June 29, 2017, 03:28:25 PM »
Hi,
you will Need a litle Piece of VB script in macropump to do this

i just write the code down, not tested or anything else, just to give you the idea.


If GetOEMDro(800) <> GetOEMDro(2500) Then //read an compare X DRO with stored Value
    Output ON // X axis is moving
else
    Output OFF // X axis is not moving
End If
SetOEMDro(2500) = GetOEMDro(800) //store X DRO for compare

Regards Thomas


2174
Hello together,

for the moment i am working on a retrofit of a Tong IL TNV40 Mill.
at the ATC is a SANYO DENKI DC Servo Motor Type C-200-20A8.

Sanyo Denki and Tong IL are not willed to give a electric connection diagram.

So  i am asking on this way, maybe one of you has got one.

Thanks in advance Thomas


2175
code "g00 a" + CStr(s)

2176
VB and the development of wizards / Re: Keystroke Trapping
« on: June 21, 2017, 08:34:16 AM »
hi,
i am not sure what you are trying to do, but if you are in a Screen you can
define two button's one witch has the Hotkey F1 and th other Shift F1.
than you can run two seperate scripts-

Thomas

2177
VB and the development of wizards / Re: do user button
« on: June 21, 2017, 08:29:33 AM »
hi,
i am not 100% sure, but i think you can not run a oembutton from vb script.

a Workaround would be to use doOEMButton(301) witch runs the macro witch is set by SetTRiggerMacro,
and then you can run the macro from different "places".
Thomas

2178
Hi,

have you tryed to use DoButton(9) insted of DoOEMButton(1009).
this button is used in the Standard Screen set.

Thomas

2179
hi Jeff,

i am not realy sure, what you like to do, but if i understand you right something like this should work:

lets say you like to modify OEMdro2000 and you hit the "key" 1 on your virtual Keyboard the VBmakro for KEY1 could
be something like this:

Code: [Select]
Sub Main

  ActValue = GetOEMDro(2000)

  If ((ActValue  <= 9) AND (ActValue  > 0)) Then
    ActValue = ActValue * 10
    GoTo write
  End If

  If ((ActValue  <= 99) AND (ActValue  > 0)) Then
    ActValue = ActValue * 100
    GoTo write
  End If

  If ((ActValue  <= 999) AND (ActValue  > 0)) Then
    ActValue = ActValue * 1000
    GoTo write
  End If

  If ((ActValue  <= 9999) AND (ActValue  > 0)) Then
    ActValue = ActValue * 10000
    GoTo write
  End If

  If ((ActValue  <= 99999) AND (ActValue  > 0)) Then
    ActValue = ActValue * 100000
    GoTo write
  End If

write: ActValue=ActValue+1 'Key 1 was pressed

SetOEMDro(2000,ActValue)

End sub
code not tested, just written down.

Thomas









2180
something new ?