|
The following chapter shows how to create a simple real-time plot like this:
Doc_num=FNDplot_doc_new(0) ! create new document |
! legend text and style for curve Dummy=FNDplot_send_cmd("[Legend(1,""x=sin(2*t), y=sin(5*t) {0<t<2*PI}"")]") ! Dummy=FNDplot_send_cmd("[NumberFormat(0,8)]") ! x axis = fractions of PI Dummy=FNDplot_send_cmd("[ManualScale(0,-1.2,6.28,1.2)]") ! manual scale of y axis Dummy=FNDplot_send_cmd("[Color(1,0,255,255)]") ! curve 1 = cyan Dummy=FNDplot_send_cmd("[Color(2,255,200,0)]") ! curve 2 = kind of yellow |
DIM Dat1(1:1,1:2) ! point pairs (x and y) for curve 1 DIM Dat2(1:1,1:2) ! point pairs (x and y) for curve 2 ! Xmin=0 Xmax=2*PI Xpoints=200 Xstep=Xmax/Xpoints ! Scr_update=4 ! screen update every 4 data points only Scr_count=1 ! RANDOMIZE Xi=BASE(Datxy,1) FOR X=Xmin TO Xmax-Xstep STEP Xstep Dat1(1,1)=X ! x value curve 1 Dat1(1,2)=LGT(X+.00001) ! y value curve 1 Dat2(2,1)=X ! x value curve 2 Dat2(2,2)=SIN(1.5*X) ! y value curve 2 ! ! transfer all data points to DPlot curve 1, line type 1 Dummy=FNDplot_xyz_data(Doc_num,Datxy(*),0,0,1,"",1) ! ! transfer all data points to DPlot curve 2, line type 1 Dummy=FNDplot_xyz_data(Doc_num,Datxy(*),0,0,2,"",1) ! Scr_count=Scr_count+1 IF Scr_count/Scr_update=INT(Scr_count/Scr_update) THEN CALL Dplot_show(Doc_num) ! screen update END IF NEXT X |
! show the diagram, 100% screen size CALL Dplot_show(Doc_num) Dummy=FNDplot_doc_close(Doc_num) ! close the document |
|