Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 28, 2012, 12:40:47 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
VB and the development of wizards
VB script consuming too much resources
Pages:
1
Go Down
« previous
next »
Author
Topic: VB script consuming too much resources (Read 1333 times)
0 Members and 2 Guests are viewing this topic.
fer_mayrl
Global Moderator
Offline
Posts: 452
VB script consuming too much resources
«
on:
February 19, 2007, 05:24:49 PM »
Ok, I have a VB script running in the macro pump, and it uses 99% of my computers resources, so sometimes it slows down, It may be my way of coding or something. Anyone here sees something wrong with the code?
BB=0
CC=0
DD=0
EE=0
FF=0
Do While GetUserLed(1020)=1
Code "G01 A36"
While IsMoving()
Sleep 100
Wend
If IsActive(Input1)=TRUE Then
BB=1
Else
BB=0
End If
If BB=0 And DD=0 And FF=0 Then
DeActivateSignal(OUTPUT1)
DeActivateSignal(OUTPUT2)
DeActivateSignal(OUTPUT3)
ElseIf BB=1 And DD=0 And FF=0 Then
ActivateSignal(OUTPUT1)
DeActivateSignal(OUTPUT2)
DeActivateSignal(OUTPUT3)
ElseIf BB=0 And DD=1 And FF=0 Then
DeActivateSignal(OUTPUT1)
ActivateSignal(OUTPUT2)
DeActivateSignal(OUTPUT3)
ElseIf BB=0 And DD=0 And FF=1 Then
DeActivateSignal(OUTPUT1)
DeActivateSignal(OUTPUT2)
ActivateSignal(OUTPUT3)
ElseIf BB=1 And DD=1 And FF=1 Then
ActivateSignal(OUTPUT1)
ActivateSignal(OUTPUT2)
ActivateSignal(OUTPUT3)
ElseIf BB=1 And DD=0 And FF=1 Then
ActivateSignal(OUTPUT1)
DeActivateSignal(OUTPUT2)
ActivateSignal(OUTPUT3)
ElseIf BB=1 And DD=1 And FF=0 Then
ActivateSignal(OUTPUT1)
ActivateSignal(OUTPUT2)
DeActivateSignal(OUTPUT3)
ElseIf BB=0 And DD=1 And FF=1 Then
DeActivateSignal(OUTPUT1)
ActivateSignal(OUTPUT2)
ActivateSignal(OUTPUT3)
End If
CODE "G04 P375"
While IsMoving()
Sleep 100
WEnd
DeActivateSignal(OUTPUT1)
DeActivateSignal(OUTPUT2)
DeActivateSignal(OUTPUT3)
CODE "G04 P375"
While IsMoving()
Sleep 100
WEnd
FF=EE
EE=DD
DD=CC
CC=BB
Loop
End
Logged
Chaoticone
South Carolina, US
Administrator
Offline
Posts: 3,598
Precision Chaos
Re: VB script consuming too much resources
«
Reply #1 on:
February 19, 2007, 05:37:50 PM »
Hey Fer,
I remember seeing something about this a while back. I can't remember for the life of me what it was for sure. I think it may have been the While if statements.
Brett
Logged
If you could see the things I have in my head, you would be laughing too.
www.precisionchaos1.com
My guard dog is not what you need to worry about!
ger21
Global Moderator
Offline
Posts: 2,620
Re: VB script consuming too much resources
«
Reply #2 on:
February 19, 2007, 06:38:07 PM »
Do you have this line at the start of your code?
Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
Logged
Gerry
2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html
fer_mayrl
Global Moderator
Offline
Posts: 452
Re: VB script consuming too much resources
«
Reply #3 on:
February 19, 2007, 06:49:07 PM »
no, let me add it, and let you know
Fernando
Logged
fer_mayrl
Global Moderator
Offline
Posts: 452
Re: VB script consuming too much resources
«
Reply #4 on:
February 19, 2007, 07:02:59 PM »
Is there a VB command, that acts as a dwell? i dont know, like:
DWELL 100
or
PAUSE 100
where the 100 is in milliseconds?
Regards
Fernando
Logged
fer_mayrl
Global Moderator
Offline
Posts: 452
Re: VB script consuming too much resources
«
Reply #5 on:
February 19, 2007, 07:15:40 PM »
Thanks a lot Ger,
That did it, CPU load less than 1%
Still, Is there a DWELL or PAUSE command?
Regards
Fernando
Logged
ger21
Global Moderator
Offline
Posts: 2,620
Re: VB script consuming too much resources
«
Reply #6 on:
February 19, 2007, 08:30:16 PM »
the code"G4" doesn't work for you? I don't know of a "pause", but I'm not a programmer either.
Logged
Gerry
2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html
fer_mayrl
Global Moderator
Offline
Posts: 452
Re: VB script consuming too much resources
«
Reply #7 on:
February 19, 2007, 08:32:39 PM »
It delays, but its not as precise As I would like it to be... I could try lowering the argument on the sleep command to make it better
Thanks
Fernando
Logged
Pages:
1
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...