Welcome, Guest. Please login or register.
Did you miss your activation email?
June 19, 2013, 03:39:48 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
  Show Posts
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 »
431  Mach Discussion / VB and the development of wizards / Re: E-stop VB script on: June 06, 2006, 08:19:30 PM
Thank you to Brian Baker,Graham Waterworth and Liquidseek.com for your your help and codes. Grin

I think I got it now.

I would have been done a few hours ago but I found that my Mach 3 install is a little bit off. I'm getting a "Run loop Macro the.." with a "OK" or "Cancel" prompt that was effecting the way Mach 3 is handling the code.

Since this was giving me problems the "getLED(0) and some other codes where not working properly.

Tried the code on my machine computer and works flawlessly. Let me know if you have any problems.

Any suggestion on the Mach 3 problem I'm having, I've reinstalled but the same screen keeps popping up before Mach starts?

One more quick question can we have a wave file play when Mach starts and ends?

Thanks for your Patience and talents Grin


Here is the final code:
Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
    (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

 
If GetLED (0) Then

sndPlaySound "C:\WINDOWS\MEDIA\tada.wav"
End If

If GetLed (19) Then

sndPlaySound "C:\WINDOWS\MEDIA\tada.wav"
End If
   
   
or download the .M1s:
432  Mach Discussion / VB and the development of wizards / Re: E-stop VB script on: June 06, 2006, 06:49:14 PM
Getting closer,

This code will work with the "physical Estop" but is not working with the Mach3 E-stop.
So when I engage my physical E-stop I get a sound responce, when I unengaged the sound stops like it should behave, but if the Mach 3 E-stop is still blinking or if I hit the softwear e-stop it will not give a sound responce.

What I think is I'm reaching the OEM code for the physical E-stop but not the virtual one. Huh

Here is the code:

Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
    (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long


'Public Declare Function GetOEMLED (ledOEMCode As Integer) As Boolean
 
If GetOEMLed (19) Then

sndPlaySound "C:\WINDOWS\MEDIA\tada.wav"
End If

'Else GetOEMLed (67) = 0
'sndPlaySound "C:\WINDOWS\MEDIA\tada.wav", &H1
'End If       
 

433  Mach Discussion / VB and the development of wizards / Re: E-stop VB script on: June 06, 2006, 03:17:32 PM
Okay now I'm getting some where,
I can use the Macropump.m1s
with:

Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
    (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
sndPlaySound "C:\WINDOWS\MEDIA\ding.wav", &H1

but I'm getting a compiler error when I add:

If(GetLED(0))Then

Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
    (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
sndPlaySound "C:\WINDOWS\MEDIA\ding.wav", &H1
end if


Is the (getLED(0)) declared by Mach3 or do I need to declare it?

I haven't seen the video, I'd like to Grin
434  Mach Discussion / VB and the development of wizards / Re: E-stop VB script on: June 06, 2006, 01:56:00 PM
Does Mach load all macro's on start up? or how do I load a macro?

Would the Macro listen for the getLed(0) and play a wave file? so all the code would be place in the .M1s?
 or can I place VB code on LED's/Dro's?

Thanks for the help Mr.Barker
435  Mach Discussion / VB and the development of wizards / Re: E-stop VB script on: June 06, 2006, 12:47:18 PM
Okay, I'm alittle slow Tongue
Found tons of info on customizing.
http://www.machsupport.com/documentation/Customizing.pdf
436  Mach Discussion / VB and the development of wizards / Re: E-stop VB script on: June 06, 2006, 11:43:19 AM
How do I create a macropump? Is it the (.M1s) Huh

I feel that I must have missed a lot of valuable information about scripting in Mach. I've been looking around but can't find too much.

Where is the code for the Emergency function so I can check the state with a macropump?

Can I use something like this?
(b1) Inspect the input with a IsActive(ss) call in a Macropump


Mr.Barker,
Do you think there might be a better way to call on wave files?
437  Mach Discussion / Mach Screens / Re: Attaching wave file to button on: June 06, 2006, 06:52:15 AM
If you need to find good sounds to add to Mach look here:

http://www.findsounds.com/ISAPI/search.dll

All sounds are free and the search engine is great, best I've seen.
438  Mach Discussion / VB and the development of wizards / E-stop VB script on: June 06, 2006, 05:24:37 AM
How do you trigger an event from the message ticker or the "active" on/off state of the emergency function(Estop).

I'd like to call on some type of event to trigger a "wave file script getter" for the active on/off state of the E-Stop.

If some one could help with the code then we can incorporate a wave file function to the estop. Grin


Here is the basic function code to call on a wave sound placed on a button:

Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
    (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long


    sndPlaySound "C:\WINDOWS\MEDIA\ding.wav", &H1


Here is the code to place on the "Display" button(This is a two state button with two diffrent state sounds!)

value = GetParam("Boundry")
Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
    (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

If  value = 1 Then
'SetButtonText " Job "
SetParam "Boundry" , 0
 sndPlaySound "C:\WINDOWS\MEDIA\ding.wav", &H1
 Else
SetParam "Boundry" , 1
'SetButtonText "Machine"
sndPlaySound "C:\WINDOWS\MEDIA\tada.wav", &H1
End If

  Currently I haven't found the code to trigger a wave sound for the E-Stop, need some help

439  Mach Discussion / Mach Screens / Attaching wave file to button on: June 06, 2006, 05:20:17 AM
I thought I'd post this here for the screen designers.

If you'd like to attach a wave file to a single state or multiple state button use the code provided.

1. In screen designer you'll change your button to "VB",
2. then in Mach 3 you'll apply the button comand and the wave file code.
3. All you have to do is change the directory of your wave files or the directory in the code.
*Example:(sndPlaySound "C:\WINDOWS\MEDIA\tada.wav", &H1)

Here is the basic function code to call on a wave sound placed on a button:

Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
    (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long


    sndPlaySound "C:\WINDOWS\MEDIA\ding.wav", &H1



Here is the code to place on the "Display" button(This is a two state button with two diffrent state sounds!)

value = GetParam("Boundry")
Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
    (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

If  value = 1 Then
'SetButtonText " Job "
SetParam "Boundry" , 0
 sndPlaySound "C:\WINDOWS\MEDIA\ding.wav", &H1
 Else
SetParam "Boundry" , 1
'SetButtonText "Machine"
sndPlaySound "C:\WINDOWS\MEDIA\tada.wav", &H1
End If


 Angry Currently I haven't found the code to trigger a wave sound for the E-Stop, need some help Grin

440  Mach Discussion / General Mach Discussion / Adding a wave file on: June 05, 2006, 02:45:41 AM
Was wondering if any one has added there own sounds to Mach 3 and how it can be done.

I'd like to add a sound for the:
Emergency active,
Jog mode on/off,
X,Y,Z zeroing and moving sound indicator
Limit switch active

Looked in a few place for information, but couldn't find any Cry.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!