[?]: STL Code mitsubishi =>Siemens

SIMATIC S7-200/300/400, Step7, PCS7, CFC, SFC, PDM, PLCSIM,
SCL, Graph, SPS-VISU S5/S7, IBHsoftec, LOGO ...
Jason5575
Posts: 6
Joined: Sun Dec 12, 2010 9:32 am

[?]: STL Code mitsubishi =>Siemens

Post by Jason5575 »

Dear Colleagues,

I had a function from mitsubishi PLC , now i am working on converting to siemens PLC.

There is a function in mitsubishi PLC , i can't figure it out when convert to siemens :? i not STL expert
so I hope any STL expert here can help me on this .

Below are the explanation,

Call Function;

DB100.DBB0 - MOVE TO DB200.DBW0 ( Lo BYTE )
DB100.DBB1 - MOVE TO DB200.DBW2 ( Lo BYTE )
DB100.DBB2 - MOVE TO DB200.DBW4 ( Lo BYTE )

Up To

DB100.DBB429 - Move To DB200.DBW....

If i using L and T command i need to repeat 430 times. :cry:

Thank you very much in advance.


Jason Law
sania
Site Admin
Posts: 1387
Joined: Sat Aug 13, 2005 6:15 am

Re: Siemens STL Code

Post by sania »

try this,not checked (no)

Code: Select all

FCxx
     OPN DB100
     OPN DI200
     L 430
lop1:T MW0 //WORD FOR LOOP
     L 1
     -I
     SLW 3
     T #Nr_BYTE //temp var of the FC(FORMAT DINT)
     SLW 1
     T #Nr_WORD //temp var of the FC(FORMAT DINT)
     L DBB[#Nr_BYTE]
     T DIW[#Nr_WORD]
     L MW0
     LOOP lop1
sobanski
Posts: 21
Joined: Thu Sep 02, 2010 6:12 pm
Location: BRAZIL

Re: Siemens STL Code

Post by sobanski »

Hallo

You can use sfc 20 to move a pointer area to another, this function copy all variables in one area and put in another, just like bellow:

CALL "BLKKMOV"
SRCBLK :=P#DB100.DBX 0.0 BYTE 430
RET_VAL:=DB100.DBW440
DSTBLK :=P#DB200.DBX 0.0 BYTE 430


I hope that`s it help you

see ya
sania
Site Admin
Posts: 1387
Joined: Sat Aug 13, 2005 6:15 am

Re: Siemens STL Code

Post by sania »

sfc20 copy byte to byte,he need byte to word
lx0520
Posts: 10
Joined: Fri Feb 20, 2009 3:02 am
Location: Taiwan

Re: [?]: STL Code mitsubishi =>Siemens

Post by lx0520 »

Try this:

Code: Select all

FC**://

           L     P#DBX 0.0
           T     MD     2
           L     P#DBX 0.0
           T     MD     6
           L     430
NEXT:  T     MW    10
          OPN   DB   100
          L     DBB [MD 2]
          OPN   DB   200
          T     DBB [MD 6]
          L     P#DBX 1.0
          L     MD     2
          +D    
          T     MD     2

          L     P#DBX 2.0
          L     MD     6
          +D    
          T     MD     6

          L     MW    10
          LOOP  NEXT

enjoy!! :D :D

For s7 data format, the DB200.DBW0 = DB200.DBB0(high byte)+DB200.DBB1(low byte), above code moved byte to word format but byte data length only, for example: move DB100.DBB0 to DB200.DBB0, IF you want to move data to low byte, Just modify code:
T DBB [MD 6] ==> T DBW[MD6]
enough!!
xdoit
Posts: 36
Joined: Wed Nov 21, 2007 2:13 pm
Location: China

Re: [?]: STL Code mitsubishi =>Siemens

Post by xdoit »

SIEMENS PLC can only open one DB and one DI in the same time.
lx0520
Posts: 10
Joined: Fri Feb 20, 2009 3:02 am
Location: Taiwan

Re: Siemens STL Code

Post by lx0520 »

sania wrote:try this,not checked (no)

Code: Select all

FCxx
     OPN DB100
     OPN DI200
     L 430
lop1:T MW0 //WORD FOR LOOP
     L 1        [color=#FF0000]// here, no update indirect address pointer of loop cycle.[/color]    
     -I         [color=#FF0000]// so, just move DB100.DBB0 to DI200.DBW0 with 430 times.[/color] 
     SLW 3
     T #Nr_BYTE //temp var of the FC(FORMAT DINT)
     SLW 1
     T #Nr_WORD //temp var of the FC(FORMAT DINT)
     L DBB[#Nr_BYTE]
     T DIW[#Nr_WORD]
     L MW0
     LOOP lop1
sania
Site Admin
Posts: 1387
Joined: Sat Aug 13, 2005 6:15 am

Re: [?]: STL Code mitsubishi =>Siemens

Post by sania »

you are not right it`s yes update from loop MW ! 8)
lx0520
Posts: 10
Joined: Fri Feb 20, 2009 3:02 am
Location: Taiwan

Re: [?]: STL Code mitsubishi =>Siemens

Post by lx0520 »

Hi ! Sania

You are right! I forget the loop counter is decrease 1 of every loop cycle.
Jason5575
Posts: 6
Joined: Sun Dec 12, 2010 9:32 am

Re: [?]: STL Code mitsubishi =>Siemens

Post by Jason5575 »

Hi all ,

thank you so much for helping. The loop function is work perfectly.

(pgood)
Jason5575
Posts: 6
Joined: Sun Dec 12, 2010 9:32 am

? mitsubishi ---> siemens byte to word function

Post by Jason5575 »

Dear Colleagues,

I had a function from mitsubishi PLC , now i am working on converting to siemens PLC.

There is a function in mitsubishi PLC , i can't figure it out when convert to siemens i not STL expert
so I hope any STL expert here can help me on this .

Below are the explanation,

Call Function; ignore the source Hi byte and starting address can define as pointer ??

DB100.DBB0 - MOVE TO DB200.DBB0 ( Lo BYTE )
DB100.DBB2 - MOVE TO DB200.DBB1 ( Hi BYTE )
DB100.DBB4 - MOVE TO DB200.DBB2 ( Lo BYTE )
DB100.DBB6 - MOVE TO DB200.DBB3 ( Hi BYTE )
DB100.DBB8 - MOVE TO DB200.DBB4 ( Lo BYTE )
DB100.DBB10 - MOVE TO DB200.DBW5 ( Hi BYTE )


Up To

DB100.DBB???Move To DB200.DBB....

If i using L and T command i need to repeat 430 times.

Thank you very much in advance


Jason Law
sania
Site Admin
Posts: 1387
Joined: Sat Aug 13, 2005 6:15 am

Re: [?]: STL Code mitsubishi =>Siemens

Post by sania »

Code: Select all

FCxx
     OPN DB100
     OPN DI200
     L 430
lop1:T MW0 //WORD FOR LOOP
     L 1
     -I
     SLW 3
     T #Nr_BYTE //temp var of the FC(FORMAT DINT)
     SLW 1
     T #Nr_WORD //temp var of the FC(FORMAT DINT)
     L DBB[#Nr_WORD]                   //changed
     T DIB[#Nr_BYTE]                   //changed
     L MW0
     LOOP lop1