Reputation: 1
I am running a code on arduino which works fine in arduinoide, I want to get those values in simulink for real time using serial connection.
I am burnig a program in arduino and want to access both send and receive function of serial monitor, on simulink. I want these to plot graphs in real time and run PID algorithm using simulink.
But for some odd reason, simulink values are either not updating(in external mode) or fluctuating some odd values(in normal mode). Any help.
Upvotes: 0
Views: 1923
Reputation: 1162
If you are doing a communication between the Arduino and Simulink there might be some problems in your connection. I'm assuming you are using the Serial Send and Serial Receive block to do the communication.
By your description I can think of this problems:
If your Simulink is not updating probably because it is waiting Arduino to send some serial data, but is not receiving anything. Some possible causes of this problem might be:
float
you have to receive a single
in Simulink.)If Simulink is updating but showing odd values, the communication between both might be damaged.
byte
. If you are using a single
or double
remember to cast it to byte
with a Byte Pack block.Upvotes: 1