Table of Contents - TG Drives

Table of Contents - TG Drives Table of Contents - TG Drives

28.11.2012 Views

50 Text mode 20 R1=102 30 R2=17 40 IPrint 10, R1, R2 The output result is: PL2 MNEMONICS Units OK 102 Units failed 17 Note that the numbers are aligned, this is accomplished by specifying the field-width of the display with the : modifier. If you list the program, you will also notice that the IMAGE will take many PL lines. Since only seven characters of an image will fit into a single PL-code line, the logical IMAGE statement can span many pl-code lines. (In the same way a motion profile with P DATA statements spans multiple PL lines.) But for convenience, the firmware one-line compiler allows entry of a longer image. You should also note the ”; End” comment after the last image statement in the group. It shows where the logical image actually ends. A logical image is terminated by alternately a NUL (\000) character, i.e. the physical image statement has less than seven characters in it. If the last physical IMAGE statement has seven characters, but the next statement is NOT an IMAGE, the logical IMAGE is also terminated. You need to look out for this, so you don’t continue an IMAGE by mistake. 10 Image ”This is” 11 Image ”an ima” 12 Image ”ge.\013\010”; End 20 IPrint 10 Will produce: “This is an image” 22 IPrint 11 Will produce: “an image” 20 IPrint 10 The length when entering an image is limited by the input buffer size, in practice about 100 to 120 characters, depending on how many escape sequences that are entered. The length of a logical IMAGE is only limited to the amount of PL code space that is available. Also note that in IPRINT you can use a register to specify what line the image resides on. A cursor addressing example, this will only work if you have an ANSI or VT100 compatible terminal connected, you must also have turned off the monitor (code \002, see below) to get the desired effect. 10 Image ”\027[%D%;%DH” 20 IPrint 10,R1,40 For a VT100/ANSI compatible terminal, this will send a cursor addressing sequence to row in R1 and column 40. Note the ”%” sign after the first ”D” in the image, it is to delimit, the ”;” so it is not interpreted as a format modifier for the ”D” format. The following escape and control sequences are of interest in an image: \002 Start of TEXT, this character is used to indicate start of text mode printouts, it will disable the normal line-editor control-T and DISP statements from sending characters, to allow the PL program to have full control over what is sent. \003 End of TEXT, allow standard line editor etc. to send characters. User's Manual 5.1 Inmotion Technologies AB Doc. No.9032 0027 01 (B), Rev. 11.07.2001

PL2 MNEMONICS Text mode \000 Internally used to signal end of image, this code can therefore not be presenting the image. These codes are required if you want to use the TREAD statement, or have printout using more than one IPRINT statement and they are not sent to the terminal. If you would like to send these codes, use the %C or %S format as described below. \\ Insert one backslash into the string. \” Insert one quote (”) into the string. %% Print one percent sign. %B Print argument as an 8-bit byte in hexadecimal. %W Print argument as a 16-bit word in hexadecimal. %L Print argument as a 32-bit long-word in hexadecimal. %C Print argument as a character. %S Print argument as a NUL terminated string, i.e. 0 to 4 chars, LSB being printed first. %D Print argument signed decimal with minimum number of spaces. %D:n Print argument signed decimal with minimum n positions. %D;n Print argument signed decimal with minimum n positions, and pad unused places ”0” i.e., 12 in format D: 5 is printed as ”00012”. Note: The number ”n” is a ONE digit HEX number. %D% If you want a ”:” to follow directly after the number, and not being interpreted as a format modifier. %D%; Same as %D% %T TAB to position in argument, this functions does not work if you are using direct cursor addressing, since the system has no knowledge of these sequences. For convenience, a CR/LF sequence is automatically sent if the text mode is exited when the current image is completed, thus the first example will work without the CR/LF sequence. TEXT INPUT To input text/numbers you will use the TREAD statement, you also need to use the IMAGE and IPRINT to output the \002 and \003 codes to control the command monitor. TREAD has the following modifiers: TRead LINE 4 TRead LINE CLR UCH 5 TRead LINE CLR NUM 6 TRead NUM 1 TRead CH 2 TRead UCH 3 Operator code User's Manual 5.1 Inmotion Technologies AB Doc. No.9032 0027 01 (B), Rev. 11.07.2001 51

50<br />

Text mode<br />

20 R1=102<br />

30 R2=17<br />

40 IPrint 10, R1, R2<br />

The output result is:<br />

PL2 MNEMONICS<br />

Units OK 102<br />

Units failed 17<br />

Note that the numbers are aligned, this is accomplished by specifying the<br />

field-width <strong>of</strong> the display with the : modifier.<br />

If you list the program, you will also notice that the IMAGE will take many PL lines.<br />

Since only seven characters <strong>of</strong> an image will fit into a single PL-code line, the<br />

logical IMAGE statement can span many pl-code lines. (In the same way a motion<br />

pr<strong>of</strong>ile with P DATA statements spans multiple PL lines.) But for convenience, the<br />

firmware one-line compiler allows entry <strong>of</strong> a longer image.<br />

You should also note the ”; End” comment after the last image statement in the<br />

group. It shows where the logical image actually ends.<br />

A logical image is terminated by alternately a NUL (\000) character, i.e. the<br />

physical image statement has less than seven characters in it. If the last physical<br />

IMAGE statement has seven characters, but the next statement is NOT an IMAGE,<br />

the logical IMAGE is also terminated.<br />

You need to look out for this, so you don’t continue an IMAGE by mistake.<br />

10 Image ”This is”<br />

11 Image ”an ima”<br />

12 Image ”ge.\013\010”; End<br />

20 IPrint 10 Will produce: “This is an image”<br />

22 IPrint 11 Will produce: “an image”<br />

20 IPrint 10<br />

The length when entering an image is limited by the input buffer size, in practice<br />

about 100 to 120 characters, depending on how many escape sequences that are<br />

entered.<br />

The length <strong>of</strong> a logical IMAGE is only limited to the amount <strong>of</strong> PL code space that<br />

is available. Also note that in IPRINT you can use a register to specify what line the<br />

image resides on.<br />

A cursor addressing example, this will only work if you have an ANSI or VT100<br />

compatible terminal connected, you must also have turned <strong>of</strong>f the monitor<br />

(code \002, see below) to get the desired effect.<br />

10 Image ”\027[%D%;%DH”<br />

20 IPrint 10,R1,40<br />

For a VT100/ANSI compatible terminal, this will send a cursor addressing<br />

sequence to row in R1 and column 40. Note the ”%” sign after the first ”D” in the<br />

image, it is to delimit, the ”;” so it is not interpreted as a format modifier for the ”D”<br />

format.<br />

The following escape and control sequences are <strong>of</strong> interest in an image:<br />

\002 Start <strong>of</strong> TEXT, this character is used to indicate start <strong>of</strong> text mode<br />

printouts, it will disable the normal line-editor control-T and DISP<br />

statements from sending characters, to allow the PL program to have<br />

full control over what is sent.<br />

\003 End <strong>of</strong> TEXT, allow standard line editor etc. to send characters.<br />

User's Manual 5.1 Inmotion Technologies AB<br />

Doc. No.9032 0027 01 (B), Rev. 11.07.2001

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

Saved successfully!

Ooh no, something went wrong!