CSV Read/Write or Output CSV

For general Flowcode discussion that does not belong in the other sections.
RGV250
Posts: 342
http://meble-kuchenne.info.pl
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 35 times
Been thanked: 36 times

CSV Read/Write or Output CSV

Post by RGV250 »

Hi,
I found an example that uses CSV write, I was a bit surprised it compiled as I thought I did not have a licence. I then found out that CSV Read/Write is free whereas Input CSV / Output CSV is in the DSP group and needs a licence. Just what are the differences.
All I need to do is log readings from my power meter so I can hopefully make a graph on a web page later.

Regards,
Bob

BenR
Matrix Staff
Posts: 1954
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 700 times

Re: CSV Read/Write or Output CSV

Post by BenR »

Hi Bob,

The CSV Read/Write component under the Runtime menu is for simulation or AppDeveloper only, for embedded it won't produce any code. If this is for an embedded app then you might be better off using the File component under storage or we can look at allowing the CSV component to be embedded compatible via the File component.

RGV250
Posts: 342
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 35 times
Been thanked: 36 times

Re: CSV Read/Write or Output CSV

Post by RGV250 »

Hi Ben,
This is what i was looking at. https://www.matrixtsl.com/wiki/index.ph ... ime_Tools)
I am trying to make a better (for me) front end to an eco eye power monitor. https://www.eco-eye.com/domestic-products

I am now able to read the data from the transmitter reliably and show it on a web page. The next step is to store the data, I did look at a database but then saw that link and thought the CSV write would be better to put into a LibreOffice spreadsheet on the Raspberry pi.

The other thing is the file component would need a licence and it is all adding up on this project.

Bob

BenR
Matrix Staff
Posts: 1954
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 700 times

Re: CSV Read/Write or Output CSV

Post by BenR »

Hi Bob,

Yes that component is currently only for use with the sim though I can see it being handy elsewhere so I'll have a go at making it embedded compatible. We are also currently investigating allowing access to the file system on the RPI so this work would also benefit you.

I've sent you a PM regarding the licensing which I hope you find useful.

RGV250
Posts: 342
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 35 times
Been thanked: 36 times

Re: CSV Read/Write or Output CSV

Post by RGV250 »

Hi Ben,
I think it would be handy for the CSV component to be available for an embedded device as I do not need anything more than that.

Bob

RGV250
Posts: 342
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 35 times
Been thanked: 36 times

Re: CSV Read/Write or Output CSV

Post by RGV250 »

Hi Ben,
Thinking about this a bit further, in a different post you were going to have a look at being able to have variables for non embedded web pages on the Pi. I am not sure how you were considering doing that but this might be a bit of a work around. If this is available for embedded devices it would be possible to read and write to a temporary file so the web pages could read and write to that file as well.
As said, I do not have a lot of experience with web pages yet so it might not be a good idea at all.

Regards,
Bob

RGV250
Posts: 342
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 35 times
Been thanked: 36 times

Re: CSV Read/Write or Output CSV

Post by RGV250 »

Hi Ben,
I have some work to do playing with the external web pages so I hope I don't come across as ungrateful but I just wondered if this would likely be available in a week or so.

Regards,
Bob

BenR
Matrix Staff
Posts: 1954
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 700 times

Re: CSV Read/Write or Output CSV

Post by BenR »

Hi Bob,

Yes I haven't forgotten this one, I'll see what I can do ;)

BenR
Matrix Staff
Posts: 1954
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 700 times

Re: CSV Read/Write or Output CSV

Post by BenR »

Ok I've made this change now too and pushed to the update system.

If you need to use the webserver and the CSV writer at the same time then simply point both components to the same File component. Then use the SetFileIndex macro to jump between active files. Something like this.

Loop
{
File::SetFileIndex(0)
WebserverMacros
File::SetFileIndex(1)
CSVMacros
}

Let me know how you get on.

RGV250
Posts: 342
Joined: Sat Mar 19, 2022 4:53 pm
Has thanked: 35 times
Been thanked: 36 times

Re: CSV Read/Write or Output CSV

Post by RGV250 »

Hi Ben,
Does this only work when installed on the Pi now, I tried it in debug and it does not create a test file now.

Bob

Post Reply