Log in

View Full Version : A question about using Virtual Tool System



Bill Keehn
11-02-2011, 04:36 PM
The Programming Handbook says in the "Virtual Tool System" section that Shopbot Variables can be substituted for literal parameters, but this does not appear to be so.

For example, this works...

TR, 9000
SO,1,1
TR, 9000
PAUSE 180
SO,1,0

But this does not, even though the value of the variable prints correctly.

&WRPM = 9000
TR, 9000
SO,1,1
TR,&WRPM
PAUSE 180
SO,1,0
PRINT &WRPM

Anybody else run into this and is there a fix?

ron_moorehead
11-02-2011, 04:45 PM
I am not a programmer but I do know computer and syntax is important and you have no space after. , TR,&WRPM the coma in your line here, maybe that simple or not. Let us all know the fix.

Thanks

Gary Campbell
11-02-2011, 04:47 PM
Bill...
What are you looking to do? You have already set the rpm to 9000 with the "TR,9000" line. Try setting your variable to another number.

Bill Keehn
11-02-2011, 04:52 PM
Yeah, I actually tried it both ways and a few other variations as well. I actually am a software engineer so I don't like to ask for help until I'm convinced it's broken. Good try though. :)

Bill Keehn
11-02-2011, 04:56 PM
Gary, I'm playing with the Spindle warmup routine.
What I posted was a simplified code snippet. I actually have used different numbers and they do work. Only variables don't work.

Here is the actual (experimental) code:
SO,1,1
' Start at 2500 RPM and ramp to 18000 RPM
' (18000-2500) = 15500, which is 500x31.
' Stepping by 31 should take 500 seconds.
' The original warmup routine took 540 seconds,
' so wait the remaining 40 seconds at the max RPM.
&T = 500
&WRPM = 2500
&SRPM = 31
TR, &WRPM
SC,1,1
NEXTSTEP:
IF &T = 0 THEN GOTO FINISH_WARMUP
TR, &WRPM
PAUSE 1
&WRPM = &WRPM + &SRPM
&T = &T-1
GOTO NEXTSTEP
FINISH_WARMUP:
PAUSE 40
SC,1,0

Gary Campbell
11-02-2011, 05:46 PM
Bill...

Looking at your code, I dont think it will work as written.

The rpm controller, and most VFD's can only step in 100 rpm increments, so your 31 unit steps are invalid. Also check your manual to see what the recommended minimum RPM is. 2500 may be too low for some VFD's

Bill Keehn
11-02-2011, 06:35 PM
Gary, I went ahead and tried starting at 9000 RPM and incrementing by 100, but it still fails. If I do TR,9000 first, it starts up as soon as I hit the start button, but when I click OK, then it sets the RPM controller to Zero as soon as it hits TR, &WRPM inside the loop.

"Spindle Control.exe" is being passed a 0 whenever an SBP variable is used instead of a literal.

BTW, this code here actually works... but it doesn't solve my problem of how to use variables with virtual tools.

TR,2500
SO,1,1
TR, 2500
PAUSE 10
TR, 2810
PAUSE 10
TR, 3120
PAUSE 10
TR, 3430
PAUSE 10
TR, 3740
PAUSE 10
TR, 4050
PAUSE 10
TR, 4360
PAUSE 10
TR, 4670
PAUSE 10
TR, 4980
PAUSE 10
TR, 5290
PAUSE 10
TR, 5600
PAUSE 10
TR, 5910
PAUSE 10
TR, 6220
PAUSE 10
TR, 6530
PAUSE 10
TR, 6840
PAUSE 10
TR, 7150
PAUSE 10
TR, 7460
PAUSE 10
TR, 7770
PAUSE 10
TR, 8080
PAUSE 10
TR, 8390
PAUSE 10
TR, 8700
PAUSE 10
TR, 9010
PAUSE 10
TR, 9320
PAUSE 10
TR, 9630
PAUSE 10
TR, 9940
PAUSE 10
TR, 10250
PAUSE 10
TR, 10560
PAUSE 10
TR, 10870
PAUSE 10
TR, 11180
PAUSE 10
TR, 11490
PAUSE 10
TR, 11800
PAUSE 10
TR, 12110
PAUSE 10
TR, 12420
PAUSE 10
TR, 12730
PAUSE 10
TR, 13040
PAUSE 10
TR, 13350
PAUSE 10
TR, 13660
PAUSE 10
TR, 13970
PAUSE 10
TR, 14280
PAUSE 10
TR, 14690
PAUSE 10
TR, 14900
PAUSE 10
TR, 15210
PAUSE 10
TR, 15520
PAUSE 10
TR, 15830
PAUSE 10
TR, 16140
PAUSE 10
TR, 16450
PAUSE 10
TR, 16760
PAUSE 10
TR, 17070
PAUSE 10
TR, 17380
PAUSE 10
TR, 17790
PAUSE 10
TR, 18000
PAUSE 40
SO,1,0

srwtlc
11-02-2011, 07:52 PM
Hi Bill,

Been there, tried that, reported it to Ted at SB. Variables don't work with the TR command. :(

Bill Keehn
11-02-2011, 08:01 PM
Thanks Scott!

That was my next step. In that case I guess if I really need to I can write the command and expanded parameters to a file and call it that way. Or wait for it to be fixed. It really limits the usefulness of the virtual tools though. I assume it's not just the TR command, but the mechanism for passing variable parameters to virtual tools that is broken.