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

Pages: [1]
1
Are you a Wizard??

Mind B L O W N !! It Worked!!!!

To add additional PLC addresses would I:

1) Add individual additional DataSubscriber# for additional PLC Tags or use the original DataSubscriber1 and revise the PLCAddressValue to define a Tag range?

2) I would then need to specify where to send the DataSubscriber# results in Excel - I did figure out where in the VB to define the destination cell which gets populated for this single point so far.

Both of these would need to be created/revised within MainForm.vb - correct?

THANKS Archie - this is very cool.

Ed

Update: I tried adding and additional DataSubcriber#, and Cop/Pasted it into the VB, modified its nuember to line up with the new one, and adjusted the destination and IT WORKED!!

Thanks again SO much!!

Ed


2
Hello Archie - tried this today, but no success.

I wasn't familiar with the exact subroutine Declaration to paste the code ahead of. Here is the MainForm.vb code I tried after adding the reference to Excel to the AdvancedHMI project. I am using Excel Pro 2010 and Visual Basic 2010 Express

Code: [Select]
Public Class MainForm

    Private oXL As Excel.Application
    Private oWB As Excel.Workbook
    Private oSheet As Excel.Worksheet

    Private Sub MainForm_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
        ' Start Excel and get Application object.
        oXL = CreateObject("Excel.Application")
        oXL.Visible = True

        ' Get a new workbook.
        oWB = oXL.Workbooks.Add
        oSheet = oWB.ActiveSheet
    End Sub

    Private Sub DataSubscriber1_DataChanged(ByVal sender As Object, ByVal e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataChanged

        oSheet.Cells(1, 1).Value = e.values(0)

    End Sub

    Private Sub MainForm_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(MainForm))
        Dim x = CType(resources.GetObject("MessageListByValue1.Messages"), MfgControl.AdvancedHMI.Controls.MessageByValue)
    End Sub

    '*******************************************************************************
    '* Stop polling when the form is not visible in order to reduce communications
    '* Copy this section of code to every new form created
    '*******************************************************************************
    Private Sub Form_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.VisibleChanged
        AdvancedHMIDrivers.Utilities.StopComsOnHidden(components, Me)
    End Sub

    '**************************************
    '* Filling the form with a gradient
    '**************************************
    Private Sub MainForm_Paint(sender As Object, e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        'Dim rect As New System.Drawing.Rectangle(0, 0, e.ClipRectangle.Width, e.ClipRectangle.Height)
        'Dim gradientBrush As New Drawing.Drawing2D.LinearGradientBrush(New Point(0, 0), New Point(0, Height), System.Drawing.Color.FromArgb(180, 100, 200), System.Drawing.Color.FromArgb(110, 200, 255))
        'e.Graphics.FillRectangle(gradientBrush, rect)
    End Sub

End Class


Code: [Select]
Error 1 Type 'Excel.Application' is not defined. F:\AdvancedHMI\AdvancedHMIBetaV397e\AdvancedHMI\MainForm.vb 3 20 AdvancedHMI
Error 2 Type 'Excel.Workbook' is not defined. F:\AdvancedHMI\AdvancedHMIBetaV397e\AdvancedHMI\MainForm.vb 4 20 AdvancedHMI
Error 3 Type 'Excel.Worksheet' is not defined. F:\AdvancedHMI\AdvancedHMIBetaV397e\AdvancedHMI\MainForm.vb 5 23 AdvancedHMI
Error 4 'Private Sub MainForm_Load(sender As Object, e As System.EventArgs)' has multiple definitions with identical signatures. F:\AdvancedHMI\AdvancedHMIBetaV397e\AdvancedHMI\MainForm.vb 7 17 AdvancedHMI

I am hoping to sort of build a very basic HMI within Excel that populates the Excel cells with real time live data at an update rate that is suitable for end to end transmitter calibrations.

Preserving the values as a record would be done manually as I present different PVs to a given transmitter, and then use Copy, & Paste Value on the transmitter PV to record it on another worksheet in Excel.


Here is a snippet from Excel of what I am doing with it using RSLinx to make a crude HMI that I grab values from:

PLC Address,       Live Value Displayed,                   Tag Info,                                                                  Old PLC5 Tag info
Code: [Select]
SCADA_REAL[29] 717.3 PT-001 METER 1 PRESSURE PT-001 TO GC$N(FC3:158) METER 1 PRESSURE PT-001 TO GC$N(FC3:158)
SCADA_REAL[30] 45.5 TT-001 METER 1 TEMPERATURE TT-001 TO GC$N(FC3:160) METER 1 TEMPERATURE TT-001 TO GC$N(FC3:160)
SCADA_REAL[32] 718.0 PT-002 METER 1 PRESSURE PT-002 TO GC$N(FC3:164) METER 1 PRESSURE PT-002 TO GC$N(FC3:164)
SCADA_REAL[33] 45.8 TT-002 METER 1 TEMPERATURE TT-002 TO CG (FC3:166) METER 1 TEMPERATURE TT-002 TO CG (FC3:166)
SCADA_REAL[35] 716.4 PT-901 DISCHARGE PRESSURE  PT-901 TO GC (FC3:170) DISCHARGE PRESSURE  PT-901 TO GC (FC3:170)

Thanks,

Ed

3
WOW! that is pretty good off the top of your head!!

I will give this a try tomorrow. It will be very exciting to make this work.

Thanks,

Ed

4
Hey Archie,

Real time live values directly in Excel work well for me. The number of points is about thirty or less. I would use this at calibration time to observe the PV that I present to the transmitter, Ctrl-C it then paste value in a cell to record the calibration.

Showing the live values on an AdvancedHMI form, then using a button to take a snapshot and write them to an Excel file sounds good too, but I only examine a single transmitter and thus single tag/address at a time so I would have to grasp how this may work.

We are have a mix of processors that are on our network - PLC5 and PLC5000. I have had success with the PLC500 adding the digital panel meter and getting it to populate with live data (that was magical!) but need to work through get this working with the PLC5. I believe I might be in this scenario with the PLC5 as I got the exact same error http://advancedhmi.com/forum/index.php?topic=314.0

Sort of learning this when I get the odd moment to try it. My knowledge and skill level with VB is new and low, but I can make some sense of it.

Thanks Archie!!

Ed

5
Open Discussion / Control Logics 5000 - DDE/OPC to Excel (Live Data)
« on: March 09, 2015, 05:05:12 PM »
Great stuff Archie!!

I have installed AdvancedHMIBetaV397e and have been successful in adding a digital display, pointing it to a PLC via EthernetIPforCLXCom1 and having it display a live PLC value.

I am an E&I tech that frequently does transmitter calibrations.

Our original record keeping system here was to fill out paper calibration records. I transitioned this to using an Excel spreadsheet that pulled in real time live transmitter values from the PLC via RSLinx. Using Excel is really slick for my needs as I can simply copy the live value, then paste value only to create a calibration record. No more paper calibration sheets!!

I am hoping I can substitute Advanced HMI's EthernetIPforCLXCom1 comm driver for RSLinx to allow me to pull real time live data into Excel.

I have searched and read many Excel/Advanced HMI topics, but none seem to be describing how to accomplish what I need. My skill level when it comes to VB is pretty basic.

The way I make this work using RSLinx and Excel:

1) In RSLinx browse to the desired PLC processor, right click and configure new DDE/OPC Topic and give it a name.

2) In Excel accept warnings and provide permissions for the scary things to run. In a cell define the path into the PLC address/Tag via RSLinx DDE/OPC Topic name:
Code: [Select]
=rslinx|DDE/OPC Topic Name!'PLC Address/Tag' I usually export the PLC tag database and harvest the tag/address needed.

3) Set up calibrations equipment at transmitters, connect laptop to the PLC network, fire up Excel spreadsheet set up to use RSLinx and watch the transmitter's output right through to the PLC. This is so great because you can calibrate end to end alone without having a second person relay these values over a radio.

I think the closest I came to finding a match for what I seek is http://www.plctalk.net/qanda/showthread.php?t=78379&page=2 and I can follow this pretty well, but I think this is a similar application and not exactly what I hope to do.

This is a pretty incredible platform Archie! Once I get this Excel/EthernetIPforCLXCom1 working and my annual calibrations done, I hope to promote Advanced HMI here as a replacement for RSView which is is getting a bit old.

Ed 

Pages: [1]