588,215 active members*
4,038 visitors online*
Register for free
Login
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    56

    Variable IO Numbers

    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. #2
    Join Date
    Apr 2003
    Posts
    332
    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
    [email protected]
    www.cnccontrols.com
    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  3. #3
    Join Date
    Oct 2003
    Posts
    56
    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 ...

Similar Threads

  1. Centroid M400 code numbers
    By h_2_o in forum Centroid CNC Control Products
    Replies: 23
    Last Post: 11-06-2019, 02:33 PM
  2. parametric programming
    By Karl_T in forum CamSoft Products
    Replies: 21
    Last Post: 05-24-2005, 08:58 PM
  3. How do I engrave numbers...
    By slp_prlzys in forum DIY CNC Router Table Machines
    Replies: 7
    Last Post: 10-15-2004, 08:35 PM
  4. S/S Relays and Variable Speed Routers
    By InventIt in forum CNC Machine Related Electronics
    Replies: 1
    Last Post: 08-24-2004, 06:05 PM
  5. Variable Frequency Drives...how do they work?
    By mastercnc in forum CNC Machine Related Electronics
    Replies: 4
    Last Post: 05-28-2004, 02:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •