[Scilab-users] multi super block with imported data

euxinos t.euxinos at gmail.com
Thu Oct 2 10:31:17 CEST 2014


Hello everyone ! 
Attached you will find two circuit systems. one of them has one super block
(single super block.zcos) and the other one has three super blocks (multiple
test.zcos). all the super blocks has inductors and resistance inside and for
the values of these elements super blocks ask for data files with contexts
they have. Each time when we run it, every super block will ask for a data
file. 

The problem is, its normal that they ask for a data file at first run but
then even if we have already chosen data file, whenever we run it, it asks
again ! which makes it user unfriendly. 

I have solved the problem for single super block with following context:

global filename
empty=1D-10;

if size(filename)==0 then
    filename = uigetfile(["*.txt"]);
end  

M=csvRead (filename,',');

if size(M,2)>=1 then 
r1=M(1,1);
L1=M(2,1);
else 
r1=empty;
L1=empty;
end
if size(M,2)>=2 then 
r2=M(1,2);
L2=M(2,2);
else 
r2=empty;
L2=empty;
end
......
......
if size(M,2)>=10 then 
r10=M(1,10);
L10=M(2,10);
else 
r10=empty;
L10=empty;
end
if size(M,2)>=11 then 
r11=M(1,11);
L11=M(2,11);
else 
r11=empty;
L11=empty;
end

but this temporary solution is not valid for multiple use of this super
block as you can imagine. I need such a context that when I put these super
block to library, with drag and drop it should work properly. in the
multiple test example I attached, system also works with different data
files without any problem or confusion but each time when we run, it asks
again. 

multiple test screen shot:
<http://mailinglists.scilab.org/file/n4031277/multiple_test.jpg> 


Super block screen shot:
<http://mailinglists.scilab.org/file/n4031277/super_block.png> 


Here also context of super blocks from multiple test:

filename = uigetfile(["*.txt"]) 
M=csvRead (filename,',');
if size(M,2)>=1 then 
r1=M(1,1);
I1=M(2,1);
else 
r1=0;
I1=0;
end
if size(M,2)>=2 then 
r2=M(1,2);
I2=M(2,2);
else 
r2=0;
I2=0;
end
........
.......
.......
if size(M,2)>=10 then 
r10=M(1,10);
I10=M(2,10);
else 
r10=0;
I10=0;
end
if size(M,2)>=11 then 
r11=M(1,11);
I11=M(2,11);
else 
r11=0;
I11=0;
end



I will also upload some different data files for whom would like try.

Thanks in advance !
Greetings,
Teoman. single_super_block.zcos
<http://mailinglists.scilab.org/file/n4031277/single_super_block.zcos>  
multiple_test.zcos
<http://mailinglists.scilab.org/file/n4031277/multiple_test.zcos>  
first_sample_-_Copy.txt
<http://mailinglists.scilab.org/file/n4031277/first_sample_-_Copy.txt>  
first_sample_-_Copy_(2).txt
<http://mailinglists.scilab.org/file/n4031277/first_sample_-_Copy_%282%29.txt>  
first_sample_-_Copy_(3).txt
<http://mailinglists.scilab.org/file/n4031277/first_sample_-_Copy_%283%29.txt>  



--
View this message in context: http://mailinglists.scilab.org/multi-super-block-with-imported-data-tp4031277.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.



More information about the users mailing list