28.11.2012 Views

Table of Contents - TG Drives

Table of Contents - TG Drives

Table of Contents - TG Drives

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PL2 MNEMONICS<br />

If r_length < r_Member then NoTarget;nonexistent member<br />

Text mode<br />

Set r_Pointer# r_Member = r_Data ;write data to target<br />

Notarget: return<br />

Examples:<br />

1 Copy EEprom.10 .. Eeprom.20 to EEprom.30 .. Eeprom.40<br />

100 R0 = 11 ; 11 registers to copy.<br />

110 Get R1 = EEprom.9 # R0 ; Get EEprom.(9+R0)<br />

111 Set EEprom.29 # R0 = R1 ; and write to EEprom.(29+R0)<br />

112 Loop R0, 110 ; Decrement R0 and loop until Zero.<br />

2 Push all the Motor. variables on the stack.<br />

100 Get R0 = Motor.0 # 255 ; This gives the number <strong>of</strong> entries<br />

110 AND R0, 255 ; Remove extra info.<br />

111 Get R1 = Motor.0 #-- R0 ; Get motor.R0 and do R0 = R0-1<br />

112 PUSH R1<br />

113 IF R0 > 0 THEN 111 ; Loop until all done.<br />

TEXT MODE<br />

The text handling in for the PL environment is implemented as follows:<br />

1. You need a format descriptor string, similar to the print in the C- language.<br />

2. You need an instruction to specify the data that should be displayed.<br />

3. You need a way to control the standard line editor, so it won’t interfere with<br />

your printout if you are using cursor addressing or multiple print statements.<br />

The following is now implemented:<br />

Image takes string argument.<br />

IPrint takes three arguments.<br />

TRead takes some modifiers and optionally one argument.<br />

TEXT OUTPUT<br />

Image is used to specify the format string for the output.<br />

IPrint is used to specify what string, and then it can send up to two arguments to be<br />

printed according to format in the Image.<br />

10 Image ”This is a string”<br />

20 IPrint<br />

This will insert a CR/LF sequence both before and after ”Hello!” , numbers are<br />

always three digit decimal, but you may enter less than that if the number is<br />

terminated by a non-numerical character.<br />

10 IMAGE ”The result is:\013\010units ok: %d:9\13\10units<br />

failed: %d:5\13\10”<br />

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

Doc. No.9032 0027 01 (B), Rev. 11.07.2001<br />

49

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

Saved successfully!

Ooh no, something went wrong!