Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 27, 2012, 05:43:01 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
General Mach Discussion
Turn on an Output? Shamefully simple?
Pages:
1
2
»
Go Down
« previous
next »
Author
Topic: Turn on an Output? Shamefully simple? (Read 713 times)
0 Members and 1 Guest are viewing this topic.
AtlasMills
Active Member
Offline
Posts: 12
Turn on an Output? Shamefully simple?
«
on:
November 18, 2010, 10:36:40 PM »
All-
I give up... What command, OEM code, M-Code, or whatever do I use to turn on a given output pin from Mach3??? I want to make a screen to turn on or off the ~15 digital outputs my BOB has, but at the simplest level I just want to know what to do inside MACH first. Of course I know how to use m-codes for the pre-defined outputs like spindle, coolant, etc but how do I manipulate an output that's not hardcoded to an M-Code?
Seems like a very basic thing but I don't find a word about it in the Mach manual, or in the hundreds of messages I get after entering various search words on the forum...
HELP!!!
Logged
Greolt
Global Moderator
Offline
Posts: 872
Re: Turn on an Output? Shamefully simple?
«
Reply #1 on:
November 19, 2010, 01:10:13 AM »
Make an on-screen button in a program like MachScreen
Set the function to "Execute VB-Script"
Enter code like this example in the "Execute Code" field
If IsOutputActive(OUTPUT4) Then
DeActivateSignal(OUTPUT4)
else
ActivateSignal(OUTPUT4)
end if
This will toggle output 4.
Set the relevant ouput to the pin of your choice in "Ports and Pins"
Hope this helps
Greg
«
Last Edit: November 19, 2010, 01:12:49 AM by Greolt
»
Logged
AtlasMills
Active Member
Offline
Posts: 12
Re: Turn on an Output? Shamefully simple?
«
Reply #2 on:
November 20, 2010, 11:14:47 AM »
Works perfectly. You guys rock.
Logged
AtlasMills
Active Member
Offline
Posts: 12
Re: Turn on an Output? Shamefully simple?
«
Reply #3 on:
November 20, 2010, 04:33:30 PM »
Hmmm... now a slightly separate issue... The code works great, I also added a polling routine to my macro pump that watches for any outputs in an "on" state and it lights up an LED button for me if it sees anything.
On the BOB itself, I can also see that on each of my 16 outputs te "activity light" responds whenever I press the software buttons I made... Furthermore, I put a mutimeter on a couple of the pins and sure enough when I hit my software button I get ~12VDC out! Which is exactly what I wanted BUT....
I hooked up the 12VDC relay coil to it and clicked my software button and no-go. I thought maybe I had a bad relay so I swapped it out, same story. The coils require 75mA at 12VDC to fire, and my BOB is supposedly rated to output 100mA, so I shouldn't have a current problem...
Logged
AtlasMills
Active Member
Offline
Posts: 12
Re: Turn on an Output? Shamefully simple?
«
Reply #4 on:
November 20, 2010, 04:35:49 PM »
As an experiment, I unhooked the relay from the BOB and ground and attached the leads to a little 9VDC battery (one of the small rectangular ones). The relay instanly fired, no problems. I put a DC ampmeter around one of the leads and connected it again, and saw that not only did it work but it was only drawing about ~60mA to fire the relay even though it was a 9V battery.
Logged
AtlasMills
Active Member
Offline
Posts: 12
Re: Turn on an Output? Shamefully simple?
«
Reply #5 on:
November 20, 2010, 04:39:53 PM »
So I hooked the relay back up to the BOB with the ampmeter around one of the leads and clicked my software button for that output pin. The BOB's activity light came on, but the relay did NOT fire and the ampmeter stayed the same - 0 amps!!!!
What gives? How could my BOB be outputting a voltage with so little current that the relay cannot fire?
Logged
Greolt
Global Moderator
Offline
Posts: 872
Re: Turn on an Output? Shamefully simple?
«
Reply #6 on:
November 20, 2010, 04:54:12 PM »
Quote from: AtlasMills on November 20, 2010, 04:33:30 PM
The code works great, I also added a polling routine to my macro pump that watches
for any outputs in an "on" state and it lights up an LED button for me if it sees anything.
Rather than running a macro pump, try adding a LED for each output on your screen and adding these lines to the example code.
If IsOutputActive(OUTPUT4) Then
DeActivateSignal(OUTPUT4)
SetUserLED(XX, 0)
else
ActivateSignal(OUTPUT4)
SetUserLED(XX, 1)
end if
Greg
Logged
AtlasMills
Active Member
Offline
Posts: 12
Re: Turn on an Output? Shamefully simple?
«
Reply #7 on:
November 20, 2010, 05:25:57 PM »
Good point, the conditional for the button state can just as easily include the code to activate the LED. And is much more efficient.
Anyone got a clue on the lack of current from the output pin?
Logged
Hood
Active Member
Offline
Posts: 17,362
Carnoustie, Scotland
Re: Turn on an Output? Shamefully simple?
«
Reply #8 on:
November 20, 2010, 05:39:30 PM »
What BOB is it, got a link to the docs? What is the voltage when you try to operate the coil?
Hood
Logged
AtlasMills
Active Member
Offline
Posts: 12
Re: Turn on an Output? Shamefully simple?
«
Reply #9 on:
November 20, 2010, 05:52:03 PM »
Well, I was wondering when someone would ask. It's actually a Gecko G100, which I am otherwise very happy with. I chose to post here rather than the g100 section because the original issue I figured was a Mach software command issue rather than a g100 problem... That and people seem to look at the g100 like it's the plague...
Logged
Pages:
1
2
»
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...