AdvancedHMI Software
General Category => Tips & Tricks => Topic started by: Archie on June 18, 2015, 08:22:45 PM
-
This new control will plot a line (or lines) based on samples a register/tag/variable.
- Add a driver instance to the form and set the PollRateOverride to the desired sample rate
- Add a ChartBySampling
- Set the MaximumActivePoints to the number of points that will stay on the chart
- Add PLC addresses to PLCAddressItems. Each item added will be another series/line
- By default the first series is a bar chart. This can be changed by going to Series property and changing ChartType
-
Hi Archie,
Great app - thx for all your hard work!
Is there a way to make the X axis show the date/time that the sample was taken?
Thank you,
mcameron0980
-
You can go to Series (Collection), select Series1 or some other and set its XValueType to DateTime.
-
Thank you for looking into this Godra. Pls see attached for my output - not sure why I get the date offset and no time...
-
In addition to Godra's suggestionm you will need to edit AdvancedHMIControls\Controls\ChartBySampling.vb
Go to line 198 and change to this:
MyBase.Series(index).Points.AddXY(Now, CDbl(m_PLCAddressItems(index).GetScaledValue(e.PLCComEventArgs.Values(0))))
-
If you prefer a specific format then you could modify Archie's code to:
MyBase.Series(index).Points.AddXY(Now.ToString("dd-MMM-yy HH:mm:ss"), CDbl(m_PLCAddressItems(index).GetScaledValue(e.PLCComEventArgs.Values(0))))
or some other format as specified here:
https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.71).aspx
-
Hi,
Is there a way to configure the Y axis show the decimal
-
ChartBySampling1 -> ChartAreas -> Axes -> Y (Value) axis -> Label Style -> Format
Set to something like 0.00
-
My problem is this?
-
ChartBySampling1 -> PLCAddressItems -> select your item -> ScaleFactor -> 0.01
-
Here's my problem.
-
I just tried this, v3.98t with 40004 Modbus address and RSSim simulator, and it worked for me.
-
I can't seem to reproduce this in 3.98r ot 3.98t. Are you possibly on another localized language where it needs to be 0,01 instead of 0.01 (comma versus decimal)?
-
Thank you, Thank you, Thank you....
-
:)
-
HI,
Failed to win DICIMAL IN DATALOGGER,
I've tried everything
-
Try this
- Open AdvancedHMIControls\Components\BasicDataLogger2.vb
- Go to line 215 and edit the StoreValue to this:
Private Sub StoreValue()
Try
If Not m_PauseLogging Then
Dim StringToWrite As String = m_Prefix
If m_TimeStampFormat IsNot Nothing AndAlso (String.Compare(m_TimeStampFormat, "") <> 0) Then StringToWrite &= Date.Now.ToString(m_TimeStampFormat)
For Each item In PLCAddressValueItems
If item.ScaleFactor = 1 Then
StringToWrite &= "," & item.LastValue
Else
Try
StringToWrite &= "," & item.LastValue * item.ScaleFactor
Catch ex As Exception
StringToWrite &= "," & "INVALID-Check scale factor"
End Try
End If
Next
sw.WriteLine(StringToWrite)
sw.Flush()
End If
Catch ex As Exception
End Try
End Sub
-
THANK ARCHIE
-
I'm trying to develop software for PT100 temperature. Needed to keep temperatures taken, then release a report in XLS or PDF, but within a range of two dates and plot it.
ADVANCEDHMI, allowed to develop a part of it.
I HAVE THE GRAPHIC AND SAVED THE INFORMATION .LOG, missing TAKE information between two dates and graph it.
I would greatly appreciate develop so we can learn along the way.
Here's an example
-
Hi archi.
As I can do to make the ChartArea behave dynamically. because it is lost. Look at the picture, and I TREATY treaty and do not get it
-
Is this 2 ChartBySamplings or just one ?
-
one
-
I am using 3.99a and wanted to use Time , so I changed XValueType to Time, but it only display 12:00AM over and over. I went into line 225 and changed it to
MyBase.Series(index).Points.AddXY(Now.ToString("dd-MMM-yy HH:mm:ss"), CDbl(m_PLCAddressItems(index).GetScaledValue(e.PLCComEventArgs.Values(0))))
App would not run with new change. How do I fix this? TIA.
In addition to Godra's suggestionm you will need to edit AdvancedHMIControls\Controls\ChartBySampling.vb
Go to line 198 and change to this:
MyBase.Series(index).Points.AddXY(Now, CDbl(m_PLCAddressItems(index).GetScaledValue(e.PLCComEventArgs.Values(0))))
-
Hi good morning to all, I need some help with this control. I'm using 3.99 version. Anyone have an idea of how I can change the time of the reading of the chart? I want a read every ten minutes.
-
Hi good morning to all, I need some help with this control. I'm using 3.99 version. Anyone have an idea of how I can change the time of the reading of the chart? I want a read every ten minutes.
Change the communication drivers "PollRateOverride" property to 600000. Keep in mind that any other object tied to that driver will update at 10 minutes as well. If you have objects that need a faster update rate, then you can use separate drivers.
-
Hi Archie thanks again for all your hard work on this project. I am using the ChartBySampling and when I set the X axis to "Time" it only shows 12:00 A.M. on the chart in run time. I am using the latest version of software and it appears that the fix you suggested on line 198 in the code may not be relevant in the newer version. Any suggestions to get this part working?
Thanks!
-
I am using the ChartBySampling and when I set the X axis to "Time" it only shows 12:00 A.M. on the chart in run time. I am using the latest version of software and it appears that the fix you suggested on line 198 in the code may not be relevant in the newer version. Any suggestions to get this part working?
In Solution Explorer, under the AdvancedHMIControls project, expand down the controls folder and edit ChartBySampling.vb
Go to line 233 and modify it like this:
MyBase.Series(index).Points.AddXY(Now, CDbl(m_PLCAddressItems(index).GetScaledValue(e.PLCComEventArgs.Values(0))))