Hello Guest it is November 22, 2019, 08:43:51 AM

Author Topic: Set modbus output in brain  (Read 7133 times)

0 Members and 1 Guest are viewing this topic.

Set modbus output in brain
« 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
Re: Set modbus output in brain
« 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. 

Offline poppabear

*
  • *
  •  2,233 2,233
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Set modbus output in brain
« 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
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/
Re: Set modbus output in brain
« 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.

Offline poppabear

*
  • *
  •  2,233 2,233
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Set modbus output in brain
« Reply #4 on: December 22, 2010, 06:54:56 PM »
you need to select the ESTOP LED, NOT the ESTOP input/button
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/
Re: Set modbus output in brain
« 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.

Offline poppabear

*
  • *
  •  2,233 2,233
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Set modbus output in brain
« Reply #6 on: December 23, 2010, 06:46:40 PM »
put an INVERT OP after your estop LED
Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/
Re: Set modbus output in brain
« 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.