AdvancedHMI Software
General Category => Support Questions => Topic started by: bachphi on November 24, 2015, 10:05:02 AM
-
I am using 3.99a and wanted to use Time on X axis, so I changed XValueType to Time, but it only display 12:00AM over and over. How do I fix this? Thanks in advance.
-
http://advancedhmi.com/forum/index.php?topic=828.0
Here is a thread on how to get the time to display correctly, I changed the code in the chart to this
line 226
MyBase.Series(index).Points.AddXY(Now.ToLongTimeString, CDbl(m_PLCAddressItems(index).GetScaledValue(e.PLCComEventArgs.Values(0))))
Jody
-
Yes, I did check the thread. Did you really have it working? On my system it was line 225, it compiled w/o error , but running the app will get an exception:
************** Exception Text **************
System.FormatException: Input string was not in a correct format.
at Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat)
at Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String Value, NumberFormatInfo NumberFormat)
-
I just commented out line 225 and copy paste which became line 226. that is the exact code I used. copied from my app what version of studio are you using I am using community 2015
jody
-
I am using VS Community 2015 & AAHMI399a
-
I setup a new AAHMI399a, add a PLC driver, add a ChartBySampling, Set the MaximumActivePoints , Add a PLC address to PLCAddressItems, tested working .
Next I goto series and set its XValueType to Time. and open ChartBySampling.vb line 225 and change it to:
MyBase.Series(index).Points.Add(Now.ToLongTimeString, CDbl(m_PLCAddressItems(index).GetScaledValue(e.PLCComEventArgs.Values(0))))
Run it again. Error with InvalidCastException wsa unhanldled by user code. Conversion from string "11:09:26 AM" to type 'Double' is not valid.
-
Found my mistake. It needs to be AddXY