Jerry in Discussions
최근 활동: 2025년 8월 22일 10:45

Im using stm32h735g-dk and i was thinking to start model based development using simulink in matlab. I already done a cluster prototype using touchgfx and stm32cube ide now i need to shift from cube ide to simulink using same gui is it possible?? If its posssible how will i integrate with simulink i have already licenced version and stm embedded packages on simulink and embedded coder can anyone help me with a guidance how to integrate without using cube ide Touchgfx integration with Simulink in matlab simulink stm32 touchgfx gui cluster
치욱 in Discussions
최근 활동: 2025년 7월 4일

Hello, I've successfully tested the Processor-in-the-Loop (PIL) workflow in Simulink using a TI F28069M LaunchPad, following the standard examples provided by MathWorks. The PIL block, code generation, and communication all worked without issues. Now, I’d like to run a similar PIL setup using the Infineon TLE9879 EVALKIT (based on an ARM Cortex-M0), which is not officially supported by Simulink as a target. I’m wondering if it’s possible to configure PIL manually or via custom workflows. For example: Can I create a custom PIL target using Embedded Coder? Would I need to port rtiostream manually for communication over UART? Could I somehow integrate with Keil µVision (which I use for TLE9879) to build and run the generated code? Is there a workaround to simulate PIL behavior using a non-supported board? My setup: Simulink R2024b Infineon TLE9879 EVALKIT Keil µVision 5 + Infineon Config Wizard UART and JTAG interfaces available The main purpose is to validate control algorithms and measure execution time, not to implement a full HIL system. Has anyone attempted PIL with a custom or unsupported microcontroller before? Any tips or resources would be greatly appreciated. Thanks in advance! Is it possible to run PIL in Simulink with a non-supported microcontroller like Infineon TLE9879? simulink pil
Ege Hassürücü in Discussions
최근 활동: 2024년 3월 26일

Hello Everyone, I'm running an IoT project at my university using a free . Basically, my system uploads the sensor data to 4 different fields of a ThingSpeak channel and I'm reading from or writing to the channel through Simulink. I have a few questions regarding this topic: I'm trying to upload to the server every 3 seconds (which seemed to be providing the best results so far). Since the channel only accepts data transmit every 15 seconds, what is the optimized upload interval rate to match the interval rate of the channel? Because otherwise I have realized that my interval rate can go up to 1min sometimes for some reason. Is reading from/writing to the channel through simulink while the system is uploading data to the channel slow down th whole process? What is your overall suggestion in this case? I'm excited to hear your suggestions and experiences! Regards, Ege Does reading data from Simulink, slow down my server upload? I would prefer if you can stop trying to update every 3 seconds. This can result in a lot of wasted server time for us. Though your model may be putting other delays in there, Im not sure how to profile your model to be sure. Maybe Ill ask my Simulink firends about model profiling. I do recall having a similar issue with some Simulink models that I had made, Like this solar tracker. I recall there are settings in the model to change the timing to be closer to real time.. But I cannot report the details here off the top of my head. If you figure it out, please let us know here. For #2 are you asking if adding ThingSpeak can impede your model performance? Hi @Christopher Stapels, I solved the issue, thanks for your quick response! Also, reading the data from simulink doesn't seem to be effecting the performance of the channel now so far. The main issue was how i create the http request, in the new version I used your ESP32 library and now I'm able to update every 15.5 seconds. Here are the old and new versions: Old version: void loop() { unsigned long currentMillis = millis(); unsigned long interval = currentMillis - previousMillis; if (interval > UPLOAD_RATE) { // Create HTTP request String http_str = "GET /update?api_key=" + Apikey + "&field1=" + String(messageData1) + "&field2=" + String(messageData2) + "&field3=" + String(messageData3) + " HTTP/1.1\r\n"; http_str += "Host: " + server + "\r\n"; http_str += "Connection: close\r\n\r\n"; if(WiFi.status() != WL_CONNECTED) { Serial.print("Wifi connection failed. Attempting to reconnect..."); connectToWiFi(); delay(5000); } else { Serial.println("Connected to WiFi\n"); // Connect to the ThingSpeak server connectToThingSpeak(); // Make the HTTP request client.print(http_str); client.stop(); previousMillis = currentMillis; // Update the last time the action was performed } } delay(100); } void connectToThingSpeak() { if (client.connect(server.c_str(), 80)) { Serial.println("Connected to ThingSpeak server"); } else { Serial.println("Connection to ThingSpeak server failed"); } } New version: void loop() { unsigned long currentMillis = millis(); unsigned long interval = currentMillis - previousMillis; if (interval > UPLOAD_RATE) { ThingSpeak.setField(1,messageData1); ThingSpeak.setField(2,messageData2); ThingSpeak.setField(3,messageData3); ThingSpeak.setField(4,trialMessage); ThingSpeak.writeFields(CHANNELID,APIKEY); Serial.println("Data uploaded to the ThingSpeak server."); previousMillis = currentMillis; // Update the last time the action was performed } delay(100); } simulink interval read write iot
Abhishek in Discussions
최근 활동: 2024년 2월 20일

Hi Everyone. I am facing a problem while connecting the FMU to the buses. I have one FMU which expects 9 inputs and I did clarify the same while using bus creator. But in the end i am getting this error which i am trying to solve for couple of hours but didn't get any solution. So if any knows about the same please help me. I would give details as well if you need any other information. Problem with linking bus to the FMU (Functional Mockup Unit) in Simulink Please consider posting this question on MATLAB answers, you will get better response. This forum is designed for IoT devices and cloud device workflows. Hi. Thanks I will do that. simulink fmu matlab
Tanusree in MATLAB Answers
최근 활동: 2024년 1월 16일

I have a simulink model saved on my desktop MATLAB. Now I want to run this model through ThingSpeak insted of running from desktop MATLAB. Is it possible? Also how can I upload the simulink model on ThingSpeak cloud?
Sreeraj in Discussions
최근 활동: 2023년 8월 7일

Hi I am a beginner in MATLAB. I am trying to stimulate RF energy harvesting. Is it possble to stimulate this using simulink? Kindly help me. Thank You. RF energy harvesting stimulation Simulink is a great place to simultate and test an energy harveting system. This forum is targeted to ThingSpeak workflows of IoT data collection and analysis of IoT data. Can you please consider posting your question on MATLAB answers instead? I think you will get a lot more viewers with related capabilities and interests. simulink
HARSHA M BHONSLE in MATLAB Answers
최근 활동: 2023년 5월 18일

I Need a way to code for sending a image from my mobile device to thingspeak and retriveing to the matlab pc.Is there any way to do the code?
ainul syahmina salleh in Discussions
최근 활동: 2022년 12월 9일

Hi, I want to collect the simulation data by using NASA HL-20 model, then the data will transmit to ThingSpeak. However, I don't have the block for ThingSpeak Channel at the Simulink Library Browser. Is it because the block has its own version of simulink (meaning I have to update my version) or is there any else that I don't know? Besides, can you suggest which methods are suitable for me to successfully transfer the simulation data to ThingSpeak? How to transfer the data from Simulink to ThingSpeak I was able to log data to ThingSpeak using the HL-20 model. Thats a fun model, thanks for giving me the excuse to try it. My version of MATLAB is 22b and I have the equivalent of a paid ThingSpeak license to be able to write every second, though I set the block to write every 2 seconds. In a 100 second simulation, I got 70 points, and I had to allow the missed ticks to be higher than the default. Im not a Simulink pro though, so I'm not clear exaclty why the numbers worked out that way. Thank you so much for your reply sir. Right now I'm able to get the block of ThingSpeak Output Channel. But it requires me to install real time kernel. I do type the command "sldrtkernel -install" at the command window but it says simulink desktop real-time kernel requires a computer with Intel CPU and I'm using MacOS 11.2. Is there any other way for me to run the block so that it will connect to ThingSpeak? Thanks. Unfortunately asfter asking some Mac experts, I have found that "SLDRT is not available on Apple silicon Macs, and we have no way to port it. There’s a fundamental architecture incompatibility here." The only suggested solution is to find a windows machine to use, unfortunatley. Apparently even a windows VM wont work in this case. There is more information here. Mac System Requirements - MATLAB & Simulink (mathworks.com) simulink thingspeak aerospace blockset toolbox nasa hl_20 model
Pramod Tripathi in Discussions
최근 활동: 2022년 7월 6일

Simple app created using Simulink support package for Android device. App created but data is not getting logged on thingspeak channel the error msg on app log is as attached. Simulink based app is not logging data to thingspeak #include "gyrotry.h" 17#include "gyrotry_private.h" 18 19/* Real-time model */ 20RT_MODEL_gyrotry_T gyrotry_M_; 21RT_MODEL_gyrotry_T *const gyrotry_M = &gyrotry_M_; 22 23/* Model step function */ 24void gyrotry_step(void) 25{ 26 real32_T out[3]; 27 uint32_T sendPost; 28 29 /* MATLABSystem: '<S1>/MATLAB System' */ 30 out[0] = 0.0F; 31 out[1] = 0.0F; 32 out[2] = 0.0F; 33 GET_GYROSCOPE_DATA(&out[0], &out[1], &out[2]); 34 35 /* MATLABSystem: '<Root>/ThingSpeak Write' incorporates: 36 * MATLABSystem: '<S1>/MATLAB System' 37 */ 38 CHECK_UPDATE_INTERVAL(1.0, &sendPost); 39 if (sendPost == 1U) { 40 ADD_FIELD(1.0, 1, (real_T)out[0]); 41 ADD_FIELD(1.0, 2, (real_T)out[1]); 42 ADD_FIELD(1.0, 3, (real_T)out[2]); 43 SEND_POST_REQUEST(1.0); 44 } 45 46 /* End of MATLABSystem: '<Root>/ThingSpeak Write' */ 47} 48 49/* Model initialize function */ 50void gyrotry_initialize(void) 51{ 52 { 53 char_T tmp[17]; 54 int32_T i; 55 static const char_T tmp_0[17] = "1TB72YHJP7KMKWFF"; 56 57 /* Start for MATLABSystem: '<S1>/MATLAB System' */ 58 INITIALIZE_GYROSCOPE(); 59 60 /* Start for MATLABSystem: '<Root>/ThingSpeak Write' */ 61 for (i = 0; i < 17; i++) { 62 tmp[i] = tmp_0[i]; 63 } 64 65 INIT_THINGSPEAK_WRITE(1.0, 1.789946E+6, tmp, 15.0); 66 67 /* End of Start for MATLABSystem: '<Root>/ThingSpeak Write' */ 68 } 69} 70 71/* Model terminate function */ 72void gyrotry_terminate(void) 73{ 74 /* (no terminate code required) */ 75} 76 77/* 78 * File trailer for generated code. 79 * 80 * [EOF] 81 */ This is the code generated simulink thingspeak
Mark Trudgen in MATLAB Answers
최근 활동: 2022년 6월 17일

Hi there, I am trying to implement the matlab function below (from a .m file) as a function block in simulink. The main gist is that it reads a string from thingspeak, then splits that string into data points. I am getting errors stating that most of the functions from matlab (split, thingspeak...) are unavailable for code generation. We cannot use the simulink thingspeak blocks as they only support numeric data, and we are processing large strings. What can I do to make this work? function [out0,out1,out2,out3,out4,out5,out6,out7,out8,out9,out10,out11,out12,out13,out14,out15,out16,out17,out18] = fcn() data = thingSpeakRead(1747813, "Fields",1,"ReadKey","M005PRKFNU6BQ3R3", OutputFormat="timetable"); disp(data) %defines delimiter delimiter1 = "*"; delimiter2 = ","; %converts timetable data into an array so it can be processed below dataConvert = table2array(data); %splits string into a 19x1 array stringSplit = split(dataConvert, delimiter1); %assigns location within array to variable val0 = stringSplit(1); val1 = stringSplit(2); val2 = stringSplit(3); val3 = stringSplit(4); val4 = stringSplit(5); val5 = stringSplit(6); val6 = stringSplit(7); val7 = stringSplit(8); val8 = stringSplit(9); val9 = stringSplit(10); val10 = stringSplit(11); val11 = stringSplit(12); val12 = stringSplit(13); val13 = stringSplit(14); val14 = stringSplit(15); val15 = stringSplit(16); val16 = stringSplit(17); val17 = stringSplit(18); val18 = stringSplit(19); %splits string a second time to a 1x2 array of shape [identifier,value] splitStringVal0 = split(val0,delimiter2); splitStringVal1 = split(val1,delimiter2); splitStringVal2 = split(val2,delimiter2); splitStringVal3 = split(val3,delimiter2); splitStringVal4 = split(val4,delimiter2); splitStringVal5 = split(val5,delimiter2); splitStringVal6 = split(val6,delimiter2); splitStringVal7 = split(val7,delimiter2); splitStringVal8 = split(val8,delimiter2); splitStringVal9 = split(val9,delimiter2); splitStringVal10 = split(val10,delimiter2); splitStringVal11 = split(val11,delimiter2); splitStringVal12 = split(val12,delimiter2); splitStringVal13 = split(val13,delimiter2); splitStringVal14 = split(val14,delimiter2); splitStringVal15 = split(val15,delimiter2); splitStringVal16 = split(val16,delimiter2); splitStringVal17 = split(val17,delimiter2); splitStringVal18 = split(val18,delimiter2); %assigns value to output variable to be used by simulink file out0 = splitStringVal0(2); out1 = splitStringVal1(2); out2 = splitStringVal2(2); out3 = splitStringVal3(2); out4 = splitStringVal4(2); out5 = splitStringVal5(2); out6 = splitStringVal6(2); out7 = splitStringVal7(2); out8 = splitStringVal8(2); out9 = splitStringVal9(2); out10 = splitStringVal10(2); out11 = splitStringVal11(2); out12 = splitStringVal12(2); out13 = splitStringVal13(2); out14 = splitStringVal14(2); out15 = splitStringVal15(2); out16 = splitStringVal16(2); out17 = splitStringVal17(2); out18 = splitStringVal18(2); end
seiya moro in MATLAB Answers
최근 활동: 2022년 4월 21일

Currently, I am trying to send GPS sensor data to ThingSpeak in real time. I made the Arduino MKR WiFi 1010 build, distribute and start the program. Then, the data is sent to ThingSpeak only once at the moment when the plug ram is inserted, but the data is not sent after that. Is there a solution? Thank you very much!
seiya moro in MATLAB Answers
최근 활동: 2022년 4월 18일

Currently, GPS data is acquired using Arduino on Simulink. I want to send this data to ThingSpeak. How should I set the microcomputer board? Thank you very much!
Giulio Griguoli in Discussions
최근 활동: 2021년 11월 25일

Hi, I'm trying to send with a serial connection a signal. The signal is just a byte (uint8) that I want to send to my evaluation board every 1 millisecond using Simulink. How can I do that? I tried using the Serial Send block, but the result is different from what I expected to see. Then I tried to use the To instrument block, but I don't know why there isn't the port COM 5 so I couldn't use it. Sending a signal periodically via UART Are you trying to send a signal to ThingSpeak? If not, you might be better served by reposting in the general <https://www.mathworks.com/matlabcentral/answers/questions/new/?s_tid=gn_mlc_ans_ask MATLAB answers> area. This discussion board is about IoT and ThingSpeak. serial simulink
Ravi Ghimire in MATLAB Answers
최근 활동: 2021년 10월 14일

Hello, Could you please recommend me best method for multiple fields read & right in ThingSpeak? I want to write in MATLAB Simulink via ThingSpeak Cloud from MIT APP Inventer Application , 4 fields with ( digital write 0,1)? I want to read 3 field value and read it from MIT App inventor via ThingSpeak Cloud? i have problem in reading and writing multiple channels , can somebody recommend be the best way.
Wen Yin Tay in MATLAB Answers
최근 활동: 2021년 7월 16일

I am developing the system that is monitoring the vehicle speed. I am using NI-XNET 8052 to get the signal from the vehicle with the help of Vehicle Network Toolbox. So far, I have identified the Standard CAN ID for the vehicle speed, as we can see from the picture below, the red box highlighted the vehicle speed. For now, I am not sure how to read the bit value only. If you happen to know the way, can you share it with me? Thanks.
Kyle Huggins in MATLAB Answers
최근 활동: 2021년 2월 25일

I'm attempting to publish to an external broker from within simulink, and then subscribe to a different topic from within simulink and act upon it. I'm using the mqtt library provided to do so. So the easy one is the publish model. Inside a matlab function I create a connection then publish at will whenever the signal comes across: function myMessage(inputs) persistent myConnection; if isempty(myConnection) myConnection = mqtt('tcp://localhost'); end %build message msg_json = jsonencode(msg); publish(myConnection,'mytopic',msg_json); The challenging one is the subscribe solution. I'm not sure how to do that appropriately, because essentially it is an asynchronous event coming from an external source. I've tried looking into the callback structure: function mySubscription() persistent myConnection; persistent mySub; if isempty(myConnection) myConnection = mqtt('tcp://localhost'); end if isempty(mySub) mySub = subscribe(myConnection,'myTopic','Callback',@someCallback); end but the function seems to fall out of scope and the callback isn't triggered when everything is running. Also I can't stuff a "while true" loop in the function because it locks up the sim. Also, trying the "read" method for the subscription task is not blocking so it returns immediately. I've seen the thingSpeak toolbox, but I do not have it as part of my license. We also have our own broker, so there's no need to go through some third party website. My question is how do I implement an asynchronous read from an MQTT based broker from within simulink?
Vinicio Moya in MATLAB Answers
최근 활동: 2020년 7월 9일

Hello! I have a channel in ThingSpeak. Field number 4: Temperature, with some data. But, when I try to read that data in Simulink, I only receive 0... What could be happening? Simulink model: Configuration in simulink ThingSpeak data: REsponse:
Vinicio Moya in MATLAB Answers
최근 활동: 2020년 6월 20일

Hello everybody! I want to use a Raspberry Pi 3B+ to control a biorreactor. I have some sensors, and they give me data in an URL (http://plaato.blynk.cc/auth_token/get/pin). How can I make a call to thar URL in Simulink? I don´t want to use ThingSpeak, and I´m sure that Simulink could do this in a simple way. Could yo help me?
BEERAIAH KANCHU in MATLAB Answers
최근 활동: 2020년 3월 10일

how can i access the simulink results from matlab in thingspeak
Artyom in MATLAB Answers
최근 활동: 2020년 1월 8일

Hello I know, that it should be possible to use Simulink-generated code at the edge, which would work with ThingSpeak Data. But is it possible to deploy generated code at the cloud (e.g. in Thingspeak) to receive a kind of cloud controller for IoT devices, which would receive sensor data, do analitics/control periodically or in response to some event and send commands back over MQTT to IoT devices? I know this would be a very slow controller, but the main Idea to have it simulated in Simulink, rather than in MATLAB. Thanks for feedback.
Madhu Govindarajan in File Exchange
최근 활동: 2019년 4월 9일

Example models needed for the Raspberry Pi®-based Indoor Climate Monitoring System project
Ajpaezm in MATLAB Answers
최근 활동: 2018년 12월 26일

I'm trying to use the thingspeakinput block in simulink, my model is fairly simple. I only have that ThingSpeak block connected to a scope. I want to simulate around 1200 seconds, but can't get past 3 minutes or 4 before getting this error message: This is what I tried: 1) Using Balanced Settings for Energy Options. Default settings. 2) Using the other option for Energy Saving. Default settings. None of them have worked. Do you guys know a way to make this work? Thanks for your time and help on this.
Ajpaezm in MATLAB Answers
최근 활동: 2018년 12월 20일

I have a Simulink block that calls a user-defined function. This function calls another function: thingspeakread.m (provided by the ThingSpeak Official Toolbox). From here, I want two outcomes. Data (numeric type, vector), and timestamps (strings, vector). [data,timestamps] = thingSpeakRead(___) Now, I'm able to get the values of "Data" into a Scope without much of an issue (using coder.extrinsic('thingSpeakRead') and preallocating the variable to store such points). The issue I have is this: I need to make more sense of the data visualization, and for that purpose, I need to plot this "Data" against the information displayed in the timestamps vector. The timestamps varies per minute only. What I'll try to do, but doesn't satisfies me a lot: Convert the timestamp into a numeric value using datenum() using the format for 'mm/dd/yyyy HH:MM:SS' This option sends back a huge number (which can be used to plot Data vs. Time indeed, but it doesn't look 'good' because the number is just too big and I don't like it). I have thought about these too: Convert date to Julian Date type. Convert Hours, Minutes and Seconds into 3 different arrays. But I don't see that getting me where I want (which is to plot Data vs. Time, being able to spot easily that the numbers displayed for "Time" are corresponding to an specific HH:MM:SS of a day). Is there anything you can guys suggest, please? Thanks a lot in advance! Edit 1: Can I use something like datetick() in Simulink?

ThingSpeak 정보

The community for students, researchers, and engineers looking to use MATLAB, Simulink, and ThingSpeak for Internet of Things applications. You can find the latest ThingSpeak news, tutorials to jump-start your next IoT project, and a forum to engage in a discussion on your latest cloud-based project. You can see answers to problems other users have solved and share how you solved a problem.