-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex01.sci
62 lines (50 loc) · 1.02 KB
/
ex01.sci
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
////
/*
////
.Click to see the source code
[%collapsible]
====
[source,scilab]
....
*/
s7 = sdefine(Port = "COM7", BaudRate = 9600, Parity = 'none', DataBits = 8, StopBits = 1, OverWrite = %t); // Assuming COM7 is the port you got from above command
sopen(SerialPort = s7, Access = 'r');
pData = [];
pTime = [];
nData = csvTextScan(part(sget(s7), 1:$-1), ',');
pData = [pData, nData(2)];
pTime = [pTime, nData(1)];
plot(pTime, pData);
while %t
drawlater();
nData = csvTextScan(part(sget(s7), 1:$-1), ',');
pData = [pData, nData(2)];
pTime = [pTime, nData(1)];
clf();
plot(pTime, pData);
drawnow();
sleep(1000);
end
sclose(s7);
sdelete(s7);
/*
....
====
////
*/
////
////
//fignr = 1002;
//f = figure(fignr);
//f.menubar_visible = "off";
//f.toolbar_visible = "off";
//f.infobar_visible = "off";
////delmenu(fignr, 'File');
////delmenu(fignr, 'Edit');
////delmenu(fignr, 'Tools');
////delmenu(fignr, '?');
////toolbar(fignr, 'off');
////f.background = 1;
//f.figure_name="GUI";
//f.tag="mainWindow";
////