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.


Topics - bob1371

Pages: [1]
1
Support Questions / EPPLUS .dll error
« on: July 09, 2018, 12:01:30 AM »
Hello,


Working on a project and can't seem to get rid of this error.

I've updated the EPPLUS to latest version.
I've looked back through my previous post but still no luck.
If anyone could point me in right direction I would appreciate it.

Working on laptop with Win7 Pro 32 bit.

Thanks.

From Debug output window.
Code: [Select]
Prepare to Read Data
Data Has Been Read
Exception thrown: 'System.ArgumentException' in EPPlus.dll
The thread 0xc70 has exited with code 0 (0x0).
The thread 0x21ec has exited with code 0 (0x0).
The thread 0x27d0 has exited with code 0 (0x0).
The program '[12080] AdvancedHMI.exe' has exited with code 0 (0x0).


Here's everything in the Datasubscriber.

Code: [Select]
Private Sub DataSubscriber1_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataChanged
        If e.ErrorId = 0 AndAlso e.Values.Count > 0 AndAlso e.Values(0) = "True" Then

            Console.WriteLine(value:="Prepare to Read Data")
            '* Sets MyValues tags equal to PLC Tags
            Dim MyValues0 As String = EthernetIPforCLXCom1.Read("Station1_OperatorLog_Serial")
            Dim MyValues1 As String = EthernetIPforCLXCom1.Read("Station1_OperatorLog_Name")
            Dim MyValues25 As String = EthernetIPforCLXCom1.Read("TimeStamp")
            Dim MyValues8 As String = EthernetIPforCLXCom1.Read("MYD10")

            Console.WriteLine(value:="Data Has Been Read")



            '*Create Excel File & Transfer the Values to Excel

            '*Creates Excel file
            Using ExcelPackage As New OfficeOpenXml.ExcelPackage(New IO.FileInfo("C:\Users\Owner\Desktop\AdvancedHMIv399x\OP1Login.xlsx"))
                ExcelPackage.Workbook.Worksheets.Add(MyValues8)


                Console.WriteLine("ws creation ok")

                '*Writes the Headers in Row 1
                ExcelPackage.Workbook.Worksheets(MyValues0).Cells("A1").Value = "Part Serial Number"
                ExcelPackage.Workbook.Worksheets(MyValues1).Cells("B1").Value = "Operator Name"
                ExcelPackage.Workbook.Worksheets(MyValues25).Cells("C1").Value = "Date / Time Stamp"

                Console.WriteLine("header creation ok")

                ExcelPackage.Workbook.Worksheets(MyValues8).Cells("A1").AutoFitColumns()
                ExcelPackage.Workbook.Worksheets(MyValues8).Cells("B1").AutoFitColumns()
                ExcelPackage.Workbook.Worksheets(MyValues8).Cells("C1").AutoFitColumns()

                '*Loops to write data in correct columns
                For Index = 0 To MyValues0.Length - 1
                    Console.WriteLine("Element " & Index & "=" & MyValues0(Index))
                    Dim ws As OfficeOpenXml.ExcelWorksheet = ExcelPackage.Workbook.Worksheets(MyValues8)
                    Dim CellNum As String = "A" & (Index + 3)
                    ws.Cells(CellNum).Value = MyValues0(Index)
                Next

                '*For Index = 0 To MyValues1.Length - 1
                '*Console.WriteLine("Element " & Index & "=" & MyValues1(Index))
                '*Dim ws As OfficeOpenXml.ExcelWorksheet = ExcelPackage.Workbook.Worksheets(MyValues8)
                '*Dim CellNum As String = "B" & (Index + 3)
                '*  ws.Cells(CellNum).Value = MyValues1(Index)
                '*Next

                '*For Index = 0 To MyValues25.Length - 1
                '*Console.WriteLine("Element " & Index & "=" & MyValues25(Index))
                '*  Dim ws As OfficeOpenXml.ExcelWorksheet = ExcelPackage.Workbook.Worksheets(MyValues8)
                '*    Dim CellNum As String = "C" & (Index + 3)
                '*      ws.Cells(CellNum).Value = MyValues25(Index)
                '*  Next
                Console.WriteLine("Operator Login OK")



                '*Saves.xlsl file
                ExcelPackage.Save()

            End Using

        End If
    End Sub
End Class


2
Open Discussion / Exception thrown
« on: November 30, 2017, 09:57:34 PM »
Hello,

Working on a new application for data collection. I've tried this a couple different times on 2 different computers and always get the same fault.

From my output screen.
Code: [Select]
About to read the data
Exception thrown: 'MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException' in MfgControl.AdvancedHMI.Drivers.dll

Here is the actual code. I've double checked my tags and looks like I have everything correct.
Any Idea's?
Thanks

Code: [Select]
  Private Sub DataSubscriber1_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataChanged
        If e.ErrorId = 0 AndAlso e.Values.Count > 0 AndAlso e.Values(0) = "True" Then
            Console.WriteLine("About to read the data")

            Dim MyValues0() As String = EthernetIPforCLXCom1.Read("look_doser_sn_pn_array[0]", 999)
            Dim MyValues8 As String = EthernetIPforCLXCom1.Read("MDY10")


            Console.WriteLine("All Data Read")

            '*Transfer the values to Excel

            '*Creates Excel file
            Using ExcelPackage As New OfficeOpenXml.ExcelPackage(New IO.FileInfo("C:\2220\Doser.xlsx"))
                ExcelPackage.Workbook.Worksheets.Add(MyValues8)
                Console.WriteLine("ws creation ok")

                '*Writes the Headers in Row 1
                ExcelPackage.Workbook.Worksheets(MyValues8).Cells("A1").Value = "...................................DOSER.................................."

                Console.WriteLine("header creation ok")

                ExcelPackage.Workbook.Worksheets(MyValues8).Cells("A1").AutoFitColumns()

                '*Loops to write data in correct columns
                For Index = 0 To MyValues0.Length - 1
                    Console.WriteLine("Element " & Index & "=" & MyValues0(Index))
                    Dim ws As OfficeOpenXml.ExcelWorksheet = ExcelPackage.Workbook.Worksheets(MyValues8)
                    Dim CellNum As String = "A" & (Index + 3)
                    ws.Cells(CellNum).Value = MyValues0(Index)
                Next
                Console.WriteLine("Doser OK")



                '*Saves.xlsl file
                ExcelPackage.Save()

            End Using
        End If
    End Sub


3
Open Discussion / Controlling Excel with EPPLUS
« on: October 16, 2017, 03:54:39 AM »


I've been collecting data now for a couple of weeks and all is working good. The current project is copying 7 array (500 elements in each) to the file. I am using a string tag (MyValues20) with mmddyyyy as well as shift "1st" and this is the name of the tab. I  save  this data each shift, clear the array and start over. As long as the value is MyValues20 is different than last it creates a new tab and writes the data. This has been working great.


Code: [Select]
'*Creates Excel file
            Using ExcelPackage As New OfficeOpenXml.ExcelPackage(New IO.FileInfo("C:\Test.xlsx"))
                ExcelPackage.Workbook.Worksheets.Add(MyValues20)
                Console.WriteLine("ws creation ok")


                For Index = 0 To MyValues0.Length - 1
                    Console.WriteLine("Element " & Index & "=" & MyValues0(Index))
                    Dim ws As OfficeOpenXml.ExcelWorksheet = ExcelPackage.Workbook.Worksheets(MyValues20)
                    Dim CellNum As String = "A" & (Index + 2)
                    ws.Cells(CellNum).Value = MyValues0(Index)
                Next
                Console.WriteLine("Inspect")

I've moved on to a smaller application only collecting data from 7 tags twice daily.  Instead of creating a new tab I want to just index to the next row and let it run for the month but as long as MyValues20 is same as existing tab i get an exception error.

Do I need to ignore this line "ExcelPackage.Workbook.Worksheets.Add(MyValues20)" if the tab already exist?

Thanks.

4
Application Showcase / First project that I just keep adding too.
« on: September 27, 2017, 03:45:47 AM »

I have 11 cells, each with various cells in them. I'm displaying Standard Cycle Time, Actual Cycle Time, Average Cycle Time, and the Deviation from Standard Cycle Time. The Deviation times switch from Green is Ok to Yellow as it approaches 50% and then Red if it goes over standard.

This particular line only has 3 cells so the others are hidden with a visibility bit. I have an alarm banner that will display any of the cells that are in the red. It will cycle through them at 10 second intervals.
 
With lots of help from  this forum I've just implemented a data collection scheme that will collect an array of actual cycle times. Currently doing this by manually toggling a bit but will be adding timers and collecting this at the end of each shift.

I've got this running on an old laptop with HDMI to 50" TV.


5
Open Discussion / Copy 500 element array to Excel?
« on: September 12, 2017, 08:00:12 PM »
Hello,

I've been reading through the forum and particularly looking at the KeepingRecordsFromCLXtoExcelFile demo. I'm looking to copy an array of the last 500 cycle time averages for each of the 7 sections of the cell. A total of 3500 tags to 1 excel file.

I have 0 coding experience but do have a few AHMI projects up and working. I've downloaded the KeepingRecordsFromCLXtoExcelFile AHMI project and have set BasicLabel1 to Array address. Currently when I start the project I get the value from AverageCycleArray[0] displayed. I want to work with getting this to excel then move on to the complete array.

I believe I read in one of the post that I can save this to an excel file even without MS Office installed????
If so how to do this?
Will I need a BasicLabel for each array element?

Thanks,


6
Open Discussion / Project built, now what?
« on: August 08, 2017, 04:00:48 AM »

First off thanks for a great resource. I had looked at AHMI a few times in the past and just a few days ago finally downloaded.

My first project consist of pretty much making a replica of one of our AB Panelview screens. This is a packing area with overhead crane and we have people 40+ feet away looking at a 10" screen and yelling to the person with hand scanner. I will put this on a Raspberry Pi and use the HDMI to a 55" screen.

It took a while to get the string variables worked out but looks good and much more responsive than the AB.

I've looked at a couple dozen tutorials but looking for something specific to loading onto the Pi. Can anyone point me to anything.

Thanks.

Pages: [1]