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

Pages: [1] 2
1
Support Questions / Re: Testing PLC connection without using a ping command
« on: February 09, 2016, 01:48:50 PM »
Thank you both for your suggestions. It seems like the try catch is more effective in preventing my program from crashing when a disconnect occurs. I'll keep in mind the watchdog timer and try to find the best way to implement it into my project. Thanks again for your help and I'll post again if I have any trouble

2
Support Questions / Testing PLC connection without using a ping command
« on: February 09, 2016, 08:47:50 AM »
Hello all,

I am running into issues with my current project when it comes to checking the connection state of my PLC. I am currently using the ping command to ping the IP address of the PLC but that just checks if the PLC is on the network, not if the PLC is actually online and ready to send/receive data. Obviously, this causes exceptions as I currently have reads and writes happen only when the PLC is on the network. Is there a way through AdvancedHMI to check if a PLC is ready for data as opposed to if it is connected to a network? Here is a sample of what I currently use just for reference.

If My.Computer.Network.Ping(plcIP) = True Then
            outputDataReals = EthernetIPforCLXCom1.Read("HMIIO.Input[0]", 500)
            inputDataReals = EthernetIPforCLXCom1.Read("HMIIO.Output[0]", 500)
            outputDataBits = EthernetIPforCLXCom1.Read("HMIIO.InputBits[0]", 500)
            inputDataBits = EthernetIPforCLXCom1.Read("HMIIO.OutputBits[0]", 500)

            outputDataRealsBuffer = EthernetIPforCLXCom1.Read("HMIIO.Input[0]", 500)
            outputDataBitsBuffer = EthernetIPforCLXCom1.Read("HMIIO.InputBits[0]", 500)
        Else
            plcStatus = "Connection Lost"
            Label1.Visible = True
            Label1.Text = plcStatus
            Label1.BackColor = Color.Red
        End If

Thank you in advance for any help or advice,

Fuzydragon

3
Support Questions / Re: EthernetIP Read Array of Strings
« on: February 04, 2016, 02:08:26 PM »
Thanks for the quick response. I see what I was doing wrong, my variables were just strings not string(). It's always the little things. Thanks again

4
Support Questions / Re: EthernetIP Read Array of Strings
« on: February 04, 2016, 01:09:17 PM »
I am using a standard string data with the PLC

5
Support Questions / EthernetIP Read Array of Strings
« on: February 04, 2016, 08:57:26 AM »
Hello All,

I was curious if the EthernetIPforCLXCom1.Read command could read string values stored in arrays inside the PLC. I'm trying to compose different kinds of emails depending on different situations using the read command and the most I'm getting are numbers like 21516. I am currently using AdvancedHMI v 399a. Thanks in advance for any help.


Fuzydragon

6
I have been curious about this as well. I've been trying to write booleans to a PLC but I keep getting an error that and index is overflowing. I can only assume it is from not properly writing the boolean in the first place. How would someone go about doing this?

7
Support Questions / Re: Show Historical Data with ChartBySampling
« on: December 09, 2015, 09:33:47 AM »
Thanks for the quick reply. This seems like it would be easier to work with then the solution I scrounged up. I created another solution by using the following code under a FormClosing action:

If e.CloseReason = CloseReason.UserClosing Then
      e.Cancel = True
      Me.Hide()
End If

Thank you again for the quick reply.

8
Support Questions / Show Historical Data with ChartBySampling
« on: December 08, 2015, 09:43:37 AM »
Hello all,

I have a ChartBySampling up and running in my code and it works just fine with the PLC addresses I have put into it. However, whenever I close the form that has the graph in it and reopen it, the data that was previously collected was gone and it started over from scratch again. I need to keep that data in the graph because we need to see days worth of data on this graph. Is there a way to have the graph open and close while still having it record data for however long the graph is open?

9
Open Discussion / Re: Adding and Removing PLC Addresses in ChartBySampling
« on: December 07, 2015, 02:06:32 PM »
That makes sense to me. I was thinking of adding a data subscriber and looking at the values of the PLC addresses that way. From what you've given me and my own experimentation, I should be able to find a way to add Addresses based on their values. Thanks for your help and I'll check in if I get stuck again.

10
Open Discussion / Re: Adding and Removing PLC Addresses in ChartBySampling
« on: December 07, 2015, 01:28:21 PM »
Thanks rbelknap for the quick response.

WIth what you've shown me, I definitely have some good starting points. I just have one question: Do you know if you can remove a PLC address from  the collection based on the value inside of the PLC address? I see there is a .Remove function for removing an item from a collection, I just want to use it to remove Addresses that are not connected to thermocouples and are giving off gibberish


Thanks again for your help 

11
Open Discussion / Adding and Removing PLC Addresses in ChartBySampling
« on: December 07, 2015, 11:02:49 AM »
I am trying to write code for a real time data chart for a large array of Thermocouples (120 to be exact). I want to show the temperatures that they are reading separately but the catch is that I don't want to show data for PLC Addresses that may not have a thermocouple input. For example, if there are only 25 thermocouples plugged in, I only want to show the first 25 as they will show real data, the rest will be some weird other number.

Is there a way to run an If loop or some form of logic to have something look at the value of all 120 PLC address and if it's in a certain range add it into the collection? I've tried using the ChartBySample1.PLCAddressItems.Add command but I don't think I'm entering the right arguments for it.

Thanks in advance for any help or advice you can give.


12
Open Discussion / Creating a label to show real time data
« on: November 10, 2015, 09:56:21 AM »
I am currently working on a screen that will show data being captured in real time (or as close to that as I can get). What I have so far is a List box that contains all of the Addresses and a function that changes a Label based on which address is chosen. I also have a timer running to update the read every second. I am using the EthernetIPforMicro800Com driver set to the IP of the test PLC. The generic label text works fine but I can't get the variable holding the real time data to show.  Though I'm not entirely sure where the issue is, I believe I'm running into an issue with my code reading my PLC Addresses. I will paste what I have below. Thank you in advance for any help or advice.

Public Class ThermocoupleScreen
    Public ThermoData(140) As String
    Public Sub ThermocoupleScreen_Load(sender As Object, e As EventArgs) Handles Me.Load
        Dim StringToAdd As String
        For count As Integer = 1 To 120
            StringToAdd = "DAQThermocouples[" + count.ToString + "]"
            ListBox1.Items.Add(StringToAdd)
        Next
        For x As Integer = 1 To 120
            EthernetIPforMicro800Com1.BeginRead("DB.CURRENT.dataPoints[" & x.ToString & "]", 1)
        Next
    End Sub


    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        Timer1.Interval = 1000
        Label2.Text = "Ticking"
        For y As Integer = 1 To 120
            EthernetIPforMicro800Com1.Read("DB.CURRENT.dataPoints[" & y.ToString & "]", 1)
        Next

    End Sub


    Private Sub EthernetIPforMicro800Com1_DataReceived(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles EthernetIPforMicro800Com1.DataReceived
        If e.PlcAddress = "DB.CURRENT.dataPoints[1]" Then
            ThermoData(0) = e.Values(0)
        End If
        If e.PlcAddress = "DB.CURRENT.dataPoints[2]" Then
            ThermoData(1) = e.Values(0)
        End If
        If e.PlcAddress = "DB.CURRENT.dataPoints[3]" Then
            ThermoData(2) = e.Values(0)
        End If
    End Sub


    Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBox1.SelectedIndexChanged
        For z As Integer = 0 To 119
            Label1.Text = ListBox1.SelectedItem.ToString + " is " + ThermoData(z) + " Deg. C"
        Next

    End Sub
End Class

13
OK I see my issue with the read portion. Thank you for the quick response.

14
I'm currently working on a way to read multiple PLC Addresses in a single call as opposed to individually stating each Address (because I have a lot of addresses to read). The code I have so far looks like this: Inside a ButtonClick trigger I have the driver read the addresses and create the array

 For x As Integer = 1 To 120
            EthernetIPforMicro800Com1.BeginRead("DAQThermocouple[" & x.ToString & "].in1", 120)
            EthernetIPforMicro800Com1.BeginRead("DAQThermocouple[" & x.ToString & "].in2", 120)
            EthernetIPforMicro800Com1.BeginRead("DAQThermocouple[" & x.ToString & "].in3", 120)
            EthernetIPforMicro800Com1.BeginRead("DAQThermocouple[" & x.ToString & "].out1", 120)
            EthernetIPforMicro800Com1.BeginRead("DAQThermocouple[" & x.ToString & "].out2", 120)
            EthernetIPforMicro800Com1.BeginRead("DAQThermocouple[" & x.ToString & "].out3", 120)
 Next

Then when data is received I use this piece of code

 Private Sub EthernetIPforMicro800Com1_DataReceived(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles EthernetIPforMicro800Com1.DataReceived

        For x As Integer = 1 To 120
            If e.PlcAddress = "DAQThermocouple[" & x.ToString & "].in1 " Then
                For index As Integer = 0 To 119
                    CalDataToLog(index) = e.Values(index)
                Next
            End If

            If e.PlcAddress = "DAQThermocouple[" & x.ToString & "].in2" Then
                For index As Integer = 131 To 250
                    CalDataToLog(index) = e.Values(index)
                Next
            End If

            If e.PlcAddress = "DAQThermocouple[" & x.ToString & "].in3" Then
                For index As Integer = 262 To 381
                    CalDataToLog(index) = e.Values(index)
                Next
            End If

            If e.PlcAddress = "DAQThermocouple[" & x.ToString & "].out1" Then
                For index As Integer = 393 To 512
                    CalDataToLog(index) = e.Values(index)
                Next
            End If

            If e.PlcAddress = "DAQThermocouple[" & x.ToString & "].out2" Then
                For index As Integer = 524 To 643
                    CalDataToLog(index) = e.Values(index)
                Next
            End If

            If e.PlcAddress = "DAQThermocouple[" & x.ToString & "].out3" Then
                For index As Integer = 655 To 774
                    CalDataToLog(index) = e.Values(index)
                Next
            End If
        Next
End Sub

None of this actually catches the data though. I think it may be a problem with reading the PLC Addresses initially but I'm not sure.

Thanks in advance for any advice or help

15
Support Questions / Re: Email Client With Multiple Addresses
« on: October 06, 2015, 09:05:54 AM »
OK I see what you're talking about. I was missing the New System.Net.mail.MailAddress part of the command. Thanks for the quick response

Pages: [1] 2