Hello Guest it is August 18, 2019, 07:50:41 AM

Author Topic: How to use Relays on the 106 I/O board  (Read 4199 times)

0 Members and 1 Guest are viewing this topic.

Offline Boots

*
  •  17 17
    • View Profile
How to use Relays on the 106 I/O board
« on: November 01, 2009, 12:40:08 PM »
How do I control relays example:

M7 turns on Relay 2

How do you control Relay 3 through 8?

On my old Centroid machine M94/4 turned on Relay 4. Mach3 does not use M94 commands.

Also How do I assign the relay on command to the user buttons?

Thanks for your time, Boots-2b1

Offline Hood

*
  •  25,849 25,849
  • Carnoustie, Scotland
    • View Profile
Re: How to use Relays on the 106 I/O board
« Reply #1 on: November 01, 2009, 02:00:36 PM »
All depends what you are wanting to do with the relays but user macros or brains may be what you are looking for.
 If you give an example of what you want to do then I am sure someone will point you in the right direction.
Hood

Offline Boots

*
  •  17 17
    • View Profile
Re: How to use Relays on the 106 I/O board
« Reply #2 on: November 02, 2009, 10:43:56 PM »
Hi Hood,
I have Cool Air, Mist, Flood, Light, Hold downs controlled by two relays etc. On my other system CNC4 I issued a M94 code in my g-code to close my relays. Example: if the light was connected to Relay 4 In my code I would issue a M94/4 and it would turn on the light. Mach3 does not support the command M94 - so what command do I was to close relays 4-9? I am a electronics engineer, the relays are wired correctly.

Boots-2b1

Offline Hood

*
  •  25,849 25,849
  • Carnoustie, Scotland
    • View Profile
Re: How to use Relays on the 106 I/O board
« Reply #3 on: November 03, 2009, 02:50:56 AM »
You will need to write custom macros and place them in the macro folder of the profile you are using.
The macros will be from 100 upwards for custom macros so you could, for simplicity, have m104, m105, m106 .........m109 and that would kind of work like before for your 4 to 9 relays. Also setting the relays to Outputs 4 to 9 in Ports and pins would also keep things easily remembered.
 So to summarise you would set the relays to outputs in Ports and pins, you would open notepad and write a macro, example for Output 4 below

ActivateSignal (OutPut4)

You would then save it as m104.m1s in your profiles macro folder and thats it.
 You can then  call from code or MDI ust like you did before except it would be m104


Hood

Offline Boots

*
  •  17 17
    • View Profile
Re: How to use Relays on the 106 I/O board
« Reply #4 on: November 04, 2009, 12:59:15 AM »
Hi Hood,

Yes thank you, the macro worked fine. Now I can turn them on but how do I turn them off? I tried M9 and it does not work?? Also where can I learn the syntex for the macro language?

Thanks for your help, Boots-2b1

Offline Hood

*
  •  25,849 25,849
  • Carnoustie, Scotland
    • View Profile
Re: How to use Relays on the 106 I/O board
« Reply #5 on: November 04, 2009, 03:20:03 AM »
You will need a macro to turn them off, if you wanted them to all turn off together then you could have one macro which did that but if you want individual control then you would need a macro for each. For example to turn Output 4 off you would have the following in the macro.
DeActivateSignal(OutPut4)

Ray (HimyKabibble) has recently done a pdf with VB commands in it but some of them may only be for the up coming rev of Mach. Other sources are the wiki  and often a good one is just to look at other macros with the editor in Mach.

Hood

Offline Boots

*
  •  17 17
    • View Profile
Re: How to use Relays on the 106 I/O board
« Reply #6 on: November 04, 2009, 11:36:46 PM »
Hi Hood,

I used the DeActivateSignal (OutPut4) command it works fine. After a little messing around I got all the relays working properly. I wrote a seperate macro for on and off for all 8 relays. I buzzed it out today it worked great.

I did notice in the documentation for the 106 I/O board the the relay numbers are not in order 2.3.4 etc it is 2.3.5. etc I kept trying different pins until I got each relay to work properly. I check the Port Pins Outputs and pin assignments and they were correct. The doc just lists them wrong.

Thanks for your help,

Boots-2b1

Offline Hood

*
  •  25,849 25,849
  • Carnoustie, Scotland
    • View Profile
Re: How to use Relays on the 106 I/O board
« Reply #7 on: November 05, 2009, 02:14:39 AM »
No problem, glad you got it working :)
Hood