Skip to content

Data logging, using a function block to capture data (and use in/out ports)

Hello,

So I've read the following on data logging with PLCnext: https://engineer.plcnext.help/2022.0_LTS_en/_index.htm?iframe=https://engineer.plcnext.help/2022.0_LTS_en/Commissioning_DataLogger.htm

And here's more to learn on data logging with PLCnext: https://www.plcnext.help/te/Service_Components/DataLogger/DataLogger_concept.htm And have to dig into this further, but I have some questions.


Accessing and exporting data from SD-card

Is it possible to readout the logs from the SD-card without having to remove the SD-card from the PLC? I mean there's a USB port on the controller. But some time ago I was told there was no real use for it yet.


Logging on change and not every cycle

Instead of logging each cycle (*** milliseconds) I'd like to capture specific data, triggered by change (activity) and only over a short period of time. And log this data in the database (sqlite) and the time series database; to be used for the Web Panel (charts/trends).

I want to log the combination of both CO2- and O2 concentration and the valve number, with a time stamp. There's only one gas analyzer but the sample gas can come from multiple sources (small yeast reactors), but only one at the time. So magnetic shut off valves are being used. A sampling cycle will probably be 3-5 minutes, then sampling will be done for another reactor. (Minimum of 1, maximum of 6. For now 2 reactors will be used). And sampling will keep going on until the loop has been exited.

The objective is also to use Proficloud in combination with Grafana. (And sending values every second or so is already way too much for this application).


Any ideas on how to do this?

Any pointers to a clear tutorial on how to make useable function blocks with PLCnext Engineer? -- For me it's a deep dive; have some experience with LOGO! and JavaScript. But there's a lot of new technology in the mix here, and so much flexibility is being offered with PLCnext; some help with tips or links for more info/ideas would be appreciated. I'm feeling a bit overwhelmed at times. 😶

Comments

  • Or is data export from the SD-card limited to a computer logged onto the HMI/web-page with export functionality, downloading it via a network cable (or intranet)?

  • I think the answer to your first question is "yes."

    You can use WinSCP (or other) tool to remotely access the controller. The directory information is in the screenshot below.


  • Regarding your second question...

    I have never tried it, but it looks like there are trigger conditions for the built-in data logger. If you check "Trigger Condition" then you can provide operands that must be true to start the logging. See Screenshot.

    In this, I am logging LevelCurrent when both SafetyConditions and PressureOK are true.


  • I think the answer to his question is in the "Store Changes" checkbox. The trigger condition starts the data logger, but "Store Changes" option logs data at fixed intervals(not checked) or on value change only(checked).

  • edited December 2022

    Thank you, Steve. This looks like a promising solution we could use. I will try this logging method when my main PLC program is ready.

    And about WinSCP, this could definitely be a way but only for someone with some IT skills. I have a good feeling about your solution to my second answer and that we can get this to work for Proficloud/Grafana (without sending way too much data their way). Then the export of the data from the SD card is no longer a necessity.

    Will let you know when I have tried this. Thanks.

  • edited December 2022

    @sparky66 So you mean, when the logging is triggered it will continue logging, and with 'value change only' checked you can use a boolean to log the desired value and only when this change is detected?


    I have looked into the datalogger inside PLCnext, but I can not find the latter option; 'value change only'.

  • edited December 2022

    I am assuming that writing null uses less memory than writing an actual value.

Sign In or Register to comment.