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 - aj2004

Pages: [1]
1
Open Discussion / ChartWithLogging Transparent Buttons
« on: June 16, 2021, 03:46:45 PM »
Hello,

When using ChartWithLogging on Windows 10, the buttons (and everything else) appear correctly with a light grey background. If I run the EXE in Windows 7, the buttons have a transparent background so they are the same colour as the MainForm background.

I also tried Visual Studio right in Windows 7 and even in the design window, the buttons show up with a transparent background. I have no idea where to change this. A basic button shows up with the correct background colour.

2 screenshots attached: Win7, and Win10

Thanks

2
Open Discussion / Boolean Values in Trend ChartWithLogging
« on: June 15, 2021, 01:28:00 PM »
Hello,

The ChartWithLogging Trend Chart works pretty well for me. INTs and REALs plot nicely. However, there are a couple issues I ran into. I searched for a solution and didn't find any posts with this issue. Maybe it's not common to plot things like photoeyes?

BOOLs do not plot at all. The values remain at 0 as shown in the top-left corner (showing the value range). This is because the value is stored as a "true" or "false" string rather than a "1" or "0". I was able to get a value by modifying the "ChartWithLogging.vb" file. Under "Private Sub PolledDataReturnedValue" inside the "While" loop just before the "Catch" condition, "tempValue" has obtained the tag's value of "true" or "false" (or some integer value as a string, but this code just catches boolean values). I added (between the .....):

Code: [Select]
Try
  tempValue = m_PLCAddressValueItems(index).GetScaledValue(e.Values(i))
.....

  If String.Compare(tempValue, "true", True) = 0 Then
    tempValue = CStr(m_PLCAddressValueItems(index).ScaleFactor + m_PLCAddressValueItems(index).ScaleOffset)
  ElseIf String.Compare(tempValue, "false", True) = 0 Then
    tempValue = CStr(m_PLCAddressValueItems(index).ScaleOffset)
  End If

.....
Catch ex As Exception
  tempValue = "," & "INVALID - Check scale factor/offset - " & e.Values(i)
End Try


This will use the "ScaleFactor" and "ScaleOffset" values in the tags list to plot a BOOL between "Offset" and "Offset + Scale".

I haven't looked into it yet, but I think that Integer/Float values are not scaled/offset for this type of Trend Chart. It would be easy enough to add that functionality in.

Maybe there is a better place to put this code. I'm not that great with coding, but this seems to work ok.

File "ChartWithLogging.vb" attached. New code at line 379

Pages: [1]