SciLab/ScicosLab have a nice GUI bulding capability as well as SIMULINK like visual programing environment xcos/scicos. plus there is an Arduino plugin. I was wondering if SimulIDe could provide a virtual interface to have a complete PC in the loop (hardware in the loop) simulation?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
some points:
1. It would be great if you could open the comments section of the weblog.
2. It would be great if you could link to the original example you have mentioned in this page.
3. the toolbar icons are unintuitive/unconventional IMHO. A conventional menu bar would also be great.
4. Windows binary for the latest version would be great. or built instructions.
5. is the example analog_serial.simu just for Linux?
Last edit: Foad S. Farimani 2019-02-26
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The analog serial example is for Linux or Windows, the diference is how you create virtual serial port pairs in each system.
The idea in this example is create a pair of virtual serial ports that will act like the cable you use to conect an Arduino to your PC: You connect Arduino (in simulide) to one end of this"cable" and anything you want to other end.
Would you be kind enough to elaborate on the setup of the Null-modem emulator (com0com)? I understand that when I install the software it immulates a pair of com ports (for example Com1 and Com2). Then what should I do? should I put one in the SimulIDE and the other on the SciLab-xcos?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
figured it out myself. I had two issues, first I could not see the new ports in the ports section in the device manager:
but it was in the com0com - serial port emiulators above:
and the drivers were not installed by default so right click update drivers solved this problem. Second issue was that when using the com0com GUI to Add pair it did not assign them to COM* ports! as a result that no such a file or directory error happens.
So I opened the cli version Setup Command Promt/setupc.exe and then running the command install PortName=COM6 PortName=COM7 for example would do the job. Then in SimulIDE you can select one of these and then open. and on the other side the other pair. For example Arduino IDE from the menuTools > port select and then Tools > Serial Monitor to read the port.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Again as a Follow up on this matter, I decided to rewrite the Scilab / ScicosLab serial port communication toolbox from scratch to have similar functionalities as MATLAB. It took me a couple of weeks and almost a thousands lines of spaghetti code but now I have an early prototype. Here you can see live plotting of potentiometer readings.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
SciLab/ScicosLab have a nice GUI bulding capability as well as SIMULINK like visual programing environment xcos/scicos. plus there is an Arduino plugin. I was wondering if SimulIDe could provide a virtual interface to have a complete PC in the loop (hardware in the loop) simulation?
What exactly do you want to do?
Consider this for example.
Last edit: Foad S. Farimani 2019-02-25
Do you mean conecting Arduino by serial port?
if so, please have a look here (Serial comunications);
http://simulide.blogspot.com/p/blog-page_4.html
In this video interfacing Arduino with Processing:
https://youtu.be/JgdfjDlYJL0
Awsome. I will look into this. Thanks
btw the second video is broken.
some points:
1. It would be great if you could open the comments section of the weblog.
2. It would be great if you could link to the original example you have mentioned in this page.
3. the toolbar icons are unintuitive/unconventional IMHO. A conventional menu bar would also be great.
4. Windows binary for the latest version would be great. or built instructions.
5. is the example
analog_serial.simu
just for Linux?Last edit: Foad S. Farimani 2019-02-26
As I mentioned earlier I'm having difficulties running the examples:
and when I try to open ttyS0 for example get the below error:
Last edit: Foad S. Farimani 2019-02-28
The analog serial example is for Linux or Windows, the diference is how you create virtual serial port pairs in each system.
The idea in this example is create a pair of virtual serial ports that will act like the cable you use to conect an Arduino to your PC: You connect Arduino (in simulide) to one end of this"cable" and anything you want to other end.
In Windows you can create virtual serial port pairs using com0com: https://sourceforge.net/projects/com0com/
But there are other options.
Would you be kind enough to elaborate on the setup of the
Null-modem emulator (com0com)
? I understand that when I install the software it immulates a pair of com ports (for example Com1 and Com2). Then what should I do? should I put one in the SimulIDE and the other on the SciLab-xcos?figured it out myself. I had two issues, first I could not see the new ports in the ports section in the device manager:
but it was in the
com0com - serial port emiulators
above:and the drivers were not installed by default so right click
update drivers
solved this problem. Second issue was that when using the com0com GUI toAdd pair
it did not assign them toCOM*
ports! as a result thatno such a file or directory
error happens.So I opened the cli version
Setup Command Promt
/setupc.exe
and then running the commandinstall PortName=COM6 PortName=COM7
for example would do the job. Then in SimulIDE you can select one of these and then open. and on the other side the other pair. For example Arduino IDE from the menuTools > port
select and thenTools > Serial Monitor
to read the port.Nice to know you got it working.
And thanks for the explanations, it will be very useful for other people.
Regards.
As a follow up, now I can read the serial port in SciLab and pars the CSV data:
Here you may find more information. This code for Arduino:
Again as a Follow up on this matter, I decided to rewrite the Scilab / ScicosLab serial port communication toolbox from scratch to have similar functionalities as MATLAB. It took me a couple of weeks and almost a thousands lines of spaghetti code but now I have an early prototype. Here you can see live plotting of potentiometer readings.