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.
Thank you very much in advance.
Jason Law
[?]: STL Code mitsubishi =>Siemens
-
- Site Admin
- Posts: 1387
- Joined: Sat Aug 13, 2005 6:15 am
Re: Siemens STL Code
try this,not checked
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
-
- Posts: 21
- Joined: Thu Sep 02, 2010 6:12 pm
- Location: BRAZIL
Re: Siemens STL Code
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
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
-
- Site Admin
- Posts: 1387
- Joined: Sat Aug 13, 2005 6:15 am
Re: Siemens STL Code
sfc20 copy byte to byte,he need byte to word
-
- Posts: 10
- Joined: Fri Feb 20, 2009 3:02 am
- Location: Taiwan
Re: [?]: STL Code mitsubishi =>Siemens
Try this:
enjoy!!
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!!
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!!
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!!
-
- Posts: 36
- Joined: Wed Nov 21, 2007 2:13 pm
- Location: China
Re: [?]: STL Code mitsubishi =>Siemens
SIEMENS PLC can only open one DB and one DI in the same time.
-
- Posts: 10
- Joined: Fri Feb 20, 2009 3:02 am
- Location: Taiwan
Re: Siemens STL Code
sania wrote:try this,not checkedCode: 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
-
- Site Admin
- Posts: 1387
- Joined: Sat Aug 13, 2005 6:15 am
Re: [?]: STL Code mitsubishi =>Siemens
you are not right it`s yes update from loop MW !
-
- Posts: 10
- Joined: Fri Feb 20, 2009 3:02 am
- Location: Taiwan
Re: [?]: STL Code mitsubishi =>Siemens
Hi ! Sania
You are right! I forget the loop counter is decrease 1 of every loop cycle.
You are right! I forget the loop counter is decrease 1 of every loop cycle.
-
- Posts: 6
- Joined: Sun Dec 12, 2010 9:32 am
Re: [?]: STL Code mitsubishi =>Siemens
Hi all ,
thank you so much for helping. The loop function is work perfectly.
thank you so much for helping. The loop function is work perfectly.
-
- Posts: 6
- Joined: Sun Dec 12, 2010 9:32 am
? mitsubishi ---> siemens byte to word function
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
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
-
- Site Admin
- Posts: 1387
- Joined: Sat Aug 13, 2005 6:15 am
Re: [?]: STL Code mitsubishi =>Siemens
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