PDA

View Full Version : Trouble with "ON INPUT" command - please help



donframbach
06-16-2002, 01:36 AM
Hello, I'm having one heck of a time getting the ON INPUT command to work the way I want it to. I would like my part file to continue processing as it ordinarily would but only change the value of a variable when the input switch is closed (or opened)

When I use the commands:
ON INPUT (1,1) &Switch1=1
ON INPUT (1,0) &Switch1=0

at the beginning of the file. The file runs normally until I activate input switch 1. Then the program jumps somewhere else (actually skips a bunch of steps). I've put in a bunch of "SC 2" commands but that only changes the way the program jumps around. The files just don't cut properly when the input switch is activated or deactivated.

Any help would be much appreciated.

Don

donframbach
06-16-2002, 10:57 AM
After a night of thinking, I think I have a better understanding of the problem I'm having with the "ON INPUT" command. The input switches were designed to provide interrupts so that when a limit was reached or something else that needs immediate action occurs, the interrupt is activated. As part of this process, movement of the ShopBot tool itself immediately halts. Even though, I'm just setting a variable to a new value through the "ON INPUT" command, the interrupt process is activated. When I want to resume, the ShopBot resumes movement AT THE NEXT COMMAND. All previous movement instructions that were received by the ShopBot tool but not implemented before the interrupt occured are discarded. I've fooled around with the "SC 2" to start and stop block moves at different points in the part file but all this does is change where the next block move will begin. I've disabled block moves with "SC 0" but I still lose the last instruction.

Unfortunately, this problem appears to be fatal to my plan to implement a TIMER function with an external timer communicating with the ShopBot through the input switch.

Is there a way to temporarily disable the sensing switches? On page 16 of the "Part File Programming Handbook", it states that old versions of the ShopBot software required the user to initialize the sensing switches with the command "SO 0,1". I tried the command "SO 0,0" hoping that could be used to temporarily turn off switch sensing but that command seems to have no effect.

bill.young
06-16-2002, 12:15 PM
Hi Donald,

Have you tried using a blank ON INPUT statement to disable the switches temporarily? I had to use ON INPUT (1,1) and ON INPUT (1,0) statements without anything after them in the edge finding routines to keep from getting extra switch triggers after contact.

Bill Y.

bill.young
06-16-2002, 12:51 PM
Hi Don,

One more thought. How about connecting the timer to the #3 input switch, the one for limit switches?

When the timer triggers the switch the tool will stop automatically, without having to add any extra commands to your files. When everything has cooled off you'll have to hit the "R" key to get it started up again, but it'll resume with the command that it was on when it was stopped, instead of moving on to the next command like an ON INPUT command.

Hope this helps,
Bill

Ted Hall, ShopBot Tools
06-16-2002, 02:43 PM
Hi Don,

Welcome to the world of the Black Belt ShopBot Programmer (Expert Level). In your second post it's clear you've got the idea of the issue here. An ON INPUT is normally an interrupt that is -supposed- to instantly stop the action of the current command ... and move on to the next, or somewhere completely different. That's how the ZZero routine works, for example ... you wouldn't ever want to resume plunging after hitting the plate.

However, as you note, there are some instances where you want to sense a switch, but don't want to stop the flow of the action. We've been working on this one in the last few revisions of the software. The function is still a bit experimental, but I think it will serve your needs. It is basically the ON INPUT function with an "INSERT" qualifier (e.g. ON INPUT (x,x) INSERT xxxxxx) where the "inserted" command can be either a single command or a list of commands. When this function is called by activation of the designated input switch, the ongoing command is briefly interrupted to carry out the inserted instructions, then it is restarted where it was interrupted.

You'll find examples of how to use the function in your SBparts folder as the sample files S_insert.sbp and S_inslst.sbp. These samples should pretty much explain things. One note for your application. To insert an equate, you need to use the full variable definition command [VV] after the insert (e.g. VV, &switch, 1 ... which sets the &switch variable = 1). So the full command would read: ON INPUT (1,1) INSERT VV, &switch, 1 (those are v's not w's, hard to read on my screen)

Sorry there is not more documentation on this. It will be in the next version of the ShopBot Programming Handbook after we're sure we're thoroughly happy with the functionality.

Ted Hall, ShopBot Tools
06-16-2002, 02:49 PM
Oh ... BTW ... you are right about the old SO 0,1 and S0 0,0 to temporarily turn off all switches. In recent versions we removed that global switch command because it had the unwanted capability to turn of switch 4 which is a designated panic stop. Now, you turn switches off individually by just using an ON INPUT (x,x) command with no instructions.

garbob
06-17-2002, 11:21 AM
To Donald,

This is totally off topic, but congratulations, you are one of about 3 people that I have seen on this forum that can communicate an idea PERFECTLY, by using a keyboard.

Gary

gerald_d
06-17-2002, 12:23 PM
Careful Gary, some of us might read between the lines and deduce that the other guys on this thread . . . . . . .

donframbach
06-18-2002, 01:49 AM
The INSERT qualifier works perfectly for my purposes. I had a little trouble with the syntax. Currently, the command is case sensitive! (ie "INSERT" works but "insert" does not)

Thanks for providing such great software for the ShopBot.

Don Frambach

chriswcrouch
08-14-2002, 10:59 PM
anyone,
i have a lathe set up at the end of the x axis on my prt. i would like to know if there is a way to restart the part file by remote using an input switch or any other method. i am using a PAUSE command to stop the part file and GOTO command to start it back, which requires striking a key on the keyboard. my problem is that the keyboard is not close to my work station and walking to start the file back is eating at my production time. any help would be greatly appreciated.

thanks,
Chris

donframbach
08-15-2002, 11:50 AM
Chris,

Have you considered a wireless keyboard?

Don

beacon14
08-15-2002, 07:16 PM
We use a 25' extention cable for our keyboard. It can reach anywhere around the ShopBot (and halfway out the door!) It also comes in real handy for setting bit location when you need to be watching the bit placement very closely. It's like having a remote control, except since it's wired, it has full keyboard control.

chriswcrouch
08-15-2002, 10:52 PM
Thanks alot for the info. I think the extension cable sounds like the best idea for me. Thanks again.

Chris