Hello Guest it is April 19, 2024, 10:31:46 AM

Author Topic: Modbus and PLC S7-200  (Read 10140 times)

0 Members and 1 Guest are viewing this topic.

Modbus and PLC S7-200
« on: July 31, 2010, 06:22:41 PM »
  Hi. I have probrem with modbus. All settings on modbus comunication are OK. Because when i make test modbus a actuali can read a switch connected to PLC input. And
all outputs on PLC when changing state, also change on modbus test page.
The problem is that when i make a simple brain program, to activate a button start on mach screen, there is no response. Tested all modbus input posibiliti with no sucess.
Can i use the brains or its necessari using VB scripst?
Have someone experience with interfacing PLC S7-200?

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Modbus and PLC S7-200
« Reply #1 on: July 31, 2010, 09:35:54 PM »
Did you use the Serial Plugin Modbus, if you want look in the "Members Docs" section and read the "Brains Users Guide".

Even though a Automation Direct PLC is used in the examples, the concept is the same.

scott
fun times
Re: Modbus and PLC S7-200
« Reply #2 on: August 01, 2010, 05:06:23 AM »
Yes, i ticked option for Serial Plugin Modbus in the page port and pins and read the Guide.
 Tested without Serial Plugin Modbus.....same thing, no response.
I dont have TCP connection, so options for TCP Modbus is uncheck.
Modbus Adress for S7-200 are: 00001-09999  ...outputs
                                           10001-19999  ...Inputs
                                            30001-39999 ...Input registers
                                            40001-49999 ...Holding registers
When configuring autopoller Option and writing the value 10001 in Input- Start Register, status field tell Illegal data adress.
But if i make test modbus, the PLC inputs outputs corresponds with actual state.
Sorry for my Eng.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Modbus and PLC S7-200
« Reply #3 on: August 01, 2010, 09:23:09 AM »
ahhh, in the Modbus Serial Plugin (any of the Modbus stuff actually), you HAVE to convert your Octal Addresses to DECIMAL address equivelants.

so for example Lets just say you have 30 registers comming in of each type.

In the plugin modbus config you would be using 4 configs

so outputs discrete would be
cfg 0, device = output coils, port/address (your com port # that your serial is hooked to), slave # (I am assuming "1"), refreash 25ms is a good start point, Address ModBus (Var) = 1 (since your discreats start at 1, number or registers 30 (max is 127), dirction Output-Coils.

your second one is

cfg1, Input-discrete, your com, slave 1, refreash 25, Address = 4097, #reg = 30, direction Input-discrete.

your third one is

cfg2, input registers, com, slave1, 25, address = 12289, 30, input-registers.

your 4th one is

cfg3, holding reg, com, slave1, 25, address = 116101, 30, input holding (you will need to divide your holeing registers in your PLC into continous blocks for holding input, and holding output, since if you have both input and output holding in the modbus is divided between input holding and output holding.

Make SURE you using 8-N-2 for the port protocol, I would recommend a timeout of between 20-50ms, make sure you tick the ModBus Run after you configure it all. MAKE SURE YOU HIT APPLY prior to going to your test modbus dialog. NOTE you test start address must ALSO be in decimal equivelants.

Now once you get the testing and you see your Inputs and outputs going to and fro to yoru PLC, the Brians is a little different monkey.  Understand your first "starting register" in that config of the Modbus is the equivelant of Brians Modbus LOCAL VAR "0" you will need to keep that in mind.

scott
fun times
Re: Modbus and PLC S7-200
« Reply #4 on: February 20, 2012, 02:23:30 PM »
Hi I don't understand why cfg03 is under address 116101 (OCTO) ?

cfg0  0 (OCTO) ---  0(DECA)
cfg1  10001 (OCTO) ---  4097 (DECA)
cfg2  30001 (OCTO) --- 12289 (DECA)
but then in cfg03 you said 40001 (OCTO) --- 116101 (???? it seems like a OCTO base)  shouldn't it be 16385 (DECA)---- because to get 116101 it seems like you converted a DECIMAL into OCTO so i thought it was a typo.

Hence CFG03 40001 (OCTO)  ---  should be 16385 (DECA) right !?! ???

Re: Modbus and PLC S7-200
« Reply #5 on: March 21, 2012, 01:54:26 AM »
hi!!!  i can speak english a little
he above settings is failed when I do the test.
the right setting ,for example
1.s7-200 use modbus_salve ,holdstart setting vb0
2,mach3 setting:CFG1 input,slave1,25 address=0 ,input-holding
              CFG2 OUTPUT slave1,25 address=25,output-holding
then input:address0=vb0,vb1  address1=vb2,vb3  .....
       output:address25=vb50,vb51 address26=vb52,vb53 .....
but i can read bool variables .why??