ISaGRAF. Version 3.4

         

FA_READ


Àðãóìåíòû:

ID                         INT                 íîìåð ôàéëà: âîçâðàùåííûé ôóíêöèåé F_ROPEN

Q                          INT                 öåëàÿ àíàëîãîâàÿ âåëè÷èíà ñ÷èòàííàÿ èç ôàéëà

Îïèñàíèå:

×èòàåò àíàëîãîâûå ïåðåìåííûå èç äâîè÷íîãî ôàéëà. Äîëæíà èñïîëüçîâàòüñÿ ñ F_ROPEN è F_CLOSE. Ýòà ôóíêöèÿ îñóùåñòâëÿåò ïîñëåäîâàòåëüíûé äîñòóï ê ôàéëó, íà÷èíàÿ ñ ïðåäûäóùåé ïîçèöèè. Ïåðâûé âûçîâ ïîñëå F_ROPEN ÷èòàåò ïåðâûå 4 áàéòà ôàéëà, êàæäûé âûçîâ ñäâèãàåò óêàçàòåëü ÷òåíèÿ. Äëÿ ïðîâåðêè äîñòèãíóò ëè êîíåö ôàéëà èñïîëüçóéòå F_EOF.  Ýòà ôóíêöèÿ íå âêëþ÷åíà â ñèìóëÿòîð ISaGRAF.

(*FBD ïðîãðàììà, èñïîëüçóþùàÿ áëîêè óïðàâëåíèÿ ôàéëîì*)

(* ST Ýêâèâàëåíò: *)

file_id := F_ROPEN('voltramp.bin');

vstart := FA_READ(file_id);

vend := FA_READ(file_id);



vinc := FA_READ(file_id);

delta_tim := tmr(FA_READ(file_id));

ok := F_CLOSE(file_id);

(* IL Ýêâèâàëåíò: *)

                         LD              'voltramp.bin'

                         F_ROPEN

                         ST              file_id

                         FA_READ                      (* ÷èòàòü vstart *)

                         ST              vstart

                         LD              file_id

                         FA_READ                      (* ÷èòàòü vend *)

                         ST              vend

                         LD              file_id

                         FA_READ                      (* ÷èòàòü vinc *)

                         ST              vinc

                         LD              file_id

                         FA_READ                      (* ÷èòàòü delta_tim *)

                         TMR                                              (* ïðåâðàùåíèå â timer *)

                         ST              delta_tim

                         LD              file_id

                         F_CLOSE

                         ST              ok


ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ANA

ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ADDÿÿÿÿÿÿÿÿÿÿ nb_written

ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ LDÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ (* ¯¨á âì delta_tim *)

ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ANAÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ (* ¯à¥¢à â¨âì ¢ integer *)

ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ STÿÿÿÿÿÿÿÿÿÿÿÿÿ ana_delta_tim

ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ LD ÿÿÿÿÿÿÿÿÿÿÿÿ file_id

ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ FA_WRITEÿ ana_delta_timÿÿÿÿÿÿÿÿÿÿÿ

ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ANA

ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ ADDÿÿÿÿÿÿÿÿÿÿ nb_written

ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ STÿÿÿÿÿÿÿÿÿÿÿÿÿ nb_written

ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ F_CLOSE

ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ STÿÿÿÿÿÿÿÿÿÿÿÿÿ ok

ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ LDÿÿÿÿÿÿÿÿÿÿÿÿÿ nb_written

ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ EQÿÿÿÿÿÿÿÿÿÿÿÿÿ 4

ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ RETCÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ (* ¢®§¢à â ¥á«¨ à ¢­® 4 *)

ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ LDÿÿÿÿÿÿÿÿÿÿÿÿÿ ERR_FILEÿÿÿ (* ¨­ ç¥ ®è¨¡ª  *)

ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ STÿÿÿÿÿÿÿÿÿÿÿÿÿ ERROR


Ñîäåðæàíèå ðàçäåëà