Place of Origin: | Japan |
Brand Name: | Tamagawa |
Certification: | CE |
Model Number: | TS5013N63 |
Minimum Order Quantity: | 1pcs |
---|---|
Packaging Details: | carton |
Delivery Time: | in stock |
Payment Terms: | T/T, Western Union, MoneyGram |
Supply Ability: | 100pcs/week |
Tamagawa: | Tamagawa | TS5013N63: | TS5013N63 |
---|---|---|---|
Japan: | Japan | COLOR: | BLACK |
Material: | Iron | Temperature: | 30-80 |
Dimension: | 50mm |
A single statement typically occupies one line of code. | The following examples show a FOR-TO-DO control statement. (Both forms of coding are syntactically valid.) FOR x := 0 TO max DO |
You can enter multiple statements on one line, or you can break a statement into several lines of code to make the code easier to read. Separators (such as tabs, |
FOR x := 0 TO max DO sum := sum + value(x); END_FOR; |
ine breaks and extra spaces) are ignored during the syntax check. An END statement terminates the control statement. |
A control statement can also be provided with a label. A label is set off by a colon at the beginning of the statement: |
Guang Zhou Lai Jie Electric Co.,LTD
TS5013N63
TS3653N1E3
TS3653N2E4
TS3653N2E5
TS3653N2E6
TS3653N3E7
TS3653N3E8
TS3653N3E9
TS3653N11E1
TS3653N11E2
TS3653N11E3
TS3653N12E4
TS3653N12E5
TS3653N12E6
TS3653N13E7
TS3653N13E8
TS3653N13E9
TS3103N40
TS3641N1E1
TS3641N2E3
TS3641N11E1
TS3641N12E3
TS3664N1E1
Label: <Statement>;
The STEP 7 online help provides a complete SCL programming language reference. A condition is a comparison expression or a logical expression whose result is of type BOOL
(with the value of either TRUE or FALSE). The following example shows conditions of
various types.
#Temperature > 50
#Counter <= 100
#CHAR1 < 'S'
Relational expression
(#Alpha <> 12) AND NOT #Beta Comparison and logical expression
5 + #Alpha Arithmetic expression
A condition can use arithmetic expressions:
● The condition of the expression is TRUE if the result is any value other than zero.
● The condition of the expression is FALSE if the result equals zero.
Addressing
As with LAD and FBD, SCL allows you to use either tags (symbolic addressing) or absolute
addresses in your user program. SCL also allows you to use a variable as an array index.
Absolute addressing
I0.0
MB100"PLC_Tag_1" Tag in PLC tag table
"Data_block_1".Tag_1 Tag in a data block
"Data_block_1".MyArray[#i] Array element in a data block array
Indexed addressing with PEEK and POKE instructions
SCL provides PEEK and POKE instructions that allow you to read from or write to data
blocks, I/O, or memory. You provide parameters for specific byte offsets or bit offsets for the
operation.
Note
To use the PEEK and POKE instructions with data blocks, you must use standard (not
optimized) data blocks. Also note that the PEEK and POKE instructions merely transfer data.
They have no knowledge of data types at the addresses. Reads the byte referenced by byteOffset of
the referenced data block, I/O or memory
area.
Example referencing data block:
%MB100 := PEEK(area:=16#84,
dbNumber:=1, byteOffset:=#i);
Example referencing IB3 input:
%MB100 := PEEK(area:=16#81,
dbNumber:=0, byteOffset:=#i); // when
#i = 3
PEEK_WORD(area:=_in_,
dbNumber:=_in_,
byteOffset:=_in_);
Reads the word referenced by byteOffset of
the referenced data block, I/O or memory
area.
Example:
%MW200 := PEEK_WORD(area:=16#84,
dbNumber:=1, byteOffset:=#i);
PEEK_DWORD(area:=_in_,
dbNumber:=_in_,
byteOffset:=_in_);
Reads the double word referenced by
byteOffset of the referenced data block, I/O or
memory area.
Example:
%MD300 := PEEK_DWORD(area:=16#84,
dbNumber:=1, byteOffset:=#i);
PEEK_BOOL(area:=_in_,
dbNumber:=_in_,
byteOffset:=_in_,
bitOffset:=_in_);
Reads a Boolean referenced by the bitOffset
and byteOffset of the referenced data block,
I/O or memory area
Example:
%MB100.0 := PEEK_BOOL(area:=16#84,
dbNumber:=1, byteOffset:=#ii,
bitOffset:=#j);
POKE(area:=_in_,
dbNumber:=_in_,
byteOffset:=_in_,
value:=_in_);
Writes the value (Byte, Word, or DWord) to
the referenced byteOffset of the referenced
data block, I/O or memory area
Example referencing data block:
POKE(area:=16#84, dbNumber:=2,
byteOffset:=3, value:="Tag_1");
Example referencing QB3 output:
POKE(area:=16#82, dbNumber:=0,
byteOffset:=3, value:="Tag_1");POKE_BOOL(area:=_in_,
dbNumber:=_in_,
byteOffset:=_in_,
bitOffset:=_in_,
value:=_in_);
Writes the Boolean value to the referenced
bitOffset and byteOffset of the referenced
data block, I/O or memory area
Example:
POKE_BOOL(area:=16#84, dbNumber:=2,
byteOffset:=3, bitOffset:=5,
value:=0);
POKE_BLK(area_src:=_in_,
dbNumber_src:=_in_,
byteOffset_src:=_in_,
area_dest:=_in_,