Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:47 25 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Electronics : Analog Meters On Piclog

     Page 1 of 2    
Author Message
windman1000
Regular Member

Joined: 21/06/2009
Location: United States
Posts: 91
Posted: 09:49pm 04 Jun 2010
Copy link to clipboard 
Print this post

I modified Glenn's Piclog software and added in analog meters i have two versions of it

You can download both here, unzip and put both exe files in your Piclog Folder
2010-06-05_074519_meter.zip
 
dwyer
Guru

Joined: 19/09/2005
Location: Australia
Posts: 574
Posted: 01:06am 05 Jun 2010
Copy link to clipboard 
Print this post

Hi Windman

That is a great job for adding an analog meter and looks great and better for my eyes I also love analog meters. Well done Mate

regard ian
 
GWatPE

Senior Member

Joined: 01/09/2006
Location: Australia
Posts: 2127
Posted: 02:45am 05 Jun 2010
Copy link to clipboard 
Print this post

Hi windman,

I have been unable to run your program. It seems that the underlying bugs are still there.

The analogue meters are good, but take up a lot of space on the screen. I hardly ever use the real time window, as most of the time I minimize the app to the task bar. I have 6 other logging systems running when I tried to run this new prog.

You may have seen the error in this pic as well.




Gordon.


become more energy aware
 
windman1000
Regular Member

Joined: 21/06/2009
Location: United States
Posts: 91
Posted: 03:01am 05 Jun 2010
Copy link to clipboard 
Print this post

Yes I Have Seen That Error with the old Piclog and this New one all i do is Close It wait a few seconds And reopen It, It has something to do with the Timers in the Program i think , But It All Work Ok So I ignored the message and restated it some time a few restarts, i did get less errors if i had VSrcoll under timer 2 but i didnt like the way it would reset to 0 every few minutes.

Il look into this at a later time, as it does work now.

WINDMAN1000
 
Downwind

Guru

Joined: 09/09/2009
Location: Australia
Posts: 2333
Posted: 04:24am 05 Jun 2010
Copy link to clipboard 
Print this post

I get the same error as well, and it keeps crashing.

I am unable to run it with incomming data.

It looks good in what you have done, my only dislike is how it takes up the full screen.

I like a small window that i can leave at the bottom of my second screen and view the incomming data while doing other things on the computer, as i use the one computer for many functions and data logging is just one function in the back ground.

If you can fix the bug let me know as i would like to view it with live data.

Pete.
Sometimes it just works
 
GWatPE

Senior Member

Joined: 01/09/2006
Location: Australia
Posts: 2127
Posted: 11:16am 05 Jun 2010
Copy link to clipboard 
Print this post

Hi windman,

I did fix many of the original bugs, but I have so many different versions of code, that I haven't been able to find a direct fix for the 380 error bug. From memory, the invalid property value comes up when VB is asked to perform manipulations of the wrong data types.

I had looked at analogue windows, but with a possible 24 display channels on my new app, I decided that I would stick to digital meters. I have to ask, what happens when you only have less channels, or wish to only see say windspeed, or battery volts, or windmill rpm, individually. Is the graph data still all automatically scaled so that the graphs fill the screen. I found it hard to compare days between those that were really windy, and those that were quite calm.

I have not been able to get the program to run long enough to even get to the programming, or calibration windows to make any changes, to see for myself.


Gordon.



Edited by GWatPE 2010-06-06
become more energy aware
 
oztules

Guru

Joined: 26/07/2007
Location: Australia
Posts: 1686
Posted: 11:57am 05 Jun 2010
Copy link to clipboard 
Print this post

Keep at it Windman. I am sick to death of digital displays trying to display dynamic systems.... it just does not work for me.

As for full window display, yes thats for me. I would either want to monitor it for a bit with interest or curiosity, or minimise it. I either want to see it for whatever reason... or I don't. My brain is tiny, and one screen at a time is plenty for me to concentrate on.



I like the format.

Hope you can solve your bugs

Just one more good thing about open source. Many people can try many things.... and different solutions for different tastes and needs..... more the merrier.


.............oztules
Village idiot...or... just another hack out of his depth
 
windman1000
Regular Member

Joined: 21/06/2009
Location: United States
Posts: 91
Posted: 05:49pm 05 Jun 2010
Copy link to clipboard 
Print this post

ok i spent alot of time on this last night going threw the code and i could not see anything to cause that error 308 that some of you seem to be getting.

I remember that same error when i first used the orginal Piclog but after a few restarts it went away and the only error i would get after that was a runtime error now and then.
after i mod the picloc for the analog meters and debug all the problems out I did get the error 308 1 time only, but never got it again.

so I Loaded this in 5 diff computers all xp diff versions and put the MSCOMM in the system32 and then open the new logger, 3 computers no problem at all 1 computer gave me the 308 error 1 time and never again, the 5th computer i restarted the logger a bunch of time but it would not run with out erroring out (308) error, Ok i have 4 computers that the new logger has no problem running and 1 computer i cant get it to run with out erroring out,
Ran a Registry Cleaner And now The 5th computer runs the new analog logger with no problem, but i dont have any of the 5 computers hook up to com port for data.
 
windman1000
Regular Member

Joined: 21/06/2009
Location: United States
Posts: 91
Posted: 05:59pm 05 Jun 2010
Copy link to clipboard 
Print this post

opps i ment 380 error in above post

I would like to know how many are having the 380 error problem, and how many are not having any problems and if you are but you can get it to run then try , unclick. startup auto in programs and unclick html ,excel,rpm,wind.

rpm and wind donot disables meters or enable them.

EDIT: Maybe I just found something but not sure try this one and if you dont get error let us know and the some admin can delete the upper download or replace this one with it.
2010-06-06_083538_Merter.zipEdited by windman1000 2010-06-07
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5078
Posted: 10:51pm 05 Jun 2010
Copy link to clipboard 
Print this post

Windman you could try using this updated routine in the Main.frm. Just delete the old MSComm1_OnCom() routine and paste this one in.

Sub MSComm1_OnComm()
Static ReceiveBuffer As String
ReceiveBuffer = ReceiveBuffer & MSComm1.Input
MSComm1.InBufferCount = 0
If InStr(ReceiveBuffer, "[") > 0 And InStr(ReceiveBuffer, "]") > InStr(ReceiveBuffer, "[") And Len(ReceiveBuffer) < 55 Then

Timer2.Enabled = True
BlinkData.BackColor = &HFF&
message = ReceiveBuffer
ReceiveBuffer = ""
V1 = -1: V2 = -1: R1 = -1: Mode = -1: S1 = -1
If InStr(message, "<V>") > 0 And InStr(message, "</V>") > InStr(message, "<V>") Then temp1 = Mid(message, InStr(message, "<V>") + 3, InStr(message, "</V>") - InStr(message, "<V>") - 3)
If IsNumeric(temp1) Then V1 = temp1
If InStr(message, "<I>") > 0 And InStr(message, "</I>") > InStr(message, "<I>") Then temp2 = Mid(message, InStr(message, "<I>") + 3, InStr(message, "</I>") - InStr(message, "<I>") - 3)
If IsNumeric(temp2) Then V2 = temp2
If InStr(message, "<R>") > 0 And InStr(message, "</R>") > InStr(message, "<R>") Then temp3 = Mid(message, InStr(message, "<R>") + 3, InStr(message, "</R>") - InStr(message, "<R>") - 3)
If IsNumeric(temp3) Then R1 = temp3
If InStr(message, "<M>") > 0 And InStr(message, "</M>") > InStr(message, "<M>") Then temp4 = Mid(message, InStr(message, "<M>") + 3, InStr(message, "</M>") - InStr(message, "<M>") - 3)
If IsNumeric(temp4) Then Mode = temp4
If InStr(message, "<S>") > 0 And InStr(message, "</S>") > InStr(message, "<S>") Then temp5 = Mid(message, InStr(message, "<S>") + 3, InStr(message, "</S>") - InStr(message, "<S>") - 3)
If IsNumeric(temp5) Then S1 = temp5
If V1 > -1 Then BattVolt = Round(V1 / VoltDivider, 2)
If V2 > -1 Then BattAmps = Round((V2 - VoltOffset) / AmpDivider, 2)
If R1 > -1 Then RPM = Round(R1 / RPMDivider * 60, 1)
If S1 > -1 Then WSpeed = Round(S1 / WSDivider, 1)
Watts = Round(BattVolt * BattAmps, 2)
If Timer1.Enabled = True Then
If BattVolt > AvgBattVolt Then AvgBattVolt = BattVolt
If BattAmps > AvgBattAmps Then AvgBattAmps = BattAmps
If RPM > AvgRPM Then AvgRPM = RPM
If WSpeed > AvgWSpeed Then AvgWSpeed = WSpeed
If Watts > AvgWatts Then AvgWatts = Watts
End If
ListView1.ListItems.Clear
Set itmAdd = ListView1.ListItems.Add()
itmAdd.SubItems(1) = BattVolt
itmAdd.SubItems(2) = "Volts"
Set itmAdd = ListView1.ListItems.Add()
itmAdd.SubItems(1) = BattAmps
itmAdd.SubItems(2) = "Amps"
Set itmAdd = ListView1.ListItems.Add()
itmAdd.SubItems(1) = Watts
itmAdd.SubItems(2) = "Watts"
Set itmAdd = ListView1.ListItems.Add()
itmAdd.SubItems(1) = Round(WattHours, 1)
itmAdd.SubItems(2) = "WattHours"
If DisplayRPM = 1 Then
Set itmAdd = ListView1.ListItems.Add()
itmAdd.SubItems(1) = RPM
itmAdd.SubItems(2) = "RPM"
End If
If DisplayWS = 1 Then
Set itmAdd = ListView1.ListItems.Add()
itmAdd.SubItems(1) = WSpeed
itmAdd.SubItems(2) = WSUnits
End If

If Mode = 1 Then txtMode.Caption = "On Load" Else txtMode.Caption = ""
PicAxeLogger.Caption = "PicLog " & BattVolt & "V " & BattAmps & "A"
End If
End Sub

It has better data validity checking.

You program works OK on my PC's. I dug up my old PicLog this morning and connected it to a variable power supply and a old WinXP pc.

Glenn
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
windman1000
Regular Member

Joined: 21/06/2009
Location: United States
Posts: 91
Posted: 10:59pm 05 Jun 2010
Copy link to clipboard 
Print this post

Thanks Glenn Il Change These SUBs , but i dont get any errors now so if i dont get any after this im not sure if its fix for everyone yet, il post new download if i dont gets errors.
 
windman1000
Regular Member

Joined: 21/06/2009
Location: United States
Posts: 91
Posted: 11:16pm 05 Jun 2010
Copy link to clipboard 
Print this post

Heres The Newest Fix? I change the Sub MSComm1_OnComm() That Glenn Posted Above And They Still Work For Me No errors, So See If It Erros For Any Of You Guys.
And i Noticed the Amp Meter Neddle Was To low In The Center So i Fix That To.
2010-06-06_091652_Meter2.zip
 
Downwind

Guru

Joined: 09/09/2009
Location: Australia
Posts: 2333
Posted: 03:48am 06 Jun 2010
Copy link to clipboard 
Print this post

Hi Windman,

Your latest zip file will now load for me and not crash.

BUT...i get no data comming through to the display windows with the meters.

I can see the data in calibration window and it is correct but it dont show onto the main window??

I have several other versions of piclog here and they all show the data but not on yours.

I think you must have disabled something.

One change you might want to make to your meters is in volts, to increase it to 240 as for example, if you were to log a house power consumption as i am, it would need to read to 240 volt.

Pete.
Sometimes it just works
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5078
Posted: 04:39am 06 Jun 2010
Copy link to clipboard 
Print this post

Hey pete could you try this one. Its got the updated com routine, but in the original piclog.
2010-06-06_143748_PicLog2.zip
Also, have you modified the PicAxe code to send any more data that normal? A normal data string is about 50 characters long, this new routine will reject anything over 55 characters as a invalid string.

Glenn
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
windman1000
Regular Member

Joined: 21/06/2009
Location: United States
Posts: 91
Posted: 04:55am 06 Jun 2010
Copy link to clipboard 
Print this post

Pete If you could try the (Merter) Update It Was The Second One I updated, As For The 240 volt meter il make that meter and we will try to get this logger to work for everyone ( I would like to have it almost bug free) Then il release the Sorce file with any other meter changes that you guys would like.

WINDMAN1000
 
Downwind

Guru

Joined: 09/09/2009
Location: Australia
Posts: 2333
Posted: 05:02am 06 Jun 2010
Copy link to clipboard 
Print this post

Hi Glenn,

No it wont work for me.

I did have a check sum in the data string but removed it and still no go.

The string is now..............

[code]sertxd("[[<V>" ,#volt, "</V> <I>", #Amp ,"</I> <R>" ,#RPM, "</R> <S>",#Wind, "</S> ]",13,10)[/code]

I can see the data comming in in the calibration window but it will not display on screen.

I must do a add up as i do use words for the variables.

Pete.
Sometimes it just works
 
Downwind

Guru

Joined: 09/09/2009
Location: Australia
Posts: 2333
Posted: 05:13am 06 Jun 2010
Copy link to clipboard 
Print this post

Windman,

I tried you 2nd zip as asked, and it works a little better as the meters move and after a short time it crashes with runtime error 5. I dont even get to complete calibration before it crashes.

Pete.
Sometimes it just works
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5078
Posted: 07:00am 06 Jun 2010
Copy link to clipboard 
Print this post

Hey Pete could you try this one.
2010-06-06_165418_PicLog3.zip

I've made a couple of changes.
1. Broken the MSComm routine into a sub and function. That should help with slower computers that cant process the data before the next byte is recieved on the com port.
2. Improved the filtering of the data stream to remove leading and trailing bytes from the main block of data we want to parse, between the [ and ].


Sub MSComm1_OnComm()
Static ReceiveBuffer As String
ReceiveBuffer = ReceiveBuffer & MSComm1.Input
MSComm1.InBufferCount = 0
If InStr(ReceiveBuffer, "[") > 0 And InStr(ReceiveBuffer, "]") > InStr(ReceiveBuffer, "[") Then
' I think we have a complete block, pass it on and get back to receiving data from the com port.
temp = ParseData(ReceiveBuffer)
ReceiveBuffer = ""
End If
End Sub

Private Function ParseData(PicData)
Timer2.Enabled = True
BlinkData.BackColor = &HFF&
' Remove data outside [ and first ]
PicData = Mid(PicData, InStr(PicData, "["))
PicData = Left(PicData, InStr(PicData, "]"))
' Set values to -1 as a flag that no data was parsed.
V1 = -1: V2 = -1: R1 = -1: Mode = -1: S1 = -1
' Parse tha data
If InStr(PicData, "<V>") > 0 And InStr(PicData, "</V>") > InStr(PicData, "<V>") Then temp1 = Mid(PicData, InStr(PicData, "<V>") + 3, InStr(PicData, "</V>") - InStr(PicData, "<V>") - 3)
If IsNumeric(temp1) Then V1 = temp1
If InStr(PicData, "<I>") > 0 And InStr(PicData, "</I>") > InStr(PicData, "<I>") Then temp2 = Mid(PicData, InStr(PicData, "<I>") + 3, InStr(PicData, "</I>") - InStr(PicData, "<I>") - 3)
If IsNumeric(temp2) Then V2 = temp2
If InStr(PicData, "<R>") > 0 And InStr(PicData, "</R>") > InStr(PicData, "<R>") Then temp3 = Mid(PicData, InStr(PicData, "<R>") + 3, InStr(PicData, "</R>") - InStr(PicData, "<R>") - 3)
If IsNumeric(temp3) Then R1 = temp3
If InStr(PicData, "<M>") > 0 And InStr(PicData, "</M>") > InStr(PicData, "<M>") Then temp4 = Mid(PicData, InStr(PicData, "<M>") + 3, InStr(PicData, "</M>") - InStr(PicData, "<M>") - 3)
If IsNumeric(temp4) Then Mode = temp4
If InStr(PicData, "<S>") > 0 And InStr(PicData, "</S>") > InStr(PicData, "<S>") Then temp5 = Mid(PicData, InStr(PicData, "<S>") + 3, InStr(PicData, "</S>") - InStr(PicData, "<S>") - 3)
If IsNumeric(temp5) Then S1 = temp5
' If data not flaged, do the maths
If V1 > -1 Then BattVolt = Round(V1 / VoltDivider, 2)
If V2 > -1 Then BattAmps = Round((V2 - VoltOffset) / AmpDivider, 2)
If R1 > -1 Then RPM = Round(R1 / RPMDivider * 60, 1)
If S1 > -1 Then WSpeed = Round(S1 / WSDivider, 1)
Watts = Round(BattVolt * BattAmps, 2)
' Log it
If Timer1.Enabled = True Then
If BattVolt > AvgBattVolt Then AvgBattVolt = BattVolt
If BattAmps > AvgBattAmps Then AvgBattAmps = BattAmps
If RPM > AvgRPM Then AvgRPM = RPM
If WSpeed > AvgWSpeed Then AvgWSpeed = WSpeed
If Watts > AvgWatts Then AvgWatts = Watts
End If
' Display it
ListView1.ListItems.Clear
Set itmAdd = ListView1.ListItems.Add()
itmAdd.SubItems(1) = BattVolt
itmAdd.SubItems(2) = "Volts"
Set itmAdd = ListView1.ListItems.Add()
itmAdd.SubItems(1) = BattAmps
itmAdd.SubItems(2) = "Amps"
Set itmAdd = ListView1.ListItems.Add()
itmAdd.SubItems(1) = Watts
itmAdd.SubItems(2) = "Watts"
Set itmAdd = ListView1.ListItems.Add()
itmAdd.SubItems(1) = Round(WattHours, 1)
itmAdd.SubItems(2) = "WattHours"
If DisplayRPM = 1 Then
Set itmAdd = ListView1.ListItems.Add()
itmAdd.SubItems(1) = RPM
itmAdd.SubItems(2) = "RPM"
End If
If DisplayWS = 1 Then
Set itmAdd = ListView1.ListItems.Add()
itmAdd.SubItems(1) = WSpeed
itmAdd.SubItems(2) = WSUnits
End If
If Mode = 1 Then txtMode.Caption = "On Load" Else txtMode.Caption = ""
PicAxeLogger.Caption = "PicLog " & BattVolt & "V " & BattAmps & "A"
End Function


Glenn


The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
Downwind

Guru

Joined: 09/09/2009
Location: Australia
Posts: 2333
Posted: 07:18am 06 Jun 2010
Copy link to clipboard 
Print this post

Hi Glenn,

IT WORKS !!!!!!

Who you calling and ...Old slow computer????

I also had a checksum in the string i tested it with, this did not effect to operation.

Hopefully thats 1 dead bug.

Pete.
Sometimes it just works
 
Downwind

Guru

Joined: 09/09/2009
Location: Australia
Posts: 2333
Posted: 08:08am 06 Jun 2010
Copy link to clipboard 
Print this post

Ok tested Glenns revised piclog on a 12v computer i have that is from the 98 series now running XP.

Its a Sloooow computer with the brains of an ant.

It work well for data logging and simple workshop monitoring.

The revised edition of piclog loaded and works well, where previous unmodfied versions of piclog would crash.

Although i have had several versions of piclog that would work but throught a 24 hour period they would generate a runtime error and crash.
This is regardless of the computer used....fast or slow.

Gordons latest developments in logging software has none of these problems, and has not crashed or recorded a data error in the weeks its been running.
Then he has started from scratch and no longer uses piclog in the software.

It will be good to have the choices of several viewing platforms that will all work with a standard picaxe data string as used in piclog.
I think it is good to retain this data format by all who develops a version of logging software.

This enables us to chop and change between sofware packages without the need to program the picaxe to suit different software.

Pete.

Sometimes it just works
 
     Page 1 of 2    
Print this page
© JAQ Software 2024