CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Mon Dec 17, 2018 11:34 am

All times are UTC+01:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Mar 23, 2017 2:05 pm 
Offline

Joined: Fri Mar 10, 2017 4:45 am
Posts: 25
I have a question about web visualization in Schneider SoMachine, which is basically Codesys and Schneider's HMI software wrapped up together. I am storing .csv files to the flash memory using the CAA file library, which I would then like to plot on a graph in a web visualization.

The problems with Web Visualization:
1. SoMachine doesn't implement the Codesys Trend Manager
2. I could use a histogram or a trace, but they have their own issues--the histogram doesn't seem to allow changing options at run time (scale, data set, etc), and the trace seems more for short term graphing, not historical data sets.
3. Some of my .csv files are 1440 rows (once per minute, one file per day) and 20 columns. That's a lot of data for the web visualization to handle.

Partial Solution:
1. I had some old code that took a .csv file and displayed it in a trend on a webpage using javascript, using a library called dygraphs. It works if I upload it to the /usr/visu directory and reference it directly. I even created a sort of wrapper to load my trend webpage, as well as the visualization page, and even other external pages. Basically, I get the file through a javascript AJAX request, process it, and display it using dygraphs. This all works.
2. The problem with this solution is that the compact flash card is mounted at /sd0, but the webvisu root directory is /usr/visu, therefore, the web visualization can't see the compact flash card because it can't see any files above it's own root directory. This leaves me with only the internal flash memory to store files, with a total size 128MB on the Schneider M241/M251 PLC. I want to be able to store, and then access the files on the compact flash card from the web server.

Questions:
1. Is there any way to change the root directory of the web visualization? That would be the simplest solution--just put it all on the compact flash card.
OR
2. Is there any way to access the compact flash card from the web visualization? I can actually load a file from the flash card into the visualization text editor, but it looks like it's using an internal protocol to get the file through the PLC, and I don't know how that protocol works.
OR
3. Is there a way to get the Codesys trend manager into SoMachine 4.2?

thanks for your input

Tim


Top
   
PostPosted: Sun Jun 18, 2017 10:36 am 
Offline

Joined: Mon Jan 09, 2017 8:16 am
Posts: 2
Hi!

I would also like to see a solution for this. However I am really interested in your Partial Solution since I have no solution at all. Is it possible that you would like to share the code for that? Do you embed a code into a visualization page, what kind of wrapper do you use?

I have talked to Schneider about having the trend option in SoMachine but they did not sound that enthusiastic..


Top
   
PostPosted: Wed Nov 07, 2018 9:29 am 
Offline

Joined: Thu Mar 30, 2017 12:13 pm
Posts: 24
Hello Readers,

I'm bumping into the same issue.
I need long term tracing of PV systems, log them and plot them into a graph/history of which I can scale the X and Y as (_ etc).
Is a solution found for this?

Could also do the trick by 'loading' the data on a WebVisu event from the csv file to a databuffer, running some ST code with the desired interval and timewindow.
I've seen that the WebVisu has a file copy task for events but I don't know what its permissions are (won't be realtime).

Another option would be a third party script/webpage. I mean some HTML implementation of, for example, HighCharts. You could just insert a custom HTML page on you PAC controller and make an EVENT to load the (local) URL (as popup), and pass the CSV to the HighChart page. HighCharts has _ capabilities and different chart presentations.

What you could also do is a array buffer as FIFO, just use the ARRAY ROTATE and insert the new values at the end.
For SoMachine it's the function FC_RolArrReal(i_iShiftPosNumber: INT, i_prStartAddr: POINTER TO REAL, i_bySize : BYTE ).


Top
   
PostPosted: Thu Nov 08, 2018 1:56 am 
Offline

Joined: Fri Mar 10, 2017 4:45 am
Posts: 25
What I ended up doing was paying a developer to write a Java applet that actually gets the file from the SD card through the ftp server on the PLC, then embedded custom web pages in the visualization on the internal memory. It's a total hack, and I hate everything about it, but it works. For now. As long as I don't upgrade Java, or the browser, or...

The only reason I need the SD card is storage space. If all your files fit within the 128MB of internal memory on the M241/251 controllers, then it's pretty easy. I used dygraphs.com and wrote a bunch of javascript to make it work--basically get the file through the http server, convert it to an array, and display it. The problem for me is 128 MB isn't enough.
I've been thinking that it should be possible to copy a file from the SD card to the internal memory, and then get that file and display it. Copying the file is easy, I can do that with the CAA file library. Displaying the graph is easy, I have all the javascript code for that written. The connecting link is figuring out a way to triggers a variable in the PLC, and then read back a bit to say that the file is loaded. And I haven't figured out how to do that through a javascript/custom html page yet.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 4 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited