Professional Documents
Culture Documents
Script PDF Autohedsout
Script PDF Autohedsout
( )
20-1
20.1
D-Scripts ,- . +'//" /*0)"!"# 12 + #2 !" +" $34# 1!"$34#%
2 $ GP ## ' $ GP 34&%''+'
7
!"# 3 !$
ËÅѧ¨Ò¡ ËÅѧ¨Ò¡ ËÅѧ¨Ò¡
1 ÇÔ¹Ò·Õ 2 ÇÔ¹Ò·Õ 3 ÇÔ¹Ò·Õ
àÇÅÒ
»ÃÐÁÇżÅʤÃÔ»µ »ÃÐÁÇżŠ»ÃÐÁÇżŠ»ÃÐÁÇżÅ
D0099 C D0200 C
Screen 1 Screen 2
D200≥70
Tank temperature Temperature is ( 20-19)
D200 50 too high!!
( 20-18)
D20
0≤3
0
Screen 3
Temperature is
too low.
GP
Product Name and Price printer output ( 20-35)
Product Name
(1000)
Price
(0500)
( 20-22)
Pro-face 12345 Yen
Start à»´
#" #$%&/* " %' ( ," 7 %% 0' + 3
ËÅѧ¨Ò¡ ËÅѧ¨Ò¡ ËÅѧ¨Ò¡
1 ÇÔ¹Ò·Õ 2 ÇÔ¹Ò·Õ 3 ÇÔ¹Ò·Õ
àÇÅÒ
»ÃÐÁÇżÅʤÃÔ»µ »ÃÐÁÇżŠ»ÃÐÁÇżŠ»ÃÐÁÇżÅ
&'"(
Assignment (=) )345!-*345
Addition (+) %$-*+./0!
if ( ) &-!,' ( ) $+ if '')'!
$+!) if ( )
Equivalent (==) '$'345 *! ř $'345!
$,'#!-(
LS0008
A.1.4.2 !"# !! ( A-10)
Timer % - " ' "%$' [Timer Settings] , 1
1 ) [Common Settings] - $2 # [Global D-Script Settings]
2 $ [Create] , " !"#$%& +"' " "3 ID "$ [Edit]
4 % + 2 #$%& ( &) Timer % - " ' "%$' [Timer Settings]
, 1
5 $6 [Tool Box] $34# 1!"' $ #'$2 #!"+"#$%&+" ' '
$'$$2 #%"
6 #" #$%&1 2 1%$' %" D00100 , 0 " $' *$ 1
3$ 01
$ [Address Input Dialog] [Word Address] "$
11 #" #$%&1# 1# +- 6 ( ) )'% if ,
2 )'"$ $2 # if ( )
$ [if - endif]
12 #" & + 6 ( ) )' if & + $' 6+" D00100 3
+ , $' '
$& /&" )' 6 ( ) "2 /2 % 6 1* 7 #' D00100 *$
14 $& /&" )' 68 { } "*' 2 /2 % 6 1* 7 #' LS0008 $*
16 #$%& #6#)4&
#" #$%& % * (0 , 1) %2 '% M0100 "$") 6+"
34& !%'++"%2 '
D0099 C D0200 C
B B
D0000 A D0101 A
&'"(
$,'#!-./$)%(!
Copy ''+ )*# )*!$
Memory )*!*.+ $
memcpy ( ) [Format]
memcpy ([ )*$], [ )*$] )!!)
% * "%$' [Bit Address] , M000100
1 ) [Part] - $2 # [D-Script] $
4 % + 2 #$%& ( &) % * "%$' [Bit Address] , M000100
7 $ [Copy Memory] "%$' %2 ' %2 '%" 2 %2 '
'%"% $
9 72 %2 ' , 100 2 /2 % 8 %$' %2 ' &%" , D00000 "$ [OK]
10 #$%& #6#)4&
34-)% %"0 34& !%'+" #"$ " %
%2 ' 6")34-) (D200) $' *1*%%' 70°C *+ $' 1*
%%' 30°C + #$%&2 "0 %"
Screen 1 Screen 2
D200≥70
Tank temperature Temperature is
D200 50 too high!!
D20
0≤ 3
0
Screen 3
Temperature is
too low.
D200 70°C !" # $% : LS0300
D200 ## 30°C #!" # $% : LS0301
$ &'#($)*($$() : LS0302
&'"(
% * "%$' [Bit Address] , M000100
1 ) [Part] - $2 # [D-Script] $
5 % + 2 #$%& ( &) % * "%$' [Bit Address] , M000100
#" Extended Script #'")' +" &$"/* !%'&% USB + $&%'
&% COM13
GP
Start à»´
GP
ºÑ¿à¿ÍÃ
ºÑ¿à¿Íà databuf0
¡ÒÃÃѺ¢ŒÍÁÙÅ databuf1
ÍØ»¡Ã³/PLC Extended Script
ºÑ¿à¿Íà databuf2
¡ÒÃÊ‹§¢ŒÍÁÙÅ databuf3
˹‹Ç¤ÇÒÁ¨ÓÀÒÂã¹
¾×é¹·Õè LS, USR ÏÅÏ
))&/))&
#2 ## 34&/PLC 9 9&2 " ,' $ 2 %/*$ ")
+"")#' +&
databuf0 *+ databuf3
9& ' $' $ 2 +%& (8 %) /*2 " ,%2 ' 6") %'9 9&
' 1 KB
!
¿˜§¡ªÑ¹ËÅÑ¡
¡Ó˹´Ç‹Ò¨ÐàÃÔèÁ¾ÔÁ¾ËÃ×ÍäÁ‹ àÁ×èÍáµÐ·Õè Printer Start Button
INIT (¿˜§¡ªÑ¹·Õè¡Ó˹´â´Â¼ÙŒãªŒ)
µÑ駤‹Ò¡ÒÃàÃÔèÁ¡Ò÷ӧҹ¢Í§ºÑ¿à¿ÍáÒÃÊ‹§¢ŒÍÁÙÅ, ºÑ¿à¿ÍáÒÃÃѺ¢ŒÍÁÙÅ
áÅТŒÍ¼Ô´¾ÅÒ´
PINIT (¿˜§¡ªÑ¹·Õè¡Ó˹´â´Â¼ÙŒãªŒ)
àÃÔèÁ¡Ò÷ӧҹ¢Í§à¤Ã×èͧ¾ÔÁ¾
Strset (¿˜§¡ªÑ¹·Õè¡Ó˹´â´Â¼ÙŒãªŒ)
à»ÅÕè¹ÃٻẺ¢Í§¢ŒÍÁÙÅà¾×èÍâ͹¢ŒÍÁÙÅ¡ÒþÔÁ¾ä»·Õèà¤Ã×èͧ¾ÔÁ¾
Print (¿˜§¡ªÑ¹·Õè¡Ó˹´â´Â¼ÙŒãªŒ)
à¾ÔèÁ “¡ÒâÖ鹺Ã÷ѴãËÁ‹” à¾×èÍãËŒà¤Ã×èͧ¾ÔÁ¾¾ÔÁ¾ä´ŒÍ‹ҧµ‹Íà¹×èͧ
áÅÐâ͹¢ŒÍÁÙÅ¡ÒþÔÁ¾ä»·Õèà¤Ã×èͧ¾ÔÁ¾
&
(1) ¡Ãкǹ¡ÒÃËÅÑ¡ (2) ¿˜§¡ªÑ¹¡ÒÃàÃÔèÁ¡Ò÷ӧҹ (INT)
¡Ãкǹ¡ÒÃËÅÑ¡ ¡ÒÃàÃÔèÁ¡Ò÷ӧҹ
Ōҧ¢ŒÍÁÙÅ㹺ѿà¿ÍÃ
ºÔµàÃÔèÁµŒ¹¡ÒÃÊ×èÍÊÒà ¡ÒÃÊ‹§¢ŒÍÁÙÅ
äÁ‹ãª‹
à»´
㪋 ºÔµàÃÔèÁµŒ¹¡ÒÃÊ×èÍÊÒÃ
»´ Ōҧ¢ŒÍÁÙÅ㹺ѿà¿ÍÃ
¡ÒÃÃѺ¢ŒÍÁÙÅ
ÁÕ¢ŒÍÁÙÅ¡ÒÃÃѺÍÂÙ‹ äÁ‹ãª‹
Ōҧ¢ŒÍ¼Ô´¾ÅÒ´
㪋
¡ÒÃàÃÔèÁ¡Ò÷ӧҹ¢Í§
Extended SIO
àÊÃç¨ÊÔé¹
¡ÒÃàÃÔèÁ¡Ò÷ӧҹ
¢Í§à¤Ã×èͧ¾ÔÁ¾
¡ÒÃÊ‹§¢ŒÍÁÙÅ
¡ÒÃàÃÔèÁ¡Ò÷ӧҹ¢Í§à¤Ã×èͧ¾ÔÁ¾ Ê‹§
¡Ó˹´¢ŒÍÁÙÅ¡ÒÃàÃÔèÁ µÑ駤‹ÒʵÃԧʋǹËÑÇ
¡Ò÷ӧҹ¢Í§à¤Ã×èͧ¾ÔÁ¾ ãËŒºÑ¿à¿ÍâŒÍÁÙÅ
ãËŒºÑ¿à¿ÍâŒÍÁÙÅ
Ê‹§¢ŒÍÁÙÅ ÅÙ» 1
á»Å§¢ŒÍÁÙÅ·Õè¡Ó˹´ãËŒµÓá˹‹§
â´Âá»Å§¨Ò¡¤‹ÒàÅ¢°Ò¹Êͧ
ãˌ໚¹ÃËÑÊ ASCII
àÊÃç¨ÊÔé¹
á»Å§¢ŒÍÁÙÅ
ÂÒÇ 30 ÍÑ¡¢ÃÐáÅŒÇ?
ÅÙ» 1
µÑ駤‹ÒʵÃԧʋǹ·ŒÒÂ
ãËŒºÑ¿à¿ÍâŒÍÁÙÅ
àÊÃç¨ÊÔé¹
Ê‹§
àÃÕ¡¢ŒÍÁÙÅ¡ÒÃÊ‹§
¡Ó˹´¢ŒÍÁÙźÃ÷ѴãËÁ‹
ãËŒºÑ¿à¿ÍâŒÍÁÙÅ
Ê‹§¢ŒÍÁÙÅ
àÊÃç¨ÊÔé¹
. &'"()
$&('
#$ ), &-
3< Start $& (' $ 2 - 005000) #1 ON " 4 ' &
+%&") Print Permit +'
") Print Permit 2 %'+ ,% ' ")2 $&
Print Preparation OK: Send 0x31 (ASCII code 1) to the device/PLC.
Print Preparation Invalid: Send 0x30 (ASCII code 0) to the device/PLC.
GP ") Print Permit databuf0 " " ")+' $ 2 - 100 /* " 1*+"' '
" #$%&%'+
' $ 2 - 100 +"") 0x31 (ASCII code 1) & * +"")
0x30 (ASCII code 0) GP + 3 %""5%%/2 ' +"") 0x31
˹ŒÒ¨Í·ÕèÊÌҧ¢Öé¹
#$ ), &-
%$' 2 9 9& #'") 9 9& ") "0
. PINIT (&'"(%)*+()
$&('
#$ ), &-
2 $& #'$2 # ESC/P ESC+@ + $&
GP
1 2
databuf0 databuf1
0x1B 0x40
( “ESC” ) ( “@” )
3
databuf0
“ESC+@”
( “ESC+@” )
. Strset (&'"(%)*+()
$&('
#$ ), &-
1 "$ Price: Yen ") $ 6 )'%2 ' 0500 ' $ 2 -
¨Ò¡Ë¹ŒÒ¨Í
Price
(0500)
GP
YYY Yen
1
databuf0 databuf1 2
à»ÅÕè¹¢ŒÍ¤ÇÒÁ
Price: XXX áÅŒÇà¡çºänj㹠databuf1
3
databuf0
Price: XXX GP
3 4
databuf0 databuf1
5
databuf0
2 )") #'") &+ $& '")#% (Product Name) 6+"
% 2 %2 ' 1000 ' $ 2 - ,' +%& " 6")' %2 '
2000 1* 2030 ' $ 2 - 6 ,")#%+%&'
!"9:&! _ldcopy 6") databuf2 % 2 +%&' #3%2 ' &%'
ËÁÒÂà赯 9:&! _ldcopy 2 ")+ 6+" , & 6 ; +%&2 %2 ' 9 9&
+'#")+%&2 #)'
¨Ò¡Ë¹ŒÒ¨Í
Product Name
(1000)
Pro-face
à¡çº¢ŒÍÁÙÅ໚¹Ë¹‹ÇÂ亵
˹‹Ç¤ÇÒÁ¨ÓÀÒÂã¹ databuf2
(16 ºÔµ) (8 bit)
2000 0 P databuf2[0] P
2001 0 r databuf2[1] r
2002 0 o à¡çºà»š¹äºµÅӴѺµèÓ·Õè databuf2[2] o
2003 0 - databuf2[3] -
databuf 2
2004 0 f databuf2[4] f
2005 0 a databuf2[5] a
2006 0 c databuf2[6] c
2007 0 e databuf2[7] e
2008 0 0 databuf2[8] 0
: : :
2030 0 0 databuf2[30] 0
1 2
databuf1 databuf2
3
databuf1
3 4
databuf1 databuf0
5
databuf1
. Print (&'"(%)*+()
$&('
#$ ), &-
1 *' " $&&+" ' %'
GP
1 2
databuf1 databuf0
Product Name: Pro-face Price: XXX Yen 0x0d
("CR")
3
databuf1
3 4
databuf1 databuf0
Product Name: Pro-face Price: XXX Yen "CR" 0x0a
("LF")
5
databuf1
Start à»´ Product Name: Pro-face Price: XXX Yen "CR" "LF"
&'"(
&-!,' ( ) $+ if '')'!
if ( ) $+!) if ( )
Label Settings */+ ()!#' ) $#'-!( +$#'./'
[r:EXT_SIO_RECV] *''!
Equivalent (==) N1 $' N2 (N1 = N2)
Text Settings (_strset) ,' *'' !-'66+
Extended Receive '+ $'.-+$#' (#' ) Extended SIO
(IO_READ_EX) *!,'#!-'66+
From Data Buffer to Internal + * #' $,'#!-6 , '66+ 2+#%&($ LS
Device (_dlcopy) )!
Label Settings !*!'.(-0%&+-'66+ '66'+
[c:EXT_SIO_CTRL∗∗] *2"%
Connect Text (_strcat) 0& &!'66!
Text Length (_strlen) '!! $,'#!
Extended Send
+-'66+! Extended SIO )!#' $
(IO_WRITE_EX)
Assignment (=) )345!-*345
Addition (+) %$-*+./0!
Numeric Value Decimal String -0640( %&*)! ,- 7'
Conversion (_bin2decasc)
From Internal Device + $,'+-%&($ LS 2+#'66+ )!
To Data Buffer (_ldcopy) -2+*''#' #'
!
1 2 Extended Script !" ## $ [Project] - [System Settings] - [Script Settings]
%#"'' +"%$' [Type] , [Extended Script] "
3 INIT ,9:&!2 0)"!" $6 [Function] "$3< [Create]
User Define Function
5 #" #$%& Execution Expression " 7$2 # "$ $2 # $' $
6 5%% %0' PINIT ,9:&!2 0)"!" 7 [PINIT] ,!9:&!
"#" #$%&%'+ Execution Expression
7 5%% %0' Strset ,9:&!2 0)"!" 7 [Strset] ,!9:&!
"#" #$%&%'+ Execution Expression
(1)
(2)
(3)
8 5%% %0' Print ,9:&!2 0)"!" 7 [Print] ,!9:&!
"#" #$%&%'+ Execution Expression
20.6 !
20.6.1 ! D-Scripts/Global D-Scripts
8 [Global D-Script Settings] +
8 [D-Script] + [Part]
[Common Settings]
!
&'"() #%)*+(
$ [Create] ' User Defined Function 9(
&'"(%)*+(%, %+$
&640$)"+-0$./ *# *! [Edit]
640$)"+-0$$'#!9(
ËÁÒÂà˵Ø
20.7 !!
#$%&#" *# 1!" + & 7 !%'+
-# .+
Continuous Action 2+$
Timer 2+$'!$)
Bit ON & GP !%'' $)% 0 1 2+$
Bit OFF & GP !%''' $) 2+$
Bit
& GP !%'' $)% 0 1 & 1 0
Bit Change
2+$
When Condition
is Satisfied & GP !%'!%$)#! 2+$
Condition
Expression When Condition
is not Satisfied & GP !%'!%$)#! $, 2+$
20.7.2 Timer
Timer
#$%&2 3$$ 2 +" $34# 1% %% +"%%' 1 1*
32,767
t t
t [ ]
ËÁÒÂà赯 % 9:&!%% $' " 2 +" + "0
!"##0 9:&!%% 2 +"!" * )' !"
" !"&")" #2 ") % #2 #0
) 3 "2 &% (" 20-47)
!" D-Script " 2 "9:&!%% 0 '
20.7.3 Bit
Bit ON
GP %' %2 '%2 +" ( &%) $' 0 , 1 #$%&1) &
Bit OFF
GP %' %2 '%2 +" ( &%) $' 1 , 0 #$%&1) &
Bit Change
GP %' %2 '%2 +" ( &%) $' 0 , 1 1 , 0
#$%&1) &
!% !!#
2 ")34& !%'" '
## ")34& !%' )' !"%2 # & >.- GP
,2 ' $ "0 ## "0 +"
%$' %!" + & D-Script " , % %'%=40
D-Script !" % 4#0#/2 ( $ 2 "%+' *%+"
& D-Script $' ' $'$' ' +":3 4 ' &
4$' , +' ' +6% ' #%'$ $' 6+"%2 '%
!"' & ,$' "' $' +' #$%&2 6%
' $' ' #$%'+ '
*!'&:
!'& &!$-0-+*)+ GP
#$ PLC +2+,'+7- )* LS2037
./1- !!$ (ms) !&$'
±10 !$
!)'*":
!)'*" &!$-0-*"/)!/
1 !(2+,'+7- )* LS2036
./1- !!$ (ms) !&$'
±10 !$
% % ' +'!" % D-Script 2 % ' '
0 ,
#" D-Script !' 1*" 1*"7")" %/2 ( $ %' $2
#6#0 " ' 0 $' $' #6%'$' +
%% + $0+'' $' '" , !'+
!
!! $' if ( )
%"&
'()* +'
./ 3 0$2&#
)'+% !'./1- +$
A.1.3 &'.//PLC $ GP #' (!;0& "!!))
( A-5)& A.1.2 &'.//PLC #" $)
(!;0& ) ( A-3)
<%0& "!!)
%!, ! #INTERNAL : ) USR ./1- GP
(
#MEMLINK : )./$0& "!!)
<%./$0& (!0& "!!))
0&./* !
(PLC1 ==) : )./* !
#INTERNAL : )./1- GP
0& "!!)*./$0&
0&./* !
: )./* !
(PLC1 ==)
#INTERNAL : )./1- GP
#MEMLINK : )./$0& "!!)
& %+ "
%"&
$' $(-640$)"+-0
& 2-0#
)'% !'640
$)"+-0 +$
20.8.2 )*)- (640$)"+-0
( 20-54)
./2&)$-0#- # 0!
!-:)
*2&)0 * )*
!$-0- #!
)'+% !')$-0# +$
'$$ 21 )*% * ( 21-1)
Tool Box
20.9 !%
20.9.1 !% ! D-Script/Global D-Script
. " SIO
%2 '2 9:&! Send/Receive +' )'2 %2 ' D-Script
Control ,% ") ' #' Status Received Data ,%' '
" ' ")% Control ")% Status 2 " 2 "
"#" D-Scripts (9:&!) %' #2 #'
#2 ") % 0 1' ") )
3 (( 20-25)
!'!"+"34& LS # 1 6")9:&! Send/Receive +" $#2 0)"!" (LS20 1*
LS2031 LS2096 1* LS8191)
[System Settings] - [Script Settings] +'+"%$' [D-Script/Global D-Script] +" % 13
LS2032 ,#1 = ' 9:&! Send, 9:&! Receive, % Control, %
Status $34#% Received Data Size
#2 ") $#" 34&- )
A.1.4.3 &+$ 45 (( A-16)
!"9:&! Send/Receive "%$' $ % D-Script , 16 %
' 2 " %$' $ % , 32 %
9 9& #'") ' 2048 +%& #'9 9& ") 8192 +%& #?? 4 ER
( %&%3 ) #?? 4 RS ( %&3%) 1)= 9 9& ")") " " ' " 80%
. $+#0+"
$34!">) & ,% division (/) remainder (%) 32 " !">) & ,%
32 $' +'!' BCD % 8 ") &' (LS2032) $ GP =*
%+'= ' = $ GP $ GP " #)'9+&
. D-Script 2 +"' %2 '# %2 '!"' $ 2 '
&* & 2 %2 '#)#3# 1!" D-Script +"$ 255 %2 ' %'$!"%2 '
"" #3 ' 2 +" !"3 4& ' + 6 2 " %#!" '
. $2 # Convert Address ) Utility Project Manager +'# 1%2 '!" D-Script +"
" = D-Script Editor "+%2 ' '
. %$' Connected Device Type " %' Save As ) Project Project
Manager +'# 1"+%2 ' D-Script !"+" "+%2 ' ' !" D-Script Editor
. D-Script 0%' #2 #0 ' !"%2 ' ,2
2 "# - 2 ' 6+"!
. 2 D-Script =* & " ,:
& + &4 '"% &4 '"/ "1
*116! Bit 0 Bit 1 Condition Condition Bit 0 Bit 1 Condition Condition
is not is is not is
Satisfied Satisfied Satisfied Satisfied
!0 !& " ! ! ⎯ ⎯ " ! " ! ⎯ ⎯
! !& ! " ! ⎯ ⎯ " ! " ! ⎯ ⎯
!& ! ! ⎯ ⎯ " ! " ! ⎯ ⎯
" ! " ! " ! " ! " ! " ! " ! " !
1!21 & ⎯ ⎯ " ! ! ⎯ ⎯ " ! !
1!21 ⎯ ⎯ ! " ! ⎯ ⎯ ! " !
' : $)$$*
&&8&
#' : #$)$$*
&&8&
ËÁÒÂà赯 " !"3<" #0#%$' &%# % %" %
7") +'1)%" 2 "%7 +'1)%"
. 2 $' "%2 '#2 " 42 !"$2 # D-Script "
0 D-Scripts "
% '
ID 00000
Data Type: Bin, Data Length: 16 Bit, Sign +/−: None
Trigger: Leading bit ([b:M0000])
[w:[PLC1]D0100]=0 // (1)
[w:[#INTERNAL]LS0008]=30// (2) Switches to Base screen No. 30
[w:[PLC1]D0101]=1 // (3)
[w:[PLC1]D0102]=2 // (4)
!" D-Script " %" " 0 (3) (4) "
20.9.4 !+#+#&"
Overflowing Digit
Overflowing Digit * $2 41): >.
2 $2 4") 16 %+'+"3 $ :
65535 + 1 = 0 ( Overflowing Digit)
(65534 ∗ 2) / 2 = 32766 ( Overflowing Digit)
(65534 / 2) ∗ 2 = 65534 (+' Overflowing Digit)
+ !+*>?9"!
0 & $2 4 >. * )' ' #' $ C:D/" +'
−9 % 5 = − 4
9 % −5 = 4
8 %' >
3> ,0 1): >.
10 / 3 ∗ 3 = 9
10 ∗ 3 / 3 = 10
!+ # +! " BCD
2 ") BCD 2 " Overflowing Digit 0 &+'1)%"