This toolbox provides Arduino communication blocks for Xcos. You need to flash the arduino board with the following file: toolbox_arduino_v3.ino Communication is performed through Serial port. Only works under Windows platform.
Upload date : 2016-08-31 14:34:05 MD5 : f1b3dda0847e57a3f3a49503c49fbd9d SHA1 : e854b228b4aa4573ed350f297cc541a3acd1218d Downloads : 7909
Is there any new Windows x64 version? Scilab 6, complain about an older dll and ask to recompile :(
J'ai essayé Scilab 6.0.0 Beta 2 mais ce module n'apparaît pas dans ma list de module atoms. J'ai essayé en vain une installation manuel à patir de "arduino-1.3.tar.gz Source code archive" mais sans résultat. Qqun peut-il m'aider ?
Thanks for building such a useful library for free. I'm switching my students from MATLAB to SciLab thanks the endless contribution from community. I only confront minor problem with Arduino toolbox. I run SciLab 6 which require Arduino library to be recompiled for that version. I hold no knowledge to achieve that and hence would appreciate any assistance regarding this issue if could be resolved.
> Thanks for building such a useful library for free. > > I'm switching my students from MATLAB to SciLab thanks the endless contribution from > community. I only confront minor problem with Arduino toolbox. > > I run SciLab 6 which require Arduino library to be recompiled for that version. I hold > no knowledge to achieve that and hence would appreciate any assistance regarding this > issue if could be resolved. Note: I use version 1.1 as we all have x86 Windows installed.
Please, I'd like to know how to install the Arduino Toolbox in SciLab 6.0.0 (Windows 32 bits). This Toolbox is not listed on SciLab 6.0.0 Module Manager.
Excellent toolbox. It has been so helpful to me.
Hello Yann, The description says "Only works under Windows platform." while MSWindows is the only plateform not supporting the toolbox for the time being.. Regards
Peut-on me guider pour installer le module "Arduino" dans Scilab 6.0.0, il n'est pas dans la liste des modules sous Atoms ? Merci d'avance.
--> exec('D:\PROJE KLASÖRÜM\SCILAB\arduino_1.1\loader.sce', -1) Start Arduino Load macros at line 33 of function startModule ( D:\PROJE KLASÖRÜM\SCILAB\arduino_1.1\etc\arduino.start line 37 ) at line 113 of executed file D:\PROJE KLASÖRÜM\SCILAB\arduino_1.1\etc\arduino.start at line 10 of executed file D:\PROJE KLASÖRÜM\SCILAB\arduino_1.1\loader.sce lib: Old binary lib detected. Please recompile it for Scilab 6.
hello, I solved the problem for scilab 6.01. You have to edit the builder.sce script as follows: =============================================================================== // Copyright (C) 2008 - INRIA // Copyright (C) 2009-2011 - DIGITEO // This file is released under the 3-clause BSD license. See COPYING-BSD. mode(-1); lines(0); function main_builder() TOOLBOX_NAME = "arduino"; TOOLBOX_TITLE = "Arduino toolbox"; toolbox_dir = get_absolute_file_path("builder.sce"); // Check Scilab's version // ============================================================================= // check minimal version (xcosPal required) if ~isdef('xcosPal') then // and xcos features required error(gettext('Scilab 5.3.2 or more is required.')); end // Check modules_manager module availability // ============================================================================= if ~isdef('tbx_build_loader') then error(msprintf(gettext('%s module not installed.'), 'modules_manager')); end if ~isdir(toolbox_dir+filesep()+"images"+filesep()+"h5") [status, msg] = mkdir(toolbox_dir+filesep()+"images"+filesep()+"h5"); if and(status <> [1 2]) error(msg); end end // Action // ============================================================================= tbx_builder_macros(toolbox_dir); //tbx_builder_src(toolbox_dir); //tbx_builder_gateway(toolbox_dir); tbx_builder_help(toolbox_dir); tbx_build_loader(toolbox_dir); tbx_build_cleaner(toolbox_dir); endfunction if with_module('xcos') then main_builder(); clear main_builder; // remove main_builder on stack end ================================================================================== then, compile the file again by running the script. a script called loaded.sce will be created. Before executing it, you must edit in the arduino.start file in the folder etc / the file arduino.start should be like this ==================================================================================== // Copyright (C) 2012 - Scilab Enterprises // This file is released under the 3-clause BSD license. See COPYING-BSD. function arduinolib = startModule() mprintf("Start Arduino\n"); if isdef("arduinolib") then warning("Arduino toolbox library is already loaded"); return; end // if win64() then // warning("Arduino toolbox library is only available for scilab 32 bits"); // return; // end // check minimal version (xcosPal required) // ============================================================================= if ~isdef('xcosPal') then // and xcos features required error(gettext('Scilab 5.3.2 or more is required.')); end // ============================================================================= // force to load some libraries (dependancies) loadScicos(); // ============================================================================= etc_tlbx = get_absolute_file_path("arduino.start"); etc_tlbx = getshortpathname(etc_tlbx); root_tlbx = strncpy( etc_tlbx, length(etc_tlbx)-length("\etc\") ); // Load functions library // ============================================================================= mprintf("\tLoad macros\n"); pathmacros = pathconvert( root_tlbx ) + "macros" + filesep(); arduinolib = lib(pathmacros); // Load serial dll and link // ============================================================================= mprintf("\tLoad serial dll\n"); pathdll = pathconvert( root_tlbx ) + "src" + filesep(); chdir(pathdll) exec('loader.sce'); chdir('..') // Add blocks to the Xcos palette // ============================================================================= mprintf("\tLoad palette\n"); pal = xcosPal("Arduino"); sous_pal=["Configuration" "Digital" "Analog" "Motors"] sous_blocks=cell(size(sous_pal)); sous_blocks{1}=["ARDUINO_SETUP" "TIME_SAMPLE" "ARDUINO_SCOPE"] sous_blocks{2}=["DIGITAL_READ_SB" "DIGITAL_WRITE_SB" "ENCODER_SB" "INTERRUPT_SB"] sous_blocks{3}=["ANALOG_READ_SB" "ANALOG_WRITE_SB" ] sous_blocks{4}=["DCMOTOR_SB" "SERVO_WRITE_SB" ] // blocks = ["ARDUINO_SETUP" "TIME_SAMPLE" "ARDUINO_ANALOG_READ" "ARDUINO_ANALOG_WRITE" "ARDUINO_DCMOTOR" ... // "ARDUINO_DIGITAL_READ" "ARDUINO_DIGITAL_WRITE" "ARDUINO_ENCODER" ... // "ARDUINO_SERVO_READ" "ARDUINO_SERVO_WRITE" ... // "ARDUINO_STEPPER" "ARDUINO_WRITE" ]; for p=1:size(sous_pal,2) local_pal = xcosPal(sous_pal(p)); blocks=sous_blocks{p}; for i=1:size(blocks, "*") h5 = ls(root_tlbx + "/images/h5/" + blocks(i) + "." + ["sod" "h5"]); gif = ls(root_tlbx + "/images/gif/" + blocks(i) + "." + ["png" "jpg" "gif"]); svg = ls(root_tlbx + "/images/svg/" + blocks(i) + "." + ["png" "jpg" "gif" "svg"]); local_pal = xcosPalAddBlock(local_pal, h5(1), gif(1), svg(1)); end if ~xcosPalAdd(local_pal,'Arduino') then error(msprintf(gettext("%s: Unable to export %s.\n"), "arduino.start", "pal")); end end // Load and add help chapter // ============================================================================= if or(getscilabmode() == ["NW";"STD"]) then mprintf("\tLoad help\n"); path_addchapter = pathconvert(root_tlbx+"/jar"); if ( isdir(path_addchapter) <> [] ) then add_help_chapter("Arduino", path_addchapter, %F); end end // Load demos // ============================================================================= if or(getscilabmode() == ["NW";"STD"]) then mprintf("\tLoad demos\n"); pathdemos = pathconvert(root_tlbx+"/demos/arduino.dem.gateway.sce", %F, %T); add_demo("Arduino", pathdemos); end // Display version fd=mopen(root_tlbx+filesep()+"VERSION"); version=mgetl(fd,-1); mclose(fd); mprintf("\tArduino Version: "+version); endfunction if with_module('xcos') then arduinolib = startModule(); clear startModule; // remove startModule on stack end ================================================================================== Now run the file loaded.sce and I will install the module The problem was caused by changes in some commands in the last version. I hope you serve the solution. Greetings from vallenar, Chile.
Bonjour, je cherche à utiliser la toolbox arduino mais je n'y parvient pas. J'ai la version 6.01. Pourquoi cette Toolbox n'est pas disponible dans la gestion graphique des modules? Si je telecharge arduino-1.3 et que je lance builder j'ai le message suivant : -->// Copyright (C) 2008 - INRIA -->// Copyright (C) 2009-2011 - DIGITEO -->// This file is released under the 3-clause BSD license. See COPYING-BSD. -->mode(-1); !--error 999 get_absolute_file_path : Le fichier builder.sce n'est pas ouvert dans Scilab. at line 5 of function main_builder called by : main_builder(); at line 52 of exec file called by : INTO_SCILAB-782579156505322751.sce', 1 while executing a callback j'ai essayer de modifier le fichier arduino.start dans le repertoire etc / avec le code proposé dans le message précédent. Les commentaires sont : -->// Copyright (C) 2008 - INRIA -->// Copyright (C) 2009-2011 - DIGITEO -->// This file is released under the 3-clause BSD license. See COPYING-BSD. -->mode(-1); !--error 999 get_absolute_file_path : Le fichier builder.sce n'est pas ouvert dans Scilab. at line 5 of function main_builder called by : main_builder(); at line 52 of exec file called by : NTO_SCILAB-4380300239315846287.sce', 1 while executing a callback Merci pour votre aide Cordialement
There is an error when I executing loader.sce. exec: error on line #93: "xcosPalAddBlock: Unable to load block from "C:\Users\Hirotaka\Desktop\SCILAB~1\arduino\images\h5\ARDUINO_SETUP.sod": hdf5 file expected." Do you know how I can solve it?
> There is an error when I executing loader.sce. > > exec: error on line #93: "xcosPalAddBlock: Unable to load block from > "C:\Users\Hirotaka\Desktop\SCILAB~1\arduino\images\h5\ARDUINO_SETUP.sod": hdf5 > file expected." I do get it as well, on Windows7. I am surprised that Stéphane Guibert (next commenter) does not get it (on Windows10).. > Do you know how I can solve it? Not yet.
I restarted Scilab, and now it works. I think that there is a synchronization issue. xcosPalAddBlock() creates the .sod file, and just after having closed it, it loads its content (so accesses to the same file that was just closed). I have tried to add a sleep(500) just before loading the .sod file, but it did not help. But restarting Scilab cleared the loading error...
And now again after restarting: Out of work. In xcosPalAddBlock(), the true error message while doing load(Block) is: !Function not defined for given argument type(s), ! ! check arguments or define function %Block_load for overloading. ! So, maybe %Block_load() is defined in as a too private function or in a sublibrary not loaded by default..
>So, maybe %Block_load() is defined in as a too private function or in a sublibrary >not loaded by default.. That's the point: It is defined in the scicos_scicoslib that is not loaded by default. I will fix it now in the Arduino start file, and in xcosPalAddBlock() later.
This comment has been deleted.
hello These steps are ok for me: (Windows 10 and Scilab 6.0.1) 1. Download the file 'arduino-1.3.tar.gz', which is the archive of the module for Scilab. 2. Unzip the file (with 7-Zip for example: https://www.7-zip.org/). This is a compressed (gzip) archive (tar). Sometimes, it need two steps: unzip (gzip), then extract the archive (tar). We then obtain a file named 'arduino-1.3'. 3. Edit the file '..\arduino1.3\arduino\builder.sce'. Replace the two lines 46 and 47: // tbx_build_loader(TOOLBOX_NAME, toolbox_dir); // tbx_build_cleaner(TOOLBOX_NAME, toolbox_dir); with: tbx_build_loader(toolbox_dir); tbx_build_cleaner(toolbox_dir); Save the change. 4. In Scilab 6.0.1 (Desktop), execute the file 'builder.sce', for example in the console (replace ... with the exact path): --> cd "c:\...\arduino1.3\arduino\" --> exec("builder.sce") The operation creates two files in the folder: 'loader.sce' and 'unloader.sce'. 5. Close Scilab. Edit the start menu shortcut (Properties), then change the target: "C:\Program Files\scilab-6.0.1\bin\WScilex.exe" with (replace ... by the exact path of the file): "C:\Program Files\scilab-6.0.1\bin\WScilex.exe" -f "c:\...\arduino1.3\arduino\loader.sce" 6. Restart Scilab. At startup, you must have in the console: Start Arduino Load macros Load serial dll 7. Open Xcos. In the palette browser, you must have the arduino palette. 8. If not done yet, download the file 'toolbox_arduino_v3.ino' which contains the program code for the Arduino board, on the Demoscience website: http://www.demosciences.fr/projets/scilab-arduino Note : Point 5 loads the arduino module when Scilab starts. Do not change the tree!