S7-300/400ͨ¹ýÒÔÌ«Íø½Ó¿ÚÓëS7-200 SMART PLC Ö®¼äµÄS7ͨѶ¾ÓɲâÊÔÊÇ¿ÉÒÔÀֳɵģ¬¿ÉÊÇÐèÒªS7-300/400²à±à³ÌŲÓÃPUT/GETÖ¸Á¼û±í1Ëùʾ¡£

±í1
S7ͨѶÏÈÈÝ
S7ͨѶÊÇS7ϵÁÐPLC»ùÓÚMPI¡¢PROFIBUS¡¢ETHERNETÍøÂçµÄÒ»ÖÖÓÅ»¯µÄͨѶÐÒ飬Ö÷ÒªÓÃÓÚS7-300/400PLCÖ®¼äµÄͨѶ¡£S7-300/400ͨ¹ýÒÔÌ«Íø½Ó¿ÚÓëS7-200 SMART PLC Ö®¼äµÄS7ͨѶ¾ÓɲâÊÔÊÇ¿ÉÒÔÀֳɵģ¬¿ÉÊÇÐèÒªS7-300/400²à±à³ÌŲÓÃPUT/GETÖ¸Á¼û±í1Ëùʾ¡£
±í 1 PUTºÍGET £ºS7-300/400ƾ֤ʹÓÃͨѶ½Ó¿Ú£¨¼¯³ÉµÄPN¿Ú»òCP343-1/CP443-1£©²î±ð£¬Å²ÓõĹ¦Ð§¿éȪԴҲ²î±ð¡£Í¨Ñ¶½Ó¿ÚΪS7-300 ¼¯³ÉPN½Ó¿Úʱ£¬ÐèҪʹÓÃStandard LibraryÖÐPUT/GETÖ¸Áî¡£
ͨѶ½Ó¿ÚΪS7-300 CPͨѶģ¿éʱ£¬ÐèҪʹÓÃSIMATIC_NET_CP ¿âÖÐPUT/GETÖ¸Áî¡£
S7-400 CPU²»Çø·ÖͨѶ½Ó¿Ú£¬ÐèҪʹÓÃSystem Function Blocks ÖеÄSFB14/SFB15Ö¸Áî¿é¡£
Ó²¼þ¼°ÍøÂç×é̬
±¾ÎÄÒÔ½ÓÄÉ1¸ö315-2PN/DP£¬1¸öS7-200 SMART PLCΪÀý£¬ÏÈÈÝËüÃÇÖ®¼äµÄS7ͨѶ¡£ÔÚSTEP7Öн¨ÉèÒ»¸öÐÂÏîÄ¿£¬ÏîÄ¿Ãû³ÆÎªS7-300-SMART¡£²åÈë1¸öS7-300Õ¾£¬ÔÚÓ²¼þ×é̬ÖвåÈëCPU 315-2 PN/DP¡£
STEP7 ÏîÄ¿ÖвåÈëS7-300Õ¾µãÉèÖÃCPU 315-2PN/DPµÄIPµØÖ·£º192.168.0.1£¬Ó²¼þ×é̬Íê³Éºó£¬¼´¿ÉÏÂÔØ¸Ã×é̬¡£
ÉèÖÃCPU PN IPµØÖ··¿ª¡°NetPro¡±ÉèÖÃÍøÂç²ÎÊý£¬Ñ¡ÖÐCPU 315-2PN/DP£¬ÔÚÅþÁ¬ÁбíÖн¨ÉèеÄÅþÁ¬¡£
Ñ¡Ôñ Unspecified Õ¾µã£¬Ñ¡ÔñͨѶÐÒé S7 connection£¬µã»÷ Apply¡£
ÔÚµ¯³öµÄS7 connectionÊôÐÔ¶Ô»°¿òÖУ¬¹´Ñ¡ Establish an active connection,ÉèÖÃPartner address:192.168.0.2(S7-200 SMART PLC IP µØÖ·)¡£
ÉèÖÃS7ÅþÁ¬²ÎÊýµã»÷ 'Address Details' £¬ÔÙµ¯³öÀ´µÄ¶Ô»°¿òÉèÖà Partner µÄ Slot Ϊ1¡£µã»÷ OK¼´¿É¹Ø±Õ¸Ã¶Ô»°¿ò¡£
ÍøÂç×é̬½¨ÉèÍê³Éºó£¬ÐèÒª±àÒë¡£
ÉúÑIJ¢±àÒëÅþÁ¬ÍøÂç×é̬±àÒëÎÞ´í£¬Êó±êÏȵã»÷ CPU 315-2PN/DP ,È»ºóµã»÷ÏÂÔØ°´Å¥ÏÂÔØÍøÂç×é̬¡£
³ÌÐò±à³Ì
¿ÉÒÔͨ¹ýSFB/FB 14 'GET'£¬´ÓÔ¶³ÌCPUÖжÁÈ¡Êý¾Ý¡£
S7-300£ºÔÚREQµÄÉÏÉýÑØ´¦¶ÁÈ¡Êý¾Ý¡£ÔÚREQµÄÿ¸öÉÏÉýÑØ´¦´«ËͲÎÊýID¡¢ADDR_1ºÍRD_1¡£ÔÚÿ¸ö×÷Òµ¿¢ÊÂÖ®ºó£¬¿ÉÒÔ·ÖÅÉÐÂÊýÖµ¸øID¡¢ADDR_1ºÍRD_1²ÎÊý¡£
S7-400£ºÔÚ¿ØÖÆÊäÈëREQµÄÉÏÉýÑØ´¦Æô¶¯SFB¡£ÔÚ´ËÀú³ÌÖУ¬½«Òª¶ÁÈ¡µÄÇøÓòµÄÏà¹ØÖ¸Õë(ADDR_i)·¢Ë͵½»ï°éCPU¡£Ô¶³Ì»ï°é·µ»Ø´ËÊý¾Ý¡£ÔÚ ÏÂÒ»¸öSFB/FBŲÓô¦£¬ÒÑÎüÊÕµÄÊý¾Ý±»¸´ÖƵ½×é̬µÄÎüÊÕÇø(RD_i)ÖС£±ØÐèҪȷ±£Í¨¹ý²ÎÊýADDR_iºÍRD_i½ç˵µÄÇøÓòÔÚ³¤¶ÈºÍÊý¾ÝÀàÐÍ·½Ãæ ÒªÏ໥ƥÅ䡣ͨ¹ý״̬²ÎÊýNDRÊýֵΪ1À´Ö¸Ê¾´Ë×÷ÒµÒÑÍê³É¡£
Ö»ÓÐÔÚǰһ¸ö×÷ÒµÒѾÍê³ÉÖ®ºó£¬²Å»ªÖØÐ¼¤»î¶Á×÷Òµ¡£Ô¶³ÌCPU¿ÉÒÔ´¦ÓÚRUN»òSTOPÊÂÇé״̬¡£ÈôÊÇ ÕýÔÚ¶ÁÈ¡Êý¾Ýʱ±¬·¢»á¼û¹ÊÕÏ£¬»òÈôÊÇÊý¾ÝÀàÐͼì²éÀú³ÌÖÐÍÉ»¯£¬ÔòÍÉ»¯ºÍÖÒÑÔÐÅÏ¢½«Í¨¹ýERRORºÍSTATUSÊä³öÌåÏÖ¡£
ͨ¹ýʹÓÃSFB/FB 15 'PUT'£¬¿ÉÒÔ½«Êý¾ÝдÈëµ½Ô¶³ÌCPU¡£
S7-300£ºÔÚREQµÄÉÏÉýÑØ´¦·¢ËÍÊý¾Ý¡£ÔÚREQµÄÿ¸öÉÏÉýÑØ´¦´«ËͲÎÊýID¡¢ADDR_1ºÍSD_1¡£ÔÚÿ¸ö×÷Òµ¿¢ÊÂÖ®ºó£¬¿ÉÒÔ¸øID¡¢ADDR_1ºÍSD_1²ÎÊý·ÖÅÉÐÂÊýÖµ¡£
S7-400£ºÔÚ¿ØÖÆÊäÈëREQµÄÉÏÉýÑØ´¦Æô¶¯SFB¡£ÔÚ´ËÀú³ÌÖУ¬½«Ö¸ÏòҪдÈëÊý¾ÝµÄÇøÓò(ADDR_i)µÄÖ¸ÕëºÍÊý¾Ý(SD_i)·¢Ë͵½»ï°éCPU¡£Ô¶³Ì»ï°é½«ËùÐèÒªµÄÊý¾ÝÉúÑÄÔÚËæÊý¾ÝÒ»ÆðÌṩµÄµØÖ·ÏÂÃæ£¬²¢·µ»ØÒ»¸öÖ´ÐÐÈ·ÈÏ¡£±ØÐèҪȷ±£Í¨¹ý²ÎÊýADDR_iºÍSD_i½ç˵µÄÇøÓòÔÚ±àºÅ¡¢³¤¶ÈºÍÊý¾ÝÀà ÐÍ·½ÃæÏ໥ƥÅä¡£
ÈôÊÇûÓб¬·¢Èκιýʧ£¬ÔòÔÚÏÂÒ»¸öSFB/FBŲÓÃʱ£¬Í¨¹ý״̬²ÎÊýDONEÀ´Ö¸Ê¾£¬ÆäÊýֵΪ1¡£Ö»ÓÐÔÚ×îºóÒ»¸ö×÷ÒµÍê³ÉÖ®ºó£¬²Å»ªÔٴ줻îд×÷Òµ¡£Ô¶³Ì CPU¿ÉÒÔ´¦ÓÚRUN»òSTOPģʽ¡£ÈôÊÇÕýÔÚдÈëÊý¾Ýʱ±¬·¢»á¼û¹ÊÕÏ£¬»òÈôÊÇÖ´Ðмì²éÀú³ÌÖÐÍÉ»¯£¬ÔòÍÉ»¯ºÍÖÒÑÔÐÅÏ¢½«Í¨¹ýERRORºÍSTATUSÊä³ö ÌåÏÖ¡£·¿ªSIMATIC 315 PN-1µÄOB1£¬ÔÚOB1ÖÐÒÀ´ÎŲÓÃFB14£¬FB15¡£