Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 09:05:00 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  Brains Development
| | |-+  Set modbus output in brain
Pages: 1   Go Down
Print
Author Topic: Set modbus output in brain  (Read 1267 times)
0 Members and 2 Guests are viewing this topic.
rrc1962
Active Member

Offline Offline

Posts: 434


View Profile
« on: December 21, 2010, 10:37:06 AM »

I've been reading and writing to the modbus in brains with not problem, but now I want to set a modbus output if the e-stop is enabled.  For instance, if e-stop is enabled, I want to do SetModbusOutput(0, 0).  How would I do that in a brain?  I tried... ESTOP->NOP->MOD:0 and also ESTOP->INVERT->MOD:0.  Those didn't work.

Thanks
Logged
rrc1962
Active Member

Offline Offline

Posts: 434


View Profile
« Reply #1 on: December 22, 2010, 03:41:03 PM »

Anyone?  This driving me nuts trying to do the equivalent of SetModOutput(8, 0) in a brain when the estop is triggered.  This should be simple. 
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 1,707


Briceville, TN, USA


View Profile WWW
« Reply #2 on: December 22, 2010, 06:10:11 PM »

to answer:

   You need to set your modbus in brains correctly: Please READ the "Brains User's Guide" under member docs....

this ASSUMES (per the way you asked your questions, that you are using the OLD style serial modbus).

so under ports/pins, make sure you have the Enable Modbus support checked, (but NOT the enable plugin serial modbus if your wanting to use the old style serial mb). Make sure you set up your, modbus config parameters correclty and test them with the modbus test dialog.

in Brians, ASSUMING again, that in the old style modbus, your using the first "row" of outputs, *which are discrete* not word.

your rung would look like this: the important pick is how you pick your terminator for serial modbus.

when you set your terminator: you want to pick "output" check box, local address "0" (assuming your estop is the FIRST in the register bit map). tick the User NON-plugin serial modbus radio button, and tick "0" for the config.

here on my comp, when I push the Estop button, then the Non-serial MB term goes to 1 also.

scott
Logged

Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
rrc1962
Active Member

Offline Offline

Posts: 434


View Profile
« Reply #3 on: December 22, 2010, 06:47:05 PM »

What are you selecting as in input for the rung?  When I select the estop input from the list, brain viewer shows the input active but it's state does not change when estop is triggered.  Everything else is working great.  I have lots of inputs and outputs.  Just can't get this estop rung to respond.
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 1,707


Briceville, TN, USA


View Profile WWW
« Reply #4 on: December 22, 2010, 06:54:56 PM »

you need to select the ESTOP LED, NOT the ESTOP input/button
Logged

Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
rrc1962
Active Member

Offline Offline

Posts: 434


View Profile
« Reply #5 on: December 23, 2010, 12:49:20 PM »

I was using the wrong estop.  I was using 19 and I should have been using 800.  One more question though.  How can I get it to only write a 1 to the modbus when the estop activates and not a 0 when it deactivates.  This brain is to disable PLC outputs when an estop is triggered.  What's happening is when the estop is triggered, the outputs deactivate because a 0 is sent, but then when the estop is reset, the outputs reactivate because a 1 is sent.  I need to only send the 0 and not the 1.

Thanks.
Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 1,707


Briceville, TN, USA


View Profile WWW
« Reply #6 on: December 23, 2010, 06:46:40 PM »

put an INVERT OP after your estop LED
Logged

Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
rrc1962
Active Member

Offline Offline

Posts: 434


View Profile
« Reply #7 on: December 23, 2010, 07:56:41 PM »

That just inverts the output.  It doesn't prevent the 1 from being written.  When inverted, it sens a 1 when estop is deactivated and a 0 when it is activated.  There is a way.  You have to have more than one rung and do a comparison and only output if the value is 0.  I'll figure it out eventually.  For now, a macropump is doing the job.
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!