Hello Guest it is April 19, 2024, 02:53:16 PM

Author Topic: modbus and brains  (Read 6045 times)

0 Members and 1 Guest are viewing this topic.

modbus and brains
« on: December 30, 2008, 02:50:21 PM »
I need some clarification in the way brains work with modbus I am trying to set up a simple test with the flood coolant LED to a plc
I would like to know if i should map to an output or user LED

Adam

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: modbus and brains
« Reply #1 on: December 30, 2008, 10:58:52 PM »
thier is a little catch you need to do first, If you want your Fllood coolent to turn on under G code control you will need to set your coolent to one of the following OUTPUTS 1-6 (under the ports and pins and tell it to use relays for the coolent.).

then in a Brain, as an input, grab the Flood coolent (or mist what ever you picked or both), LED, then go through a NOP lobe, then got to Serial Plug in Modbus as an output, make sure that the local address you pick will come into the register you want in your PLC.

Read the "Brians Users Guide" under Memeber docs........  It goes into this kinda stuff........

Scott
fun times
Re: modbus and brains
« Reply #2 on: December 31, 2008, 02:25:19 PM »
Now the Y DRO Doesn't  show the  value from the plc
But the I can write to the plc register from the X dro

what is missing or is there something else to check
Adam

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: modbus and brains
« Reply #3 on: December 31, 2008, 05:38:20 PM »
One note:  The Brains has a bug in it, in where it does NOT support Bit-of-Word, so until that is fixed you will have to send out an entire word or in, for a discrete bit, then use Bit of word to send or recieve that bit.  i.e.   b1200.0, b1201.0  (and your watching the zero bit, for the dicrete going to and from Mach3).

I dont understand your question about the Y axis, especially since your Brian you show, does not have a Y axis DRO any where in it, just the X.

Are you wanting to send Axis Position out TO the PLC?, or, are you trying to bring a position in and display it? (note you will not be able to overrite the position DROs since they are updated by Mach3, anything you "Write" to them, would only be considered and Offset at that time).

If you going to do "Floating Point", or "Double words", you will need  to break up your Double using "Modulo" or the like in the PLC, or in VB (or plug in), to seperate the interger from the remainder and send each in its own word, to be recombined at the End device be that the PLC or Mach3.  It CAN be done, and I have done it for a CNC Tram table but it kinda sucks to do.

Look at your RS Logics docs for how your PLC processes Real or Floating point numbers.

scott
fun times
Re: modbus and brains
« Reply #4 on: January 01, 2009, 10:40:01 AM »
Scott,

 ic what u mean about the X-Y Dro's sorry about that  :) lost track of what test i was on
I couldn't seem to get the true spindle rpm dro (39) to show in mach  from the plc eather
As for  Bit-of-word I remember U telling about that at the convention last year
Adam

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: modbus and brains
« Reply #5 on: January 02, 2009, 09:50:29 AM »
Yea, here is an "Undocumented" trick for that,
you will have to put this VB code:
SetParam( "RPMOverRide" , 1 )
in one of two places: You can put it inside an "init" macro that you put in the init box under the general config.
OR, you can put it in your Macro pump in where it will run once with an interlock.

'macropump.m1s

Dim TspinRPM as integer

if TspinRPM = 0 then
SetParam( "RPMOverRide" , 1 ) 'this will enable external writing to the TRUE RPM DRO
TspinRPM = 1
end if

If you want to put it in the start up "Init code line then lets say we call the macro:  M1000

'M1000.m1s
SetParam( "RPMOverRide" , 1 ) 'this will enable external writing to the TRUE RPM DRO

then save that macro in your macros file for the profile your running, and put the M1000 in the Init Box, under config>General config>Init box  (usually there is a "G80" already sitting in this box, just add your M1000 after it).

scott
















fun times