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

Pages: [1]
1
Support Questions / Re: DCOM Hardening Concerns
« on: May 31, 2022, 02:39:30 PM »
Thank you verifying for me!

2
Support Questions / List member names of a data type
« on: March 31, 2020, 11:28:03 AM »
I have a user defined data type that has a large number of members.  Is it possible to get a list of the members names?

I would like to be able to export this list to a spreadsheet.

I have found that I can list tags using the following, but that doesn't give me a way to list the members within a UDT tag.

 Dim CLXTag() As MfgControl.AdvancedHMI.Drivers.CLXTag
CLXTag = _EthernetCommsMain.GetTagList()


Thanks!!

3
Support Questions / Re: Single Character strings
« on: February 11, 2020, 10:54:23 AM »
That helped!
Thanks!

4
Support Questions / Single Character strings
« on: February 07, 2020, 04:45:12 PM »
We have a PLC tag that is defined as a String1 which has a max character of 1

How do I write to this tag?
When I try to do a
Write(String.Format("Q3_Pan[0].Part.Type.Code", "x")

I get the following error
MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException: 'Unknown data type. Unable to create byte stream. 50345'


Thanks

5
Support Questions / ReadUDT with array
« on: February 04, 2020, 12:00:15 PM »

We are trying to use the ReadUDT function in AdvancedHMIv399yBeta33.
The image shows our test UDT in the PLC called TIme.

We have a class setup in vb.net as follows
Public Class TimeUDT
        Public Property Yr As Int32
        Public Property Mo As Int32
        Public Property Da As Int32
        Public Property Hr As Int32
        Public Property Min As Int32
        Public Property Sec As Int32
        Public Property uSec As Int32
        Public Property double_str As String
        Public Property single_str As String
    End Class

When we execute the code

Dim objT As TimeUDT
 objT = _EthernetCommsMain.ReadUDT(Of TimeUDT)("time")

We get data filling the properties but run into a problem with double_str.  It is an array in the UDT. 

How do we setup our class so that it can handle the array?

Thanks for the help!


6

I have created a DLL that does the PLC work and is called from a "Main" application.
I feel like I need to close or dispose the  EthernetIPforSLCMicroCom PLC driver.
I tried using "USING/End USING" instead of Dim to create "EthernetCommsSLCL3" and also "EthernetCommsSLCL3.CloseConnection()" but doth seemed to stop the communications permanently.
Do you have any advice? (Sorry for the lengthy code, I wanted to be sure everything was there for clarification)
Thanks!!!
Also, is there a way to format my code when I post it?
------------------------------------------------------------------------------



    'L3  Variables
    Dim tmrL3 As New System.Timers.Timer
    Dim PLCAddressL3 As String = "10.124.233.16"
    'Dim SLCBitToReadL3 As String = "B21:2/4"
    Dim SLCIntToReadL3 As String = "N7:200"
    Dim SLCBitToWrite1L3 As String = "B21:2/5"
    Dim SLCBitToWrite2L3 As String = "B21:2/6"
    Dim SLCHeartbeatBitL3 As String = "B21:2/7"
    'PLCAddress-PLC IP ADDRESS
    'SLCBitToRead-Label Applied
    'SLCBitToWrite1-Stop RollFormer
    'SLCBitToWrite2-Start RollFormer
    'SLCHeartbeatBit-Monitor Communications B/W APP and PLC
    Dim MachineRunning As Boolean
    Dim MachineNotRunning As Boolean
    Public BitWrittenStartL3 As Boolean
    Public BitWrittenStopL3 As Boolean
    Public MachineStatusL3 As Int32 = 0
    Dim MachineStatusChangedL3 As Int32 = 0
    Dim HeartbeatL3 As Boolean

_____________________________________________________________
    Public Sub initializeTimerL3()
        tmrL3.Interval = 1500
        tmrL3.Enabled = True
        AddHandler tmrL3.Elapsed, AddressOf tmr_elapsedL3

        Using writer As New StreamWriter(Application.StartupPath & "\SLC_DLL Diagnostic Log" &
                                    System.DateTime.Now.ToString("yyyyMMdd") & ".log", True, System.Text.Encoding.ASCII)
            writer.WriteLine(vbCrLf & DateAndTime.Now & vbCrLf & "Status:L3 DLL initialized by main app")
            writer.Close()
        End Using

    End Sub
______________________________________________________________

    'These functions will be called from the print application to start and stop the machine. If the variables are in the correct state, the PLC
    'tag will be written And the VB variable immediately turned off.
    'If the variables are "stuck" on for some reason, they are turned off and the correct variable set
    'The "returned" variable is feedback to the main application.
    Public Function MachineOn() As Boolean

        'NOTE:This is how to call this function from another class
        'mainObj.MachineOn()

        Using writer As New StreamWriter(Application.StartupPath & "\SLC_DLL Diagnostic Log" &
                                     System.DateTime.Now.ToString("yyyyMMdd") & ".log", True, System.Text.Encoding.ASCII)
            writer.WriteLine(vbCrLf & DateAndTime.Now & vbCrLf & "Status:L3 Machine Started Function Active in DLL")
            writer.Close()
        End Using

        'Checks and sets appropriate variables in preperation for writing the "ON" signal to the PLC
        If BitWrittenStartL3 = False And BitWrittenStopL3 = False Then
            BitWrittenStartL3 = True
            MachineRunning = True
        Else
            'Resets variables
            BitWrittenStartL3 = False
            BitWrittenStopL3 = False
            'Sets correct state
            BitWrittenStartL3 = True
            MachineRunning = True
        End If
        Return MachineRunning


    End Function
_________________________________________________________

    Public Function MachineOff() As Boolean

        Using writer As New StreamWriter(Application.StartupPath & "\SLC_DLL Diagnostic Log" &
                                       System.DateTime.Now.ToString("yyyyMMdd") & ".log", True, System.Text.Encoding.ASCII)
            writer.WriteLine(vbCrLf & DateAndTime.Now & vbCrLf & "Status:L3 Machine Stopped Function Active in DLL")
            writer.Close()
        End Using

        'Checks and sets appropriate variables in prep for writing the "OFF" signal to the PLC
        If BitWrittenStopL3 = False And BitWrittenStartL3 = False Then
            BitWrittenStopL3 = True
            MachineNotRunning = True
        Else
            'Resets variables
            BitWrittenStopL3 = False
            BitWrittenStartL3 = False
            'Sets correct state
            BitWrittenStopL3 = True
            MachineNotRunning = True
        End If
        Return MachineNotRunning

    End Function
_________________________________________________________


'This code runs continuously on a pulse after the DLL is started to update PLC info
    Public Sub tmr_elapsedL3()

        Try

            Dim EthernetCommsSLCL3 As New AdvancedHMIDrivers.EthernetIPforSLCMicroCom
            EthernetCommsSLCL3.IPAddress = PLCAddressL3
            EthernetCommsSLCL3.PollRateOverride = 1000


            'If Application Then sets BitWrittenStart To True, PLC will be updated With True Else False
            'BitWrittenStart set True will start the Rollformer
            If BitWrittenStartL3 = True Then
                EthernetCommsSLCL3.Write(SLCBitToWrite1L3, 1)

                Using writer As New StreamWriter(Application.StartupPath & "\SLC_DLL Diagnostic Log" &
                   System.DateTime.Now.ToString("yyyyMMdd") & ".log", True, System.Text.Encoding.ASCII)
                    writer.WriteLine(vbCrLf & DateAndTime.Now & vbCrLf & "Status:PLC START bit written to 1")
                    writer.Close()
                End Using

                BitWrittenStartL3 = False
            Else
                EthernetCommsSLCL3.Write(SLCBitToWrite1L3, 0)
            End If

            'If application sets BitWrittenStop to True, PLC will be updated with True else False
            'BitWrittenStop set True will stop the Rollformer
            If BitWrittenStopL3 = True Then
                EthernetCommsSLCL3.Write(SLCBitToWrite2L3, 1)

                Using writer As New StreamWriter(Application.StartupPath & "\SLC_DLL Diagnostic Log" &
                System.DateTime.Now.ToString("yyyyMMdd") & ".log", True, System.Text.Encoding.ASCII)
                    writer.WriteLine(vbCrLf & DateAndTime.Now & vbCrLf & "Status:PLC STOP bit written to 1")
                    writer.Close()
                End Using

                BitWrittenStopL3 = False
            Else
                EthernetCommsSLCL3.Write(SLCBitToWrite2L3, 0)
            End If

            'Machine Status value from PLC for reference in Print Application
            'TRIGGERED EVERY TIME THE TIMER COMPLETES
            MachineStatusL3 = EthernetCommsSLCL3.Read(SLCIntToReadL3)

            'If the machine status value changes, log that value to the diagnostic file
            If MachineStatusChangedL3 <> MachineStatusL3 Then
                MachineStatusChangedL3 = MachineStatusL3

                Using writer As New StreamWriter(Application.StartupPath & "\SLC_DLL Diagnostic Log" &
                System.DateTime.Now.ToString("yyyyMMdd") & ".log", True, System.Text.Encoding.ASCII)
                    writer.WriteLine(vbCrLf & DateAndTime.Now & vbCrLf & "Status:PLC status value changed to " & MachineStatusChangedL3 & vbCrLf _
                             & "(10=started     20=Stopped     30=Print App bypassed)")
                    writer.Close()
                End Using

            End If
            'Handshake to verify good communications between PLC and Application
            'TRIGGERED EVERY TIME THE TIMER COMPLETES
            HeartbeatL3 = EthernetCommsSLCL3.Read(SLCHeartbeatBitL3)
            If HeartbeatL3 = True Then
                EthernetCommsSLCL3.Write(SLCHeartbeatBitL3, 0)
            End If

            'EthernetCommsSLCL3.CloseConnection()



        Catch ex As Exception

            'create error/Status log and document exception or status with date and time
            'File is named with today's date to keep file sizes small
            Using writer As New StreamWriter(Application.StartupPath & "\SLC_DLL Diagnostic Log" &
                                    System.DateTime.Now.ToString("yyyyMMdd") & ".log", True, System.Text.Encoding.ASCII)
                writer.WriteLine(vbCrLf & DateAndTime.Now & vbCrLf & ex.ToString)
                writer.Close()
            End Using

        End Try

    End Sub


7
Support Questions / Re: Reading a single bit form a SLC500
« on: April 19, 2016, 04:18:00 PM »
Thanks Archie!
That helped me out!
I managed to get it working.

Private Sub xP2DataSubscriber_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles xP2DataSubscriber.DataChanged
If xP2DataSubscriber.Value = "True" Then

8
Support Questions / Reading a single bit form a SLC500
« on: April 18, 2016, 04:49:11 PM »
I need to trigger a SQL insert based on a bit in the PLC.
I can make everything function with a pushbutton, but I have not figured out way to monitor a bit.
I have a timer set up at a half second and the code will be within this "tick"


I am using the EthernetIPforSLCMicroCom driver and my bt is B11:0/13

My plan was to declare a boolean variable and read the value from the plc at the rate of the timer.
Then trigger the SQL insert if the variable was equal to 1
After closing the connection write back a 0 to the same location as a handshake to the PLC.
Any advise will be appreciated.

9
Support Questions / Re: Numeric KeyPad 2-Digit Limit
« on: March 18, 2016, 12:36:26 PM »
Good Grief, I can't believe that my eyes looked over that property!
Thanks

10
Support Questions / Numeric KeyPad 2-Digit Limit
« on: March 18, 2016, 12:22:04 PM »
I have used a basic.label to write number to a PLC integer location.
I want to limit the entry on the keypad to 2 digits or even better the digits 1-24.
Is there a way to configure this in the keypad properties?
Thanks


11
Support Questions / Re: SLC500 String Write
« on: March 17, 2016, 01:16:33 PM »
Godra,

When I started attempting to figure this out, I was using a label.
I was attempting to create a storage location for the VB string that needed to be sent to the PLC string location.
So, I declared "password" as a string location....at least I thought that was what I was doing.

I have it working very well now.
I will review the code that was offered also.

12
Support Questions / Re: SLC500 String Write
« on: March 17, 2016, 08:53:31 AM »
Godra,

I managed to get it working using a time. That was easy.
The only small issue I have is setting the autosize of the box to false.
When I do so, run the application, and click on the label, it minimizes the window to the toolbar at the bottom of my screen.
Not sure why this occurs, seem like a bug-perhaps in the software.

Thank you for your help.

13
Support Questions / Re: SLC500 String Write
« on: March 17, 2016, 08:21:18 AM »
A basic label does just as you mentioned, it writes to the PLC string location. 
Unfortunately, the basiclabel value property seems to determine what shows as text on the label.

I was able to use the following code when the form loads, and get the value from the PLC to display, but it only updates when the form loads.
I guess I am not sure how to get the displayed text continuously update to match the PLC

   Dim password As String

        password = EthernetIPforSLCMicroCom1.Read("st9:1")

                BasicLabel1.Text = password

14
Support Questions / SLC500 String Write
« on: March 16, 2016, 09:53:05 PM »
I'm new to Advanced HMI as of this week. Very nice.
I have been trying to write a string from a textbox to a SLC500 over ethernet to set up simple user access levels controlled by the PLC.
I started doing some research on the forum. I found a lot of comments about issues in the past versions.
Are there still issues with the new 3.99 version?

Any sample code available?

Thanks

Pages: [1]