xXJEQTXx Posted July 6, 2023 Report Share Posted July 6, 2023 Hi guys, I want to take a DTI and graph that data to show it on my HMI, could you explain me how to achieve it? Link to comment Share on other sites More sharing options...
e janssens Posted February 12 Report Share Posted February 12 Hi xXJEQTXx Did you find a solution? Link to comment Share on other sites More sharing options...
ORSO2001 Posted February 12 Report Share Posted February 12 hi e janssens I don't know what exactly is your needs but I think that you can use the XYTrend where you have 2 tags: data and position; "data" is the value of the curve (Y coordinates) "position" is the quantity of the data that you want show (X coordinates). so you have to enable the sampling then read the number in the specific rows of the DT then stop to sampling...obviously you have to consider the "functions" and "limits" of XYTrend. hope that is clear enough... Link to comment Share on other sites More sharing options...
tonnerre Posted February 13 Report Share Posted February 13 I would be interested if there is a way to do this as well though I dont know of a solution myself, specifically whether one can take values from an old data set (FIle or UDTF) and view that information in a graph form. I believe you can load the the DTI from a file (Convert CSV to File or Load DTI from File) and view that data table on screen (Data Table). What I dont know, is whether this can be loaded in a graph format similar to what was suggested using the data sampler and XYTrend to view historical data after it has been saved. If simply looking to graph data live on the HMI screen, then I agree, the data sampler definitely is the ay to do this. Link to comment Share on other sites More sharing options...
ORSO2001 Posted February 13 Report Share Posted February 13 hi tonnerre maybe I am misunderstanding your mail but let me say that the "source" where you take the information (datas and position) is not so important...at the end you will pass these information at the trend structure that you must create to manage the XYTrend...so...as i wrote...when you star then stop the sampling a file (trend) will be saved...if the file has always the same name it will be overwrite; if the file name change every sampling campain you will be able to navigate in the history....if I well remember...but I have to check...the XYTrend just show all information in the specific space of "one chart"... Link to comment Share on other sites More sharing options...
tonnerre Posted February 13 Report Share Posted February 13 @ORSO2001, sorry, I should have explained my use case in the post above and I dont mean to hijack the post. Maybe it is similar to what xXJEQTXx is doing. I use data tables to log data and store it to a file rather than the data sampler since I am also recording other information that as far as I know the data sampler cannot record (user name, custom ascii text that the user enters, time and date stamp, etc.) and this based on events (triggers), not time intervals. At the end of the run, it may be useful to look at some of the numerical data (say a pressure, or temperature variation over time). So I was wondering if it is possible to parse out that data (I can think of some ways to do that) and graph it on an xy graph (unsure if this is possible) since a line graph is easier to review than a long data table. Link to comment Share on other sites More sharing options...
e janssens Posted February 18 Report Share Posted February 18 Hi @ORSO2001 thanks for your reply, I start trying this way, sampling a DTI file. I'm designing a smarthome application, reading en storing Active power from a Power sensor and the solar panel energy, steering the loading of the electical car, boiler, heating system, ... And to calculate finally the electrical capacity of the power consumption (in Belgium a high elektrical capacity will be charged, I have to pay aboout 160 euro extra yearly and this shall increase the comming years. To make the historical Active power visible, I tought to visualize the stored DTI's in daily, weekly, monthly and yearly graphs to see the electrical savings resulting from the smarthome functions. Link to comment Share on other sites More sharing options...
ORSO2001 Posted February 19 Report Share Posted February 19 hi @e janssens in one of my project I did something like that...I measure the power consumption of some motors; i split the day in 6 parts +1 to store the sum of these in a DT; so at the end I can check for each moto the power cunsumption monthly and daily. I used bargraph.... 1 1 Link to comment Share on other sites More sharing options...
e janssens Posted February 19 Report Share Posted February 19 Your X/Y graph is not standard in Unilogic, designed by yourself? Well done, this is what I had in mind. Can you share the source or is it easy to desing? Link to comment Share on other sites More sharing options...
ORSO2001 Posted February 19 Report Share Posted February 19 ya...designed by me...i created two customs controls...one for the month and one for the day...if selected day is "0" i show the monthly info if the day is not "0" i show the daily info; at the CC i pass the info take by the DT...one of these is the MAX value "found" to define what is the Y range...also I decide that if the MAX is less than 10 KW i show the value in Watt ... yes I can share these...but at the end is not so difficult done these...the most important thing is the "logic" that works "under the wood"...where and how store the data (what is the amount of it?) and when and how "read" the info... ok...seems that I can't post by the size problem...I will try to post on my own place... Link to comment Share on other sites More sharing options...
ORSO2001 Posted February 19 Report Share Posted February 19 seems that I reach almost the max size that I can upload...someone can tell me how free space? thanks Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted February 20 MVP 2023 Report Share Posted February 20 @Cara Bereck Levy - can you allocate ORSO2001 some more space? Joe T. Link to comment Share on other sites More sharing options...
Cara Bereck Levy Posted February 20 Report Share Posted February 20 @ORSO2001 I tweaked your settings to allow you more space, @Joe Tauser, thanks for tagging me directly. Link to comment Share on other sites More sharing options...
ORSO2001 Posted February 20 Report Share Posted February 20 @Cara Bereck Levy & @Joe Tauser thanks. so below the Custom Controls about the daily and monthly graph; also the HMI page where I use those. I don't know if the ladder functions that I use could be helpful...as said I created a struc with date (string), motor1, motor2 etc and a ID position of the day...this last is from 1 to 6 for the time slots and ID 7 for the TOT of the day....so I will search for the date string and the ID from 1 to 6 for daily; just 7 for the monthly. if needed I could share alse the LF. Energy.ulhe Energy_Day.uluce Energy_Month.uluce Link to comment Share on other sites More sharing options...
e janssens Posted February 20 Report Share Posted February 20 Tanks a lot, I look forward to see how you have fixed it, I was already started with sampling the DTI using Read row to a struct and next "Data Sampler DTI power.Force Sample" on this struct, but not yet result. Link to comment Share on other sites More sharing options...
e janssens Posted February 23 Report Share Posted February 23 Hi @ORSO2001, working with 'meters' was too time consuming having 96 samples in one graph. So I did it with an XY trend, read a DTI data row in a R/W struct and using the bit "force sampling" to read this struct in the sampling database. It worked fine (see the printscreen) But now I have, when starting sampling, a black HMI and after reboot the error status -6 on Data Sampling , a new sampling doesn't start, and nothing in the helpfile, nor on the internet, have you an idea what this status means? Link to comment Share on other sites More sharing options...
ORSO2001 Posted February 23 Report Share Posted February 23 hi @e janssens i don't know what -6 means...could you share the function where you try to read data from DTI and sampling it? here attached a really simple example about what I meant in my previously post... sampler-XYtrend example.ulpr Link to comment Share on other sites More sharing options...
e janssens Posted February 23 Report Share Posted February 23 I thought: using "data Sampling.force sample" , no need to set "data sampling.start/end sampling". Setting back on the start/end sampling removed the status -6. This should be mentioned in de help file. Also the source of status -6. Link to comment Share on other sites More sharing options...
e janssens Posted February 24 Report Share Posted February 24 Thanks, I could collect some improvements out of your ULPR. The graph works fine, only after sampling the refresh is not automatic, I guess there is a refresch command. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now