![]() | |
| Home Page | Mark Forums Read | Today's Posts | My Replies | Classifieds | Reviews | Photo Gallery | Web Links | Share Files | Advertise With Us | Ad List |
| |||||||
| CamSoft Products Discuss Camsoft PC based CNC controller products here! |
| This forum is sponsored by: |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
| |||
| |||
I have a situation where I would like to use the contents of a variable to specify an IO number, such as #(\53)=1. Is there any way of doing this? I have a 12 tool changer where each tool has its own status switches (tool 2 is up; tool 2 is down) and would like to pass the tool number as a variable to a subroutine. I have numbered the switches such that I can define them in a subroutine with a constant offset, like tool 2 up and down would be #22 and #23, and tool 3 up and down would be #24 and #25, etc. So my expression would be "tool X is up" is #(2X+18) and "tool X is down" is #(2X+19). I was hoping I might be able to do this with some string function, but haven't been able to come up with anything that works yet. Has anyone tackled this problem yet? Thanks for any thoughts! |
|
#2
| |||
| |||
| squarewave, We're not quite sure we understand, but we do have an idea that should satisfy any random I/O needs. The current version does offer an ARRAY command to store mass amounts of numbers, data, strings and so on, but not knowing what version you have we do have a generic idea. Create two Macros. One to turn off an output relay and another to turn them on. Call these macro from any routine, anytime. They are public and global through out the whole logic system. In each of them create a simple list. For example: [IO LIST ON] IF \53=1 THEN #22=1 IF \53=2 THEN #23=1 IF \53=3 THEN #24=1 IF \53=4 THEN #25=1 ect... -Or for OFF- [IO LIST OFF] IF \53=1 THEN #22=0 ect... Whereas variable \53 represents your tool number and # is a fixed I/O relay number. Hope this helped. Tech Support CamSoft Corp. (951) 674-8100 support@camsoftcorp.com www.cnccontrols.com
__________________ (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management) |
|
#3
| |||
| |||
| Thanks very much for your fast reply Camsoft! My desire to have a variable specify an I/O number was strictly from a programming efficiency standpoint. Using If/Thens will require me to duplicate the toolchanging routine 12 times (the number of tools in the changer). There is absolutely no problem with me doing this as I don't believe I will run out of Macro room. This just looked like an excellent place for a subroutine where all I had to pass into the routine was the tool number. Thanks again ... |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Centroid M400 code numbers | h_2_o | AjaxCNC Control Products | 16 | 03-26-2007 01:54 AM |
| parametric programming | Karl_T | CamSoft Products | 21 | 05-24-2005 03:58 PM |
| How do I engrave numbers... | slp_prlzys | DIY-CNC Router Table Machines | 7 | 10-15-2004 03:35 PM |
| S/S Relays and Variable Speed Routers | InventIt | General Electronics Discussion | 1 | 08-24-2004 01:05 PM |
| Variable Frequency Drives...how do they work? | mastercnc | General Electronics Discussion | 4 | 05-27-2004 09:59 PM |