Hello Guest it is March 28, 2024, 02:50:07 PM

Author Topic: Need some vb help!  (Read 4222 times)

0 Members and 1 Guest are viewing this topic.

Need some vb help!
« 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
Re: Need some vb help!
« Reply #1 on: July 05, 2012, 07:22:46 PM »
No worries,I rewrote it and have the basics working now.
when I am completely done I will post my codE

Richard
Re: Need some vb help!
« Reply #2 on: July 06, 2012, 09:30:09 PM »
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
Re: Need some vb help!
« Reply #3 on: July 07, 2012, 06:17:59 AM »
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
Re: Need some vb help!
« Reply #4 on: July 07, 2012, 12:14:46 PM »
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 
Re: Need some vb help!
« Reply #5 on: July 14, 2012, 09:20:36 AM »
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