Hello Guest it is March 28, 2024, 11:06:11 AM

Author Topic: start from line #  (Read 13982 times)

0 Members and 1 Guest are viewing this topic.

start from line #
« on: May 29, 2010, 06:41:31 AM »
i want sense M3(when Spindle turn on) and save "Line number" to var 604.
and show number line to userDRO 1200.
if i trigger input#1 then code execute from it line.
1140 is OEMled for input#1
i write this VB code in addition about VB i am very Beginner :)  :

macropump.m1s

If DOSPINCW()
then
SetVar(604,GetDro(16))
SetUserDro(1200,Getvar(604))
END if

A = GetOEMled (1140)
B = GetUserDRO (1140)

If A And (B = 0) Then
SetDro(16,Getvar(604))
Sleep(100)
DoButton(0)
SetUserDRO(1140,1)
End If

If Not A And (B > 0) Then
SetUserDRO(1140,0)
End If  

plese guide for Troubleshooting.
« Last Edit: May 29, 2010, 06:46:05 AM by manmardam »
**Even a clock that does not work is right twice a day**
Re: start from line #
« Reply #1 on: May 29, 2010, 07:07:36 AM »
sorry for my mistake.
correct line1 :
C = GetOEMled (11)
If C  THEN
« Last Edit: May 29, 2010, 07:14:20 AM by manmardam »
**Even a clock that does not work is right twice a day**

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: start from line #
« Reply #2 on: May 30, 2010, 11:46:19 AM »
OK I see a BIG safety concern. The macropump updates 10 times per sec SO it is really a continuos loop.

It is a bad idea to have statements(DoButton(0)) that control machine movement from the macropump AS it could cause  the machine to move without being under the Direct control of the operator. It could injure or kill the operator.

Re: start from line #
« Reply #3 on: May 31, 2010, 02:57:56 AM »
i write this code and work well:

macropump.m1s

C = GetOEMled (813)   ' Dwell LED
D = GetOEMled (11)     ' Spindle ON LED
If C And D Then
SetVar(604,GetDro(16))
SetUserDro(1200,Getvar(604))
End If
      'in fact C & D sense "M03" .have You a better suggestion ?

'A = GetOEMled (1140)       / is Inactive because dont work well
'B = GetUserDRO (1140)

'If A And (B = 0) Then
'Code "M115"
'SetUserDRO(1140,1)
'End If

'If Not A And (B > 0) Then
'SetUserDRO(1140,0)
'End If  

and
m115.m1s

DoButton(1)                 'Feedhold
While IsMoving      'Wait for movement to stop
Sleep(100)
Wend
DoButton(3)      'Set Stop
Sleep(1000)
SetDro(16,(Getvar(604)+1))
Sleep(100)
DoOEMButton(156)
Sleep(100)
DoButton(0)
END
my problem is when i trigger "INPUT#1" ,dont trigger M115.
please help me.

Quote
OK I see a BIG safety concern
I use this code when cutting does not do well and we need to be done again

Quote
It is a bad idea to have statements(DoButton(0)) that control machine movement from the macropump
have You a better suggestion?
« Last Edit: May 31, 2010, 03:01:29 AM by manmardam »
**Even a clock that does not work is right twice a day**

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: start from line #
« Reply #4 on: May 31, 2010, 01:12:44 PM »
Sorry sport but what you are trying to do is dangerous. You are on your own for this one.

Re: start from line #
« Reply #5 on: May 31, 2010, 01:14:43 PM »
dangerous  
why?

What is important for this forum:
Quote
when i trigger "INPUT#1" ,dont trigger M115.
« Last Edit: May 31, 2010, 01:16:20 PM by manmardam »
**Even a clock that does not work is right twice a day**

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: start from line #
« Reply #6 on: May 31, 2010, 01:19:09 PM »
Because the operator DOES NOT have primary control of the start of movement of the machine. It could move anytime the conditions exist whether you wanted it to move or not. THAT IS DANGEROUS.

« Last Edit: May 31, 2010, 01:20:50 PM by BR549 »
Re: start from line #
« Reply #7 on: May 31, 2010, 01:26:40 PM »
no.
you dont understand my mean.
in cutting with OXY/fuel Sometimes Because to being dirty sheets ,cutting surface is not well done. The user can then once again previous path from starting point to begin Counter

does not Any interference in the main process
« Last Edit: May 31, 2010, 01:28:31 PM by manmardam »
**Even a clock that does not work is right twice a day**
Re: start from line #
« Reply #8 on: May 31, 2010, 01:31:44 PM »
Quote
in fact C & D sense "M03" .have You a better suggestion ?
are you have ?

AND
Quote
when i trigger "INPUT#1" ,dont trigger M115.

**Even a clock that does not work is right twice a day**

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: start from line #
« Reply #9 on: May 31, 2010, 01:49:26 PM »
NO "I " don't