Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: Richard on July 03, 2012, 07:48:37 PM
-
Attached is a M6Start file that I need to get to work for a FOM router toolhoolder
It is full of "syntax errors" and is probably bad programming to boot.
But I have never used VB basic, and haven't programmed in MS basic for 10 years
Any help that anyone can give would be greatly appreciated.
Thanks,
Richard
-
No worries,I rewrote it and have the basics working now.
when I am completely done I will post my codE
Richard
-
Here is my my new code. It works , but I would rather use the inputs on the cylinders then "Sleep" statements
I can't find a way to read the inputs from within a "Select case" statement without ending the subroutine
(If - Endif doesn't work either.)
Richard
-
Hi Richard,
maybe you could use do loop function. I'm using it in my m6start code and it works realy well.
Do
If Not (GetOEMLED(823)) Then
message "Tool not released"
End If
If (GetOEMLED(823)) Then Exit Do
Loop
message ("")
ActivateSignal(Output1)
Regards,
Peter
-
No, I tried that Friday, it breaks the "select case" statement
It looks as though you cannot use a loop within a "select case " statement.
However you notice
While IsMoving()
Wend
This does work.
Monday I will try
While Is Active(Input4)
Wend
(this passes the simulation test)
Then I will go into "ports and pins" and reverse my settings to show "active" when it's not.
normally, I would pull these statements out of the "select case statements".
The problem here is that what I have is actually two toolholders, one on each side of the spindle in a clamshell - 3 tools each.
So there are different inputs and outputs for each side
Thanks for your response, I will post monday if this works or not
Richard
-
Sorry for the long delay, I've been trying to get this machine ready to ship.
No, it did not work. I am going to have to completely rewrite the code to get this to work as I want it to.
Richard