Sign in to follow this  
Followers 0
eaa628

S7 Profibus

13 posts in this topic

I need some help. I am new to S7 but have a pretty good grasp on it. What i am wanting help with is addressing DB data and sending it to an Automation direct DL06 Address V40500. What i am trying to accomplish is sending data from DB2.DBW358 which is INT to the V40500 of the DL06 I have looked at the SFCs i am understanding it better but i just need a pointer or 2 to help me over the edge. I have configured the hardware correctly and everything is linked Via Profibus. Any help would be greatly appreaciated

Share this post


Link to post
Share on other sites
Hi eaa628. The details for how to setup the S7 and which SFCs to use depends on the exact HW configuration of the S7 PLC ? Is the Profibus connected via a CP or an onboard port for example. Anyway, you need a GSD file from the AD profibus slave module, and this GSD file you must import in the HW configuration in the STEP7 project.

Share this post


Link to post
Share on other sites
I understand that. The configuration is as follows. The Cpu is a 316-2 DP The profibus slave network is controlled via a CP342-5 the DL06 is linked to the CP342. The GSD files are done and the hardware configuration has been completed and downloaded to the 316-2 and all links are complete and the system is running with no errors. I just need some instruction help on sending data from the 316-2dp to the DL06. Hope this gives the added information needed.

Share this post


Link to post
Share on other sites
When you look into the hardware configuration of the profibus node you have set up on the network, you will see the input and output addresses that the configurator will have set up for you. The input address is where the data needs to be sent to. I have nener used the AD drive but if you look in the manual for the drive it will tell you which part of the address is the control word and which part you will send a speed/torque reference to. The output addess in the hardware configurator is where the drive writes data back to, such as the drive status. You can use the move instruction to write the data to the drive e.g mov DB2.DBWX to PQWX

Share this post


Link to post
Share on other sites
For the S7, you need to find DP_SEND and DP_RECV in the standard library under "communication blocks". Just follow the online help - however be aware of these two pitfalls: The LADDR parameter is the i/o base address of the module itself, specified in hex. So if the starting address of the module is "256" in decimal, then LADDR becomes W#16#100 (100 hex = 256 dec). The SEND or RECV parameters are pointers. Both shall specify how many outputs (DP_SEND) or inputs (DP_RECV) are assigned to the i/o of the module, both on number of bytes. The pointer must start from 0 and end with the last byte in the i/o that is adressed. Example: If outputs are assigned to the module from Q200.0 to Q207.7, then the pointer for DP_SEND shall specify 208 bytes (from 0 to 207). How the corresponding i/o is adressed in the AD PLC i do not know.

Share this post


Link to post
Share on other sites
Thank you very much both of you. I think i understand Jesper. I have a couple of questions bare with me. The addressing for the io of the AD plc starts at PQW600 it is a 16 WORD WRITE TO PLC so the SEND and RECV should read P#M 650.0 BYTE 16. I have a good grasp on everything else. What i am doing is modifying an exsisting system. There is a DP_SEND and DR _RECV block exsisting in OB1 setup for another Profibus slave. So the addressing of the module is complete. The current pointer on send is set to P#M 210.0 BYTE 6. Can i modify those blocks or should i create additional Send and Recv blocks? Thank you again

Share this post


Link to post
Share on other sites
Hi again. First, adressing in S7 is basically in bytes. So for 16 words you must send 32 bytes. And, to my experience, the pointer must specify as many bytes as there is from 0 to the last byte in the input or output image used for the DP slave with the highest i/o adress number - i.e. QB0 - QB631 (632 bytes). Attempting to send only QB600 - QB631 will fail. To save some scantime, it can be advantageous to arrange the DP i/o in the low end of the adress area. This so you dont have to send hundreds of unused bytes. If the other DP slave is working with only 6 bytes, then check in the HW config if the adresses for the slave goes from 0 - 5 (Q0.0 - Q5.7 for example). Lastly, the other programmer has used Merkers to transfer the DP i/o. For flexibility I strongly recommend that you use a DB for inputs and another DP for outputs.

Share this post


Link to post
Share on other sites
If i were to install them on the master that is tied to a DP Coupler it would then be direct addressed with scan time not being an issue correct? I appreciate the pointers i thhink i am moving i the right direction.

Share this post


Link to post
Share on other sites
Hi again. Your last input does not compute ! A DP coupler is not used with a DP slave. The Profibus card for a DL06 is a DP slave. A DP coupler is used to let 2 DP masters exchange data with each other, while still keeping their respective DP networks unaffected by each other. Maybe you mean to say "CP342-5" and not "DP coupler" ? Still I do not understand what you mean with scantime.

Share this post


Link to post
Share on other sites
Jesper, i hope you can help me with this. I have everything setup in the hardware configuration. See below the current STL for DP_Send and recv. A "AlwaysON" JNB _007 CALL "DP_SEND" CPLADDR:=W#16#140 SEND :=P#M 210.0 BYTE 6 DONE :="Cp342_fc11_bitDone" ERROR :="Cp342_fc11_bitError" STATUS :="Cp342_fc11_wStatus" _007: NOP 0 A "AlwaysON" JNB _018 CALL "DP_RECV" CPLADDR :=W#16#140 RECV :=P#M 220.0 BYTE 3 NDR :="Cp342_fc12_bitDone" ERROR :="Cp342_fc12_bitError" STATUS :="Cp342_fc12_wStatus" DPSTATUS:="Cp342_Fc12_wDpstatus" _018: NOP 0 The problem i have is i am trying to send 16 words of data to PQW336 but i cannot address it directly since it's going through the CP342-5. Can you help me with how i would setup the pointer to send data to a PQW address? any help would be great.

Share this post


Link to post
Share on other sites
Hi again. If I understand correctly, then you have configured the AD DP slave with 16 words output starting from PQW336. That covers PQB336-PQB367. So, you have to transfer 368 bytes. Like I said before, you MUST send all bytes starting from 0 to the last byte in the output image that is being adressed. Maybe you should archive your project, and post it here. Then I can give it a go.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0