Application Example Blocks for STEP 7 and WinCC flexible

примеры программ
Post Reply
sania
Site Admin
Posts: 1152
Joined: Sat Aug 13, 2005 6:15 am

Application Example Blocks for STEP 7 and WinCC flexible

Post by sania » Tue Nov 17, 2009 9:47 am

now i check example http://support.automation.siemens.com/W ... n/36435784
find problem with use of FB`s as multiple instance of over FB with offset value
for example into FB MOTOR / net 3 use AR2:
поковырял их примерчик,нашёл,что не продумано использование блоков как стат.переменные другого блока
сименс забыл об офсете при вызове,к примеру в болке мотора нетворк 3 команда LAR2 P##QdwState_Struct
грузит адрес не учитывая сдвига по отношению к началу блока

Code: Select all

      LAR1  P##QdwState                 //Start adress of source  
      LAR2  P##QdwState_Struct          //Start adress of destination  
      L     D [AR1,P#0.0]               //Write input value...
      T     D [AR2,P#0.0]               //... into struct

      LAR1  P##OPdwCmd  
      LAR2  P##OPdwCmd_Struct  
      L     D [AR1,P#0.0]
      T     D [AR2,P#0.0]

      LAR1  P##QwAlarm  
      LAR2  P##QwAlarm_Struct 
      L     W [AR1,P#0.0]
      T     W [AR2,P#0.0]
need use it:
наскоряк подрисовал так

Code: Select all

      LAR1  P##QdwState                 //Start adress of source 
      L     #TempAR2
      +AR1  
      LAR2  P##QdwState_Struct          //Start adress of destination
      L     #TempAR2
      +AR2  
      L     D [AR1,P#0.0]               //Write input value...
      T     D [AR2,P#0.0]               //... into struct

      LAR1  P##OPdwCmd
      L     #TempAR2
      +AR1  
      LAR2  P##OPdwCmd_Struct
      L     #TempAR2
      +AR2  
      L     D [AR1,P#0.0]
      T     D [AR2,P#0.0]

      LAR1  P##QwAlarm
      L     #TempAR2
      +AR1  
      LAR2  P##QwAlarm_Struct
      L     #TempAR2
      +AR2  
      L     W [AR1,P#0.0]
      T     W [AR2,P#0.0]
this error present into net 28 of the block
& have this into FB VALVE,FB DIGITAL
эта же ошибка есть и в нетворке 28
и так же и в задвижке,и в дигитальном

sania
Site Admin
Posts: 1152
Joined: Sat Aug 13, 2005 6:15 am

Re: Application Example Blocks for STEP 7 and WinCC flexible

Post by sania » Tue Nov 24, 2009 6:53 am


Post Reply