09.12.2012 Views

Basic Characteristics RAPID

Basic Characteristics RAPID

Basic Characteristics RAPID

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Program execution<br />

Example<br />

Limitations<br />

The text string is written to a specified file or serial channel. If the argument \NoNewLine<br />

is not used, a line-feed character (LF) is also written.<br />

If one of the arguments \Num, \Bool, \Pos or \Orient is used, its value is first converted<br />

to a text string before being added to the first string. The conversion from value to text<br />

string takes place as follows:<br />

Argument Value Text string<br />

\Num 23 "23"<br />

\Num 1.141367 "1.14137"<br />

\Bool TRUE "TRUE"<br />

\Pos [1817.3,905.17,879.11] "[1817.3,905.17,879.11]"<br />

\Orient [0.96593,0,0.25882,0] "[0.96593,0,0.25882,0]"<br />

Decimals are rounded off to 5 places of decimals, but there may be no more than 6 digits<br />

in the text string. If the decimal part is less than 0.000005 or greater than 0.999995,<br />

the number is rounded to an integer.<br />

VAR iodev printer;<br />

.<br />

Open "sio1:", printer\Write;<br />

WHILE DInput(stopprod)=0 DO<br />

produce_part;<br />

Write printer, "Produced part="\Num:=reg1\NoNewLine;<br />

Write printer, " "\NoNewLine;<br />

Write printer, CTime();<br />

ENDWHILE<br />

Close printer;<br />

A line, including the number of the produced part and the time, is output to a<br />

printer each cycle. The printer is connected to serial channel sio1:. The printed<br />

message could look like this:<br />

Produced part=473 09:47:15<br />

The arguments \Num, \Bool, \Pos and \Orient are mutually exclusive and thus cannot<br />

be used simultaneously in the same instruction.<br />

This instruction can only be used for files or serial channels that have been opened for<br />

writing.<br />

8-Write-2 <strong>RAPID</strong> Reference Manual

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!