Hello Guest it is April 19, 2024, 03:04:34 AM

Author Topic: using brains to turn a switch on  (Read 5144 times)

0 Members and 1 Guest are viewing this topic.

using brains to turn a switch on
« on: December 10, 2011, 06:01:51 PM »
I am going to use a brain to activate a switch. How do I specify an output switch call in the program? Please show me a sample of code that calls for an output switch that I will then link to a brain?

Thanks,
-jim

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: using brains to turn a switch on
« Reply #1 on: December 10, 2011, 06:37:37 PM »
What are you meaning by a switch? Switches are normally pressed and thus would be an input.
Hood
Re: using brains to turn a switch on
« Reply #2 on: December 10, 2011, 07:10:03 PM »
OK Hood, Let me rephrase this.

I am going to use the mist command (m7) to control a switch. I need to have this happen while the motors are turning so it was recommended to use a brain. So I would like the mist command to activate an output (4) to control my switch. The question is do I check compare immediately, or no action to get output 4 to trigger from the mist command using a brain? How exactly should I use a brain to achieve this?

Thanks,
-jim

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: using brains to turn a switch on
« Reply #3 on: December 10, 2011, 07:16:02 PM »
Still not sure how you control a switch from an output, I presume you are meaning a relay will be controlled?
Anyway no brain needed, just set  output number you wish to use (4 you said)  in Config, Ports and Pins, Spindle Control against the M7 setting
Hood

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: using brains to turn a switch on
« Reply #4 on: December 10, 2011, 07:19:09 PM »
Like this, ignore the 3 I have in Flood as you may already be using something there, if not set 4  if you want for it also.
Hood
Re: using brains to turn a switch on
« Reply #5 on: December 10, 2011, 07:54:47 PM »
The problem is, to operate the mist control, you must stop the axis, which i do not want to do. This is why i must use brain, so that the command can happen without stopping the motors. If I want to control the output with the mist LED, what do I use: "no operation" or "compare immediately"  with what value?
-jim

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: using brains to turn a switch on
« Reply #6 on: December 10, 2011, 08:00:11 PM »
How are you going to operate the mist output? Thought you were going to use code?
Hood

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: using brains to turn a switch on
« Reply #7 on: December 10, 2011, 08:15:17 PM »
If using M7 in code to switch on you would just have it on the same line as some motion code, dont actually have to stop motion to switch coolant on.
If you will be using some other means to switch on the mist let me know and I will maybe see what you are trying to achieve and be able to advise more.
Hood
Re: using brains to turn a switch on
« Reply #8 on: December 10, 2011, 08:44:38 PM »
What I want to do is use the m7 command to turn a switch on for the first second or so of a motor command that lasts for about 20-30 seconds. I do not want the motor to stop or pause when the M9 command is given.
-jim

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: using brains to turn a switch on
« Reply #9 on: December 11, 2011, 05:28:10 AM »
Still not clear what you are wanting to do I am afraid, the " turn a switch on" is the first thing that has me confused, how can you turn a switch on? Are you meaning a relay? Next thing that has me a bit puzzled is do you wish the signal to be turned off halfway through a move or when? Is the On state to be for a predefined length of time or is it just when you command it to be off? If the latter how are you going to command this off?

I can tell you that it would just be a do nothing pass signal but that may not be the case as it all depends on what you are wanting to achieve and afraid I am no closer to understanding that :(
Hood