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.

182<br />

SAnyBus<br />

ABInMail.IrqNotify, 7 ; default value, do not change<br />

SAnybus.Command, 7 ; Send to fieldbus module<br />

wait SAnybus.HasMail = 1 ; Wait for response mail<br />

; Investigate response mail for errors here<br />

if ABOutMail.MessageInfo < 0 then ErrorProt<br />

if ABOutMail.Error 0 then ABIErrorProt<br />

SAnybus.HasMail, 0<br />

return<br />

; Clear mailbox flag<br />

EXTENDED REGISTER GROUPS<br />

;<br />

; END_INIT<br />

;<br />

SendEndInit<br />

: rProtNumber, cEND_INIT<br />

SAnybus.Command, 2 ; Prepare END_INIT mail message<br />

wait SAnybus.Command = 0 ; Wait for it to be done<br />

SAnybus.Command, 7 ; Send to fieldbus module<br />

wait SAnybus.HasMail = 1 ; Wait for response mail<br />

; Investigate response mail for errors here<br />

if ABOutMail.MessageInfo < 0 then ErrorProt<br />

SAnybus.HasMail, 0 ; Clear mailbox flag<br />

return<br />

ErrorProt:<br />

tmp10 = ABOutMail.MessageInfo and 0ffh<br />

tmp20 = ABOutMail.MessageInfo and 0f00h<br />

tmp20 = tmp20 >> 8<br />

; iprint @txtProtError, rProtNumber<br />

txtProtError: image "Error in: %d"<br />

if ABOutMail.MessageInfo and 04000h then ErrCommand<br />

;<br />

; Response message<br />

;<br />

clr tmr.t0<br />

wait tmr.t0 > 100<br />

stop<br />

; Command error<br />

;<br />

ErrCommand:<br />

clr tmr.t0<br />

wait tmr.t0 > 100<br />

stop<br />

ABIErrorProt:<br />

clr tmr.t0<br />

wait tmr.t0 > 100<br />

stop<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!