Acces data on PLCnext with simulink

Hello, I am a master student writing his thesis about predictive maintenance. My goal is to develop a Matlab/Simulink model that predicts when a motor needs maintenance.

For testing, I read data off of my PC as seen in picture 1, but I need the model to read data out of the plc. With WinSCP I can see that the data on the PLC is stored in the folder: /opt/plcnext. If I just give in this path in Simulink, it obviously gives an error because the path is unknown. Does anyone have an idea of how I can make this work? Kind regards,
Koen Indigne

Hey Koen, you’re right that PLCnext stores all project related files in the /opt/plcnext/project directory on the PLC.

It would be also possible to deploy all necessary files with it’s meta information directly to the PLC, but this is not that handy and demands also a bit of experience. Better is to download you project with PLCnext Engineer and in fact your Simulink model would be a part of it. Please have a look to this introduction and the related tutorial videos, they’re straight forward and should give you a good start. Just let us know if you’ve further questions… cu
Frank

Hi Frank I’m helping Koen with his thesis.

Maybe we should explain a bit more of what we are trying to do :slight_smile:

Koen has build a predicitve maintance model in simulink that reads data from a file and calculate the Fourier transform, detects the peak and give a good, warning or error when there is a problem detected.
But it seems that his test data is always part of his model. That is not desirable as we always would get the same results. With the datalogger we create files coming from a 4-20 mA vibration sensor. We would like to use these files for our calculation.

Would that be possible? Dries

Hey Dries, hmm you can query the rt datalogger via RSC services in a C++ program. https://github.com/PLCnext/PLCnext_RT_Datalogger/blob/public/getting-started/Part-05/README.md Those historical data (in fact also used for UA Historical) can than be published as a GDS port (field) to use those historical than for the FFT in the model. If this makes sense for you please let me know. Cu Frank BTW:

The header for the demanded RSC services are not yet part of the SDK (planned to 2020.6) , but available on demand.