Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Stumpy

Pages: [1] 2
1
Hi David

Yes I think the kit should be able to handle what demands I throw at it with relative ease. I am spoilt for choice regarding plc programming language options, but I think I will try to tackle it in Structured Text Language. The interface is geared up for modular development kind of how your suggesting.  It pays to keep logic well laid out easy to follow and logical! I am awaiting the latest firmware release. It should arrive any time soon, then at least I can upgrade my plc simulator and start developing and testing some code.

Cheers

Hugh

PS I am still interested in the meteorological equipment/data (Wind Speed/Direction). In particular the resolution and interfacing of direction. Longer term I am wanting to implement Met data on the HMI so will need to spec up I/O to suit. 

2
James much obliged! Thanks!

3
Hi David

I mentioned PLC was ABB 800xA and I am using the opcda1 driver for Advanced HMI comms.
 
I am looking to solve this min/max/average problem all 3 ways using;

1. Logging to file
2. Logging Using database(s)
3. Using the PLC to Log in the PLC ie you solution!

It the learning opportunity/curve for me so enjoy the Silence I am just mulling things over... rest assured it won’t be too long before my queries will be heading in your direction :)

Longer term I am wanting to be able share some of the data from the PLC with other persons but not at the risk of the PLC (hence log files or database) but like wise, what I would consider mission critical data I would want to store in the PLC (ie your  robust PLC Log solution).

I also see the need to take a data snapshot of how things (system/sub system level) perform when commissioned. That way when after years of operation you can pull the data & compare. You can “SEE”  degradation in performance has cause over time. Then maintain it back to an acceptable level. I think a really useful tool to look at that log data is DB Browser for SQLite.

Any way in summary I still need assistance to crack 2 & 3 above so remain on standby “Please” I find it of great help to be able to obtain assistance by asking. I do appreaciate time is precious. So thank you all once again!

Hugh

4
Hello David

I am sure James soon will think I am very "trying!" but where there is a will there is a way!

Just for background info...
I note what you both are saying about the index etc... The "time and date" field1 in my sample csv file is unique and  the DB Browser has an auto index option (tick box) under "Edit Pragmas" Tab, which is adjacent to Execute SQL tab) which results in row/ID from 1 to 240 which is automated and seems correct. So I am assuming the unique index should all be taken care of as the raw csv file is imported. ie Import option under File Menu and selecting the csv and accepting default options.

On the graph Plot (DB Browser ver 3.9) initially everything worked, but as I used the Execute SQL Tab to create some select commands (ie filter my data),  now graph plot literally lost the plot!  Downloading DB Browser ver 3.11.1 improved the situation but it is not perfect yet. I think a few more "Gremlins" are in their code...

This is no show stopper for me just part of my learning curve. Think I will continue to use DB Browser as engineers tool. The plot window is really quick and easy to use but keep in mind there may be a few undocumented features you may come across!

Hugh




5
Update from 3.9 to 3.11.1 on DB Browser for SQLite seems to be better on the plots but not perfect... Work in progress on their part I assume, time will tell!


6
Ok thanks for Feedback... No pain no gain as they say! I will try DB Browser update and play with it abit....

Cheers

Hugh

7
So I guess would each csv file needs modification to have its own  unique index column added, perhaps my assumption that date & time column  not suffice.

Also I noticed there are some options in DB Browser to create index. I can try it out.

Thank you for your prompt response!

Hugh

8
Yes your results are what I was expecting.

9
Phrog30, Sorry to bother you....

Thank you for the demo download. I have had a play with the table and supplied data seemed to work great. It looks a really simple easy tool for slicing & dicing loaded data! To this end I eagerly wanted to try my own sample data from my BasicDataLogger2 daily log file (ie raw data text file but I renamed the file extention from txt to csv allowing me to easily import into both excel and DB Browser for comparison). Note daily log file is simply 240 data samples for a few PLC items (temperatures, and other bits n bobs) ie recording every 6mins over 24hr period.

For the Min, Avg & Max aggregate function I am only applying the calculation to the 2nd column (field2) which is ambient air temperature.

I expected all result to be identical but was surprised by my findings and can only conclude I am doing something wrong?

MS excel results (which to me seem to be correct)
Min   -11.99817  04/03/2019 23:47
Avg   -7.186637
Max   -3.794922  04/03/2019 12:53 and 12:59


DB Browser results.... (Version 3.9.1, Qt Version 5.7.0,SQLCipher Version 3.11.0)
1. The Average function in DB  Browser for SQLite worked as expected in both giving -7.186637 (GREAT RESULT)
2. The Minimum function in DB Browser result = -10.09155 (which seems wrong)
3 The Maximum function in DB Browser result = -9.979401 (also seems wrong)

Using the select statement to include date & time (field1) I get

select field1, min(field2) from PLCDataLog_2019_03_04

"04/03/2019 00:17"   "-10.09155"                                  <---Row 3


select field1, max(field2) from PLCDataLog_2019_03_04

"04/03/2019 00:23"   "-9.979401"                                 <---Row 4

Oddly DB Browser seems to repeatedly point to the 3rd & 4th row of field2 to return its version Min & Max.
Great that its pointing to something that exist in my table but again oddly 1st temperature is the min out of the first four so why did it not return the 1st row result then stop??

In addition the Avg function must use the correct values for this average value to be the same as the excel calculated answer. This adds to the intrigue!

So far they are my findings regarding DB Browser Min & Max aggregation and in conclusion I am left scratching my head!

I have attached my sample data csv file for "Fun" filled problem solving (just to get an impartial view that is before contemplating a bug report).

Also I tried to use the plot window which looks very useful (unless I use select!). All the data "is" available on initial file import, but then as expected vanishes as the select command serves up only those items returned from the select request. All good so far eg select max(field2) from PLCDataLog_2019_03_04

However when select * ie "select * from PLCDataLog_2019_03_04" is used I would expect field1 (my Date & time) results to return on the plot screen but magically field1 remains missing  from the plot window but is in plain view in the results table located below the select command window.  It would appear that I am unable to plot anything against time without field1 being present in the plot window.

Not sure now wether to continue scratching my head at this point or close my gaping mouth... seems a bit baffling to me....

I did try to remove the "_" from the table/imported name in case that was some sort of undocumented qualifier to stop at row 03 & 04. It would seem not as it make no difference to my results.

Can you shed any light on the above teething problems...


Regards

Hugh

10
Can I just say "WOW" A lot of hard graft (work) and effort has gone in to that project, especially with attention to detail. Its fantastic! I think it would take me a few years to code something similar! :(  After seeing that I am just jealous ;) but inspired at what is possible.
I can see how you have collated the 900 words of data, smart move for the hi resolution over the 15mins. Also I am very impressed with the Weather Station Graphics! Not to digress too far from the main topic but what I am interested in what kit is used in particular the wind direction and its granularity/resolution? plus is it analogue input?
It looks like the PLC I will be using has a built in "resource/overhead" graph as part of its download so I can hopefully avoid over burdening the processor or memory which is nice since I know my coding initially wont be efficient!

Hugh

11
Forgive my lack of clarity moving forward just had to pause for thought. For me all three options present valid solutions with slightly different learning opportunities. Initially I did want the easiest/quickest solution to summarize my data but as with most things once you get a glimpse at the possibilities:- ideas form, requirements evolve/change, and so I now also want to use this to learn and gain experience allowing me to better understand and implement future system applications as they are needed.
 
I do find great comfort in the fact that as you have all demonstrated here that help is at hand when needed... So I hope its OK to pester you for more info, as I would like to learn/explore more regarding solutions using Databases and PHP with website front ends, (kind of an ultimate longer term goal in the back of my mind). Perhaps first I need to digest and solve the 3 solutions to the original query, helping bring me up to speed and use it as a stepping stone moving forward ie eventual goal of database solutions with web based front end.... of which I can only dream about from my starting point now!  As the saying goes on this side of the pond "Rome was not built in one day", but with continued help/support from this excellent forum success seems to be within my grasp which I see as a great starting point! :)

Kind Regards

Hugh

12
Actually David,
 You have a very valid point. I had not thought of your solution because the system is remotely located. However your last comment sparked a light bulb moment. I do have the option of running a "Soft Controller" (simulation on PC/Laptop) that I could load up the existing PLC Program and then develop to cater for my data recording requirements. Then carry out the necessary proving tests before loading up during a future site visit. I think that would work :)

So I guess I should update my previous statement...  I will attempt ALL Three options. It should keep me busy for a while.


Thanks Again for the input!

Hugh

13
Thank you one and all for your time and the feedback... It opens ones eyes to options!

Godra: Great links to coded examples I will try these out on my saved data file(s)...

Phrog30: I do also like the option going forward using a database. So Yes More Info PLEASE! ....


I will attempt both options

Thanks Again

Regards

Hugh

14
Hi DadvidSr

Thank you for your reply, sadly in this instance I do not have access to the PLC for programming, its located remotely.
Also the internet link is very slow, so realistically I can compile and then upload an AHMI project (taking  about 3 or 4Hrs to upload). Note this not a mission critical app, just something to take the chore out of post processing data! Although the daily log details give great insight of workings, I now really only want the Min, Avg & Max readings cutting the current daily log points down from 2400 to 30. This over the years should save disk space!

I am using opcda driver and its an ABB 800xA. I can read the OPC data no problem and my current append to daily log file gives some robustness regarding history for previous values that day should a power outage occur. A ups is in place to cover brown outs but some times longer unplanned outages occur (ie storms affecting power grid) and a loss of log data until grid power is restored.

Cheers

Hugh

15
I have been logging data to a text file using AHMI v3.99y Beta28 using the Basicdatalogger2. It works perfectly! But I now want summarize the daily logs.

In the Basicdatalogger or ChartWithLogging or Datasubscriber would there be an easy way to record just that days Min, Average & Max Values to a daily Log file for Each PLCAddressItem. I have about 10 monitored items.

I am currently testing and recording using BasicDataLogger2 writing a daily log file but then having to post process to summarize the data for min, Avg & Max Values separately for each PLCAddressItem using spreadsheet.

Any Help much appreciated!

Thank You in advance!

Hugh

Pages: [1] 2