Recent Posts

Pages: [1] 2 3 ... 10
1
Support Questions / Re: Emailer send values
« Last post by Godra on February 19, 2018, 11:13:12 PM »
2
Support Questions / Emailer send values
« Last post by g.mccormick on February 19, 2018, 09:58:25 PM »
I seemingly have the emailer working to send an email to my gmail account.  I would like to include  values in the email message.  I am using modbustcp comms.  How can I send the value of a modbus register or two included in my email message?
3
Open Discussion / Re: “AdvancedHMIModbusToExcel” example
« Last post by Archie on February 19, 2018, 08:55:42 PM »
Did you check the Excel file in the bin\Debug directory?
4
Support Questions / Re: Determine structure of UDT at runtime? (ClxDriver 1.2.3.0)
« Last post by Archie on February 19, 2018, 08:33:10 PM »
Retrieving UDT definition is a 3 step process:

1) Read ALL tags ( this can take several minutes on a large program)
2) From the Instance ID, retrieve the symbol type (UDT)
3) From the symbol type information, read the template (UDT) member information 

The current driver only supports reading all of the tags. In a future version, more generic CIP control will be added to execute the services for steps 2 and 3
5
Tips & Tricks / Re: Raspberry Pi as Serial to Ethernet adapter
« Last post by Godra on February 19, 2018, 07:43:41 PM »
bachphi,

Have you tried using Mono serial DF1 driver from this topic: http://advancedhmi.com/forum/index.php?topic=1975.0


Also, for those who might be interested, here is a link to slightly different SerialToIPGUI VB Net version (modified for testing MicroLogix 1100 with SerialDf1overTcpForSLCMicroCom driver):

https://www.dropbox.com/s/u3piczzjm0tfuzb/SerialToIPGUI%20VBNet.7z?dl=0
6
Support Questions / Re: rotational indicator arrow
« Last post by Godra on February 19, 2018, 05:38:14 PM »
You could possibly try using these properties (modify or replace the existing Value property):

Code: [Select]
    Private m_string As String = "0" & "°"
    Private m_Value As Double = 0.0F
    <Browsable(True), RefreshProperties(RefreshProperties.All), _
    Description("Indicates the actual received arrow angle value in degrees. It could be any double-precision floating point value."), DefaultValue(0.0F)> _
    Public Property Value() As Double
        Get
            Return Me.m_Value
        End Get
        Set(ByVal value As Double)
            If Me.m_Value <> value Then
                Me.m_Value = value
                OnValueChanged(System.EventArgs.Empty)
                Me.Invalidate()
            End If
        End Set
    End Property

    Private m_ValueScaleFactor As Double = 1.0F
    <Browsable(True), RefreshProperties(RefreshProperties.All), Description("Value scale factor."), DefaultValue(1.0F)> _
    Public Property ValueScaleFactor As Double
        Get
            Return m_ValueScaleFactor
        End Get
        Set(value As Double)
            If value <= 0 Then value = 1
            If m_ValueScaleFactor <> value Then
                m_ValueScaleFactor = value
                Me.Invalidate()
            End If
        End Set
    End Property

and then modify the OnPaint sub, in the Events region, to look like this (or just replace it):

Code: [Select]
    Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
        MyBase.OnPaint(e)

        '* Prevent an exception if RefreshImage was not called
        If ForeColorBrush Is Nothing Then Exit Sub

        e.Graphics.SmoothingMode = SmoothingMode.HighQuality

        '* Static Back Image
        e.Graphics.DrawImage(BackImage, 0, 0)


        If Not String.IsNullOrEmpty(Me.Text) Then
            e.Graphics.DrawString(Me.Text, Me.Font, ForeColorBrush, New Point(CInt(Me.Width / 2.0F), CInt(Me.Height * 0.55)), sf)
        End If

        '*************************************
        '* Draw the Arrow
        '*************************************
        e.Graphics.TranslateTransform(CSng(Me.ClientRectangle.Width) / 2.0F, CSng(Me.ClientRectangle.Height) / 2.0F)
        e.Graphics.RotateTransform(CSng(Me.m_Value * m_ValueScaleFactor - CSng(Me.m_zeroPosition)))
        e.Graphics.TranslateTransform(-CSng(Me.ClientRectangle.Width) / 2.0F, -CSng(Me.ClientRectangle.Height) / 2.0F)

        e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
        e.Graphics.FillEllipse(ArrowGradientBrush, CurvedArrowBottomBounds)
        e.Graphics.FillPolygon(ArrowGradientBrush, ArrowPoints)

        '***************************************
        e.Graphics.ResetTransform()

        Me.m_string = String.Format(CStr(CDec(Me.m_Value * m_ValueScaleFactor) Mod CDec(360.0F)), "0") & "°"
        e.Graphics.DrawString(Me.m_string, Me.Font, ForeColorBrush, New Point(CInt(Me.Width / 2.0F), CInt(Me.Height * 2.0F / 3.0F)), sf)
    End Sub

Do observe all locations of the "°" character in case if you wanted it to be "%".
7
Support Questions / Re: DataSubscriber2 values
« Last post by Archie on February 19, 2018, 04:21:02 PM »
When you add multiple items to a DataSubscriber2 item list, they will each return on their own event. To perform math on multiple values, you will need to store them locally something like this:

Private Var1, Var2 as string
Private Sum as string

Private DataChangedEvent ..........
    If e.ErrorID= then
       If e.PLCAddress="40001" then
             Var1=e.Values(0)
       ElseIf e.PLCAddress="40001" then
              Var2=e.Value(0)
       End if
    End IF

    If NOT String.IsNullOrEmpty(Var1) and NOT String.IsNullOrEmpty(Var2) then
          Sum=Cint(Var1) + Cint(Var2)
    End If
End Sub
8
Support Questions / Re: rotational indicator arrow
« Last post by MrPike on February 19, 2018, 03:14:03 PM »
Hello again.  I have this working for the most part except I don't see a scale value for this control.  How would I implement this? thank you.  I have tried this code but it does not work. 

'scale the value from raw
    Private Sub rotindSynchscope_ValueChanged(sender As Object, e As EventArgs) Handles rotindSynchscope.ValueChanged
        rotindSynchscope.Value = rotindSynchscope.Value * 0.01
    End Sub
9
Support Questions / DataSubscriber2 values
« Last post by MrPike on February 19, 2018, 03:11:36 PM »
Hey Archie, can you tell me if I can access the two items in the collection of PLC addresses of the DS2 at the same time?  What I mean is I add addr 1-4 to the collection and I want to do some math of two of the elements such as addr1/addr2 on DS2 value change event.  Is this possible?  How do I access each element to do this?  Thank you.   
10
Open Discussion / “AdvancedHMIModbusToExcel” example
« Last post by larryhts on February 19, 2018, 11:38:19 AM »
I just downloaded the “AdvancedHMIModbusToExcel” and ran the app and got a good read from the PLC and when I click the “write to spreadsheet” button it says that it was successfully written to Excel File” But no entries in the file?????????
Pages: [1] 2 3 ... 10