Previous in Forum: No COLA Retirement Plans   Next in Forum: SD Card Not Formatting Due to Invalid Link File
Close
Close
Close
3 comments
Rating: Comments: Nested
Commentator

Join Date: May 2011
Posts: 76

Matlab Code Experts, Logging Holding Registers Real Time Values to Excel

05/18/2019 3:35 AM

Hello dears,

I connected Matlab as master to a slave controller to read holding registers, but I want to write to excel sheet (logging data), after some time read the value then write it to new empty row, with time in other respective column, so I end up with raw data's were I can trend them.

Can any one help me to do the code?

Regards

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Guru

Join Date: Mar 2007
Location: by the beach in Florida
Posts: 33392
Good Answers: 1817
#1

Re: Matlab code experts, logging holding registers real time values to excel

05/18/2019 3:59 AM
__________________
All living things seek to control their own destiny....this is the purpose of life
Register to Reply
Guru
Canada - Member - Specialized in power electronics

Join Date: Feb 2008
Location: Montreal, Canada.
Posts: 1372
Good Answers: 80
#2

Re: Matlab Code Experts, Logging Holding Registers Real Time Values to Excel

05/19/2019 9:42 AM

You may want to use Matlab's own recording functions to the workspace and then save the file once the simulation is complete.

Use this line to add new test results to your previously defined array in the workspace:

Case_array = cat(1, Case_array, Test_Result); %Tests results from the simulation with conditions

Then save the file to disk:

save('Case_array_File.mat','Case_array');

Later, you can import the file to excel if you need to.

__________________
Experienced is earned, common sense is taught, both are rare essentials of life.
Register to Reply Score 1 for Good Answer
Commentator

Join Date: May 2011
Posts: 76
#3

Re: Matlab Code Experts, Logging Holding Registers Real Time Values to Excel

05/26/2019 5:37 AM

Thanks,

Register to Reply
Register to Reply 3 comments

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Copy to Clipboard

Users who posted comments:

Fardan (1); marcot (1); SolarEagle (1)

Previous in Forum: No COLA Retirement Plans   Next in Forum: SD Card Not Formatting Due to Invalid Link File

Advertisement