Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#1 2017-10-13 15:28:43

falvib
Member
Registered: 2017-10-13
Posts: 9

S7200

Hello I'm from Chile

First of all I have to say that RexControl is an amazing plataform of development, I've been working these days with it, and now I feel I need help. Im already connected by ethernet to s7200...but I have problems when I try to write in for example in VW2 or VD4 I use S7C__VW2 in a goto block, and then when I check the program in the S7200 there is nothing in the register. I hope someone can help me with this..Thanks in advance

Offline

#2 2017-10-16 09:33:12

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: S7200

Hi falvib,
thanks for your kind words. Can you read data from your S7-200 using a From block? Or how do you know you are already connected to your S7-200?

Can you upload here the source files of your project?

Best regards,
Jaroslav

Offline

#3 2017-10-16 15:32:36

falvib
Member
Registered: 2017-10-13
Posts: 9

Re: S7200

Hi dear jaroslav_sobota
thanks for your replay, I know that i am connected because I'm monitoring online the PLC program by USB while rex control is running in my raspberry pi 3 which is connected by TCP IP module. I have to say that I used the Logo example project., my problem is that I can't charge or read registers from PLC, I hope you can help me with this....I also tried changing the configuration of the file .rio. anyway I uploaded my project. Thanks in advance.

Last edited by falvib (2017-10-19 21:27:52)

Offline

#4 2017-10-17 09:38:52

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: S7200

Dear falvib,
thanks for the files. In your case it seems you'll have to edit the .rio file manually. Please try changing Mode to 0x31, Rack to 0 and Slot to 1 or 2. Supposing you have a single S7-200 CPU with a Communication Processor (CP) next to it, these settings might help.

The meaning of individual bits of the Mode parameter are listed in Comment1 in your .rio file. The most important is that the Raspberry Pi acts as PG.

Hope this helps, let me know.

With kind regards,
Jaroslav

Offline

#5 2017-10-17 13:45:17

falvib
Member
Registered: 2017-10-13
Posts: 9

Re: S7200

Dear jaroslav

Thanks for the configurations. I made the changes you told me but I can't read or write the registers of the PLC yet. When I set the project in run mode I see the registers as the picture:
mini_Registers.jpg
So I can't read my VW or VD registers.
This is the information of my .rio file
S7comm {
  Address                 "192.168.1.10"
  Mode                    0x31
  Rack                    0
  Slot                    1
  LocalTSAP               256
  RemoteTSAP              256
  ForceWrite              100
  #Comment1               "Mode: 0=use TSAP, 1=PG, 2=OP, 3=basic, 8=lock data,"
#" 16=swap bytes, 32=single item query, 256=read info, 512=server configuration"
  #Comment2               "Area: 129=Input, 130=Output, 131=Memory, 132=DataBl"
#"ock, 28=Counter, 29=Timer, 16=LogoNI, 17=LogoNQ, 18=LogoAI, 19=LogoAQ, 20=Log"
#"oAM, 21=LogoNAI, 22=LogoNAQ 22=LogoNVW"
  #GUID                   1a1a5c07-9936-4aef-a0dc-fd0196b615ae
}

I was thinking that in #Comment2 doesn't show the VW or VD registers. Could it be the problem?.
I'll be waiting your comments. Thank you again.

Offline

#6 2017-10-20 09:04:12

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: S7200

Dear falvib,
can you please upload a photo of your setup? Is there an Ethernet connection between the Raspberry Pi and the S7-200?

Can you ping the S7-200 from the Raspberry Pi command line (ping 192.168.1.10)?

Thanks!

Jaroslav

Offline

#7 2017-10-20 20:11:43

falvib
Member
Registered: 2017-10-13
Posts: 9

Re: S7200

Dear jaroslav
Thanks for your replay.
I am really needing a hand with this. I put the mode 0x31, with that now I can read and write IW and MW registers of S7200, but V bits, VW, VD registers I can't read/write.
I can tell because with the PPI interface I check online the PLC program, so I'm already connected by TCP/IP and yes
in this picture

IP.jpg

I have the IP 192.168.1.10 for communication between RP and S7200
and the 192.168.0.14 is the IP for charge rex projects. I will be waiting your comments thanks again

Offline

#8 2017-10-25 14:20:25

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: S7200

Dear falvib,
thanks for the update. I can see you have already achieved a lot!

The 'V' registers are specific for Siemens LOGO. For your S7-200, you should use e.g. S7C__DW0_0, which should read register 0 from DB0 area and interpret it as Word data type. For word 5 in DB1 use S7C__DW1_5.

For details on the correct syntax please refer to https://www.rexcontrols.com/media/doc/P … rv_ENG.pdf

Hope this helps, let me know.

With kind regards
Jaroslav

Offline

#9 2017-10-30 14:55:16

falvib
Member
Registered: 2017-10-13
Posts: 9

Re: S7200

Dear Jaroslav,
Thank you! It worked, I followed the pdf and I could write registers in OB1 (according to the picture)  using the notation S7C__DW1_100 for VW100.

VWS.jpg

Now I would like to ask you if I have a register in TIEMPOS (SBR7) or in SBR21 (according to the picture).. what would be the notation to access a register for that part of my PLC program? because I tried the same for OB1 and it didn't work, I hope you can help me with that and thanks again.

Offline

#10 2017-11-02 13:50:45

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: S7200

Dear falvib,
I have very little experience with Siemens PLCs so my answer might be imprecise. I believe it is necessary to study the memory mapping of your project. From REX you can access the DB0, DB1, etc. memory areas. Therefore you should look for the way your variables are mapped to the DB memory areas. Once you know that, you'll know how to address the data from REX.

Hope this at least guides you in the right direction.

Kind regards
Jaroslav

Offline

#11 2017-11-10 13:59:41

falvib
Member
Registered: 2017-10-13
Posts: 9

Re: S7200

Hi dear Jaroslav
Thank you so much for your help now I am almost finishing my rexhmi project, about that Id like to ask you if there is a block which let you read and write an I/O tag, like a mix between from and goto. Thanks again dear Jaroslav

Offline

#12 2017-11-21 09:42:37

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: S7200

Dear falvib,
you can use Goto block S7C__Q3w and From block S7C__Q3. The appended 'w' stands for write, but basically you can use any character. This way you can control the output signal and read back its status.

You can find this in the example 0403-12 in our GitHub repository of example projects.

Hope this answers your question.

Kind regards,
Jaroslav

Offline

#13 2017-11-21 12:47:01

falvib
Member
Registered: 2017-10-13
Posts: 9

Re: S7200

Dear Jaroslav, I have to say that i have finished my project and I am ready to install it in the facility, I've noticed that the reading of the data from PLC is too slow, do you know about a parameter to set up and make the the read faster?, I'll appreciate your help again

Offline

#14 2017-11-21 13:32:31

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: S7200

By 'slow' you mean that it takes too long to process one individual reading or that the reading happens in too long intervals?

Precise numbers would help - how long does it take and how fast reading do you need?

Best regards,
Jaroslav

Offline

#15 2017-11-23 21:16:40

falvib
Member
Registered: 2017-10-13
Posts: 9

Re: S7200

I mean that it takes around 4-6 seconds to read/write a register or a bit, I'd like at least 1 or 2 seconds of delay, I hope you can help me if there is any parameter to set up, thanks again

Offline

#16 2017-11-27 15:07:29

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: S7200

Dear falvib,
this is unexpectedly slow response. Please provide additional information:

  • How many signals are you exchanging with the S7 PLC?

  • How busy is the S7 PLC (CPU load)?

  • What is the cycle time of the S7 PLC?

  • What sampling rate is your REX algorithm using?

  • Can you provide the REX project source files so I can have a look?

With that information I might be able to give you some hints for speeding things up.

Best regards,
Jaroslav

Offline

#17 2017-12-01 18:55:42

falvib
Member
Registered: 2017-10-13
Posts: 9

Re: S7200

Hi dear Jaroslav

-About the signals there are 150.
-About the cycle time is 0.22[useg].
-About the sampling rate of my REX algorithm...I don't know where to set that parameter.

I have uploaded my project (Targets_Ejemplos.rar), I'll be waiting your replay. Thank you.

Offline

#18 2017-12-12 13:06:02

jaroslav_sobota
Administrator
Registered: 2015-10-27
Posts: 535

Re: S7200

Dear falvib,
sorry for the delay in communication. Please find the modified Lectura.mdl task, which uses an INHEXD block to retrieve 16 word values from the S7-200. Reading data in bigger chunks greatly reduces communication overhead and thus improves the response time. Please replace all the remaining rows of Similarly you can use the INQUAD and INOCT input blocks.

Your task on Level0 runs each 100 milliseconds (0.1 s). See the EXEC function block, 
tick x ntick0 = 0.01 x 10 = 0.1 s

Your task on Level1 runs each 500 milliseconds (0.5 s). See the EXEC function block, 
tick x ntick1 = 0.01 x 50 = 0.5 s

Communication with Siemens LOGO! is performed each 50 milliseconds
(0.05 s). See the S7C function block,
tick x factor = 0.01 x 5 = 0.05 s

Hope this helps, let me know.

With kind regards,
Jaroslav

Offline

Board footer

Powered by FluxBB