6/28/2012 3:21 PM | |
Joined: 1/12/2011 Last visit: 3/14/2023 Posts: 68 Rating:
|
Thx for the reply! I will explain you better. I need to transfer about 480 words to PLC using profibus. This is about 5 times the profibus limit. So, I'm using Prolinx Profibus Gateway with internal memory database paging to tranfer all the data divided in 100 words blocks, sending a command called Raw Database Exchange (from PLC to Gateway profibus output to receive the data from gateway profibus input) in this way (see also the attached file): 1 - Command: Send 100 words to output (6 are mailbox command and 94 are data) from a 100 words DB block 2 - Response: Receive 100 words from input (4 are mailbox control and 96 are data) to a 100 words DB block This will be repeated 5 times (96 x 5 = 480). So, I have to syncronize each time to not get the gateway data from previous 100 words. The better way that I found to syncronize it is just to do a small delay. The program will be in this sequence: - Read DB 1 and move the 100 words data to profibus output - Delay 10 ms - Read the profibus input (the response) and move the 100 words data to DB10 - Read DB 2 and move the 100 words data to profibus output - Delay 10 ms - Read the profibus output (the response) and move the 100 words data to DB20 Repeat to DB 3 (30), 4 (40) and 5 (50). I configured the profibus baud rate to 1.5 M, so will be 3 Mbit/s (out-in) or 0.33 ms by bit (5.33 ms by word). The S7 timer works at least with 10 ms. Please, I appreciate if you have a better idea. PS. The PLC is exclusive, not has IO modules and will be used just to read the profibus input data and send to HMI by profinet. I tried to use SFC14 and SFC 15 function blocks but the PLC got a fault (the limit is 64 words to process image). So, I had to use ID and QD variable addresses. Excuse my poor english... Best regards! AttachmentProlinx Gateway Database Paging.pdf (51 Downloads) |
Last edited by: Maselo at: 6/28/2012 6:40 PM |
|
7/1/2012 2:59 AM | |
Joined: 10/7/2005 Last visit: 12/3/2023 Posts: 2997 Rating:
|
Hello Maselo I would not want to depend on Timers and/orgeneral delay loops to achieve what your are trying to do as there are the following number of problems associated with thisapproach. 1.) Timer accuray: S5 Timer have a 10ms resolutionand are updated by the OS in the background. Your 10ms Timer and loop could as such become true anytime from immediately up to 10ms. 2.) Let's say you implement a different approach such as looping through a certain amount of "dummy code" perhaps a100 or 200 or whatevernumber tosimple create the desiredlonger scan time. Your logic now heavily depends on the choosen CPU (i.e. the delay will be faster or longer if executed ina different CPU model). 3.) Assumingyou overcome the above mentioned hurdles somehow (e.g. program a self optimising PLC scantime delay by taking OB1's previous cycle time into account), you still have the Profibus update time to deal with. While Profibus is generally deterministic and you will get a DP Slave response for exampleevery 5 ms, there may and can be instances where the DP Slave gateway issues a Diagnostic message instead of a normal response (or does not respond at all in due time etc. etc.). Your time based "sequencer" logic will stillhappily move on to issue the next set of data which is not what you want. In summary: Listen to Daniel Chartier's advise when he said "Better to think of using coordination signals between the Profibus comms and the CPU program to set events that will coordiante between the two". An acknowledgement or handshaking based handlingisthe only way to program robust communciation. In your case, your Gateway seems to echo back the request header information, I suggest you use this to identify that the information has been processed and that you can now move on to issue the next set of data to it. I hope this helps |
Cheers |
|
Follow us on