Hello Guest it is October 18, 2021, 06:24:26 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.


Messages - TPS

2091
General Mach Discussion / Re: new button and led
« on: March 09, 2015, 04:17:48 AM »
Hi,

I think there must be other parts to the code telling the macro what button34 actually is.

Hood

it's not button34.

code 34 in the screendesigner means to do a basic script, with is
in (dont know how to say) this button.

so the led needs to be turned on in ths button script.

Thomas


2092
Brains Development / Re: Brains writing wrong values to DRO's
« on: March 09, 2015, 03:23:11 AM »
Hi Bob,

you asked:
--->How did you arrive at that formula?

ok i try to explain in my bad english:

we have the value from the knob, witch is 0->15
we want a outgoing value from 40->250, so we have a range
of 210.

210/15 = 14, so we multiply the origal value by 14 and add
the 40 for the beginning value, thats it.

Regards Thomas


2093
Brains Development / Re: Brains writing wrong values to DRO's
« on: March 08, 2015, 07:02:36 AM »
Hi Bob,

ok forget about this V0 thing, played a little bit around,
it's not working. the values seam to be only updated
at the end of a brain.

think the protection for under- and oversizing the values need
to be done in macropump macro.

Thomas

2094
Brains Development / Re: Brains writing wrong values to DRO's
« on: March 08, 2015, 05:28:22 AM »
Hi Bob,


for the spindle should something like this work.(modbus adresses must be different)
not sure why you had to delete the two lines with V0

the first one should protect the value to get less than 0
the second one should protect the value to get greather than 250
are you sure your compare was "greater than" and not "less than".

Thomas

2095
Brains Development / Re: Brains writing wrong values to DRO's
« on: March 07, 2015, 04:14:34 AM »
hi Bob,

i am realy not familar with brains, but i wold try to do this in one brain.

Thomas

2096
Mach4 General Discussion / Re: Mach4 Serial Port Support
« on: March 06, 2015, 07:45:52 AM »
Hi,
Would like to use two serial ports and hopefully Mach4 has fixed the Mach3 limitation of 1 serial port.

In Mach3 and VB script you can use more than one serial port:

Sub Main()

 Const MyPort = 1                        ' COM1
 Const MyBaud = "57600"                  ' bps rate
 Const MyThreshold = 6                   ' how many characters to receive until done
  
 Const comEvSend = 1                     ' enumeration of comm events
 Const comEvReceive = 2
 Const comEvCTS = 3
 Const comEvDSR = 4
 Const comEvCD = 5
 Const comEvRing = 6
 Const comEvEOF = 7
  
 Const comInputModeText = 0              ' enumeration of input mode constants
 Const comInputModeBinary = 1
  
  
 Set objTest = CreateObject ("MSCOMMLib.MSComm", "[/b]MSCommEvent_")    ' second parameter (MSCommEvent_) +
                                         ' name of event (OnComm) creates the
                                         ' event handler that is called when
                                         ' the event fires
  
 objTest.CommPort = MyPort               ' select a port to use
 objTest.InputLen = 0                    ' if = 0, will retrieve all waiting chars
 objTest.InputMode = comInputModeText    ' causes Input() to return string (not array)
 objTest.RThreshold = 2                  ' must be non-zero to enable receive
 objTest.PortOpen = TRUE                 ' open COM port for use
  
 s = MyBaud & ",n,8,1"                   ' settings: baud,parity,bits,stop in BSTR
 objTest.Settings = s                    ' send to COM port
  
 msg = "Test Message "
 objTest.Output = msg                    ' send test message out of port
  
 objTest.PortOpen = FALSE                ' close port
  
  
 Set objTest = Nothing                   ' uninitialize reference pointer
  
  
 REM ---------------------------------------------------------------------------
 
 End Sub
  
 Sub MSCommEvent_OnComm                  ' OnComm event handler
     Select Case objTest.CommEvent
         Case comEvReceive
             rxCnt = rxCnt + objTest.InBufferCount
             rxBuf = rxBuf & objTest.Input
             If rxCnt >= MyThreshold Then
                 For i = 2 To MyThreshold Step 2
                 Next
                 flag = TRUE
                 rxCnt = 0
             End If
         Case Else
     End Select
End Sub

not testet, but i think it should work.

Thomas

2097
General Mach Discussion / Re: Re-routing input to output in Mach??
« on: March 05, 2015, 02:36:29 AM »
Hello Juha,

i think this should work:

Sub Main()

    'check status of OUTPUT1
    If getoemled(852) = true  Then GoTo dude
   
    'ask Operator to enable output
    Response = MsgBox ("Do you realy want to enable Output 1?" , 4)
    'Yes has been pressed
    If Response = 6 Then
         ActivateSignal(OUTPUT1)
    'Abort has been pressed 
    Else   
        GoTo Ende
    End If   

dude:

    'ask Operator to disable output
    Response = MsgBox ("Do you realy want to disable Output 1?" , 4)
    'Yes has been pressed
    If Response = 6 Then
         DeActivateSignal(OUTPUT1)
    'Abort has been pressed 
    Else   
        GoTo Ende
    End If   


Ende:
End Sub


Thomas

2098
General Mach Discussion / Re: Re-routing input to output in Mach??
« on: February 27, 2015, 07:37:07 AM »
Hello Juha,

i also dont know how to start a macro if you press the t key.
my thinking was to integrate my sample into the M6 macro.

Thomas

2099
General Mach Discussion / Re: Re-routing input to output in Mach??
« on: February 26, 2015, 09:37:42 AM »
Hello Juha,

i would do it with a Messagebox in the Makro like this:

Sub Main()

    'ask Operator to enable output
    Response = MsGBox ("Do you realy want to enable Output 1?" , 4)
    'Yes has been pressed
    If Response = 6 then
         ActivateSignal(OUTPUT1)
    'Abort has been pressed  
    Else    
        GoTo Ende
    End If    

    'ask Operator to disable output
    Response = MsGBox ("Do you realy want to disable Output 1?" , 4)
    'Yes has been pressed
    If Response = 6 then
         DeActivateSignal(OUTPUT1)
    'Abort has been pressed  
    Else    
        GoTo Ende
    End If    


Ende:
End Sub

not test.

Regards Thomas

2100
General Mach Discussion / Re: Leadshine EL5 ac servo troubles
« on: February 25, 2015, 03:03:20 PM »
Hi Johnny,

I think Leadshine have a big problem, when the clever guys in this forum and an electroengeneer nearly has given up.
The manual is not sufficient.

i think, You will never get a suppourt from leadshine (tryed this for weeks)

But thanks anyway to all of you to spend so much time to help me.

that is the german (ok. old german like me, and not an excuse for my bad english) way of thinking

You will hear a loud hurray across the Atlantic when the motors run.

you do not have to shout over the atlantic, just turn south and shout to Bavaria/Germany


ok. i have seen you are located in DK.
i have to go to DK in two weeks.
whrere are You in DK.
i will be in Haderslev, if it is not too far,
would be nice too meet You.

Regards Thomas