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.

32<br />

Compiler directives<br />

PL2 NATIVE POSITION LANGUAGE<br />

Ex: Define a PDATA table holding Sine values for 0 to 9 degrees normalized to an<br />

amplitude <strong>of</strong> 65000<br />

.define c_Amplitude = 65000<br />

.define c_period = 180*1000*996/3129 ; 180*1000/pi<br />

pdata sin( 0 * 1000, c_period, c_Amplitude),0 ;0 degrees<br />

pdata sin( 1 * 1000, c_period, c_Amplitude),1 ;1 degrees<br />

pdata sin( 2 * 1000, c_period, c_Amplitude),2 ;2 degrees<br />

pdata sin( 3 * 1000, c_period, c_Amplitude),3 ;3 degrees<br />

pdata sin( 4 * 1000, c_period, c_Amplitude),4 ;4 degrees<br />

pdata sin( 5 * 1000, c_period, c_Amplitude),5 ;5 degrees<br />

pdata sin( 6 * 1000, c_period, c_Amplitude),6 ;6 degrees<br />

pdata sin( 7 * 1000, c_period, c_Amplitude),7 ;7 degrees<br />

pdata sin( 8 * 1000, c_period, c_Amplitude),8 ;8 degrees<br />

pdata sin( 9 * 1000, c_period, c_Amplitude),9 ;9 degrees<br />

This will compile to:<br />

1 PData 0 , 0<br />

2 PData 1134 , 1<br />

3 PData 2268 , 2<br />

4 PData 3402 , 3<br />

5 PData 4534 , 4<br />

6 PData 5665 , 5<br />

7 PData 6794 , 6<br />

8 PData 7921 , 7<br />

9 PData 9046 , 8<br />

10 PData 10168 , 9<br />

This can be very useful for creating motion pr<strong>of</strong>iles or look-up tables.<br />

The RDPdata mechanism (see Extended register groups on page 53) can bee<br />

used to read Pdata tables for any purpose.<br />

COMPILER DIRECTIVES<br />

The PL2 Language compiler has the following directives:<br />

.LIST Format: .LIST ON|OFF [; Comment]<br />

Function: Disable/enable the generation <strong>of</strong> list file<br />

output.<br />

Default: On<br />

.LISTMACRO Format: .LISTMACRO ON|OFF [; Comment]<br />

Function: Disable/enable the generation <strong>of</strong> macro<br />

expansions in the list file output<br />

Default: On<br />

.NOTE Format: .NOTE ”string”, Vsymbol [; Comment]<br />

Function: Print ”string” and the value <strong>of</strong> symbol to the<br />

list file output.<br />

.ERROR Format: .ERROR ”string” [; Comment]<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!