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

Pages: [1]
1
Support Questions / Re: Digital readout not recognizing the tag
« on: September 19, 2014, 01:47:56 PM »
I found the issue. When I created the tag it was created in the main program and was not a controller tag.

2
Support Questions / Digital readout not recognizing the tag
« on: September 19, 2014, 01:40:30 PM »
Hello Everyone I am using a compactlogix processor and am trying to insert a tag value into a digital read out. The tag  I am using is "Reservoir1PressureRaw". That is the tag i am using in the DRO value column. Why is it not reading the value. I have converted the value to string in the PLC. It is saying I have an invalid tag address. I have checked and double checked the spelling and casing. Thanks.

3
Support Questions / Re: Scaling for Bar level
« on: June 19, 2014, 09:08:31 AM »
Here is the code that I used for my USB load cell application. What I am doing is using a load cell to measure the amount of liquid in a reservoir. The basic program has a Text box that displays the raw value of the load cell. The first button starts the calibration, then when the load cell is at the minimum weight or empty the "set minimum weight" button is pressed. This then sets the bar level value to minimum or 0%. The maximum weight is then placed onto the load cell and the "set maximum weight" button is pressed and this will set the bar level to maximum or 100%. After the max button is pressed the math is completed and you have the converted value of the raw value to properly fill the bar graph. I also created settings so that when the form loads the last calibration information is loaded and the user does not have to re-calibrate at each form load.


Public Class Form1

    Dim WithEvents LoadCell1 As Phidgets.Bridge
    Public Sub New()

        ' This call is required by the Windows Form Designer.
        InitializeComponent()
        ' Add any initialization after the InitializeComponent() call.

    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        value1 = My.Settings.Value1
        value1Coor = My.Settings.Value1Coor
        value2 = My.Settings.Value2
        value2Coor = My.Settings.Value2Coor

       
            slope = (value2Coor - value1Coor) / (value2 - value1)
            ' slope = (100 - 0) / (value2 - value1)
            yInt = value1Coor - (value1 * slope)


        Try
            LoadCell1 = New Phidgets.Bridge
            LoadCell1.open()
            Threading.Thread.Sleep(1000)
            Timer1.Start()
            LoadCell1.bridges(0).Gain = Phidgets.BridgeInput.Gains.GAIN_128
            LoadCell1.DataRate = 350
            LoadCell1.bridges(0).Enabled = True



        Catch ex As Phidgets.PhidgetException
            MessageBox.Show(ex.ToString())
        End Try

        LoadCell1Data.Text = LoadCell1.bridges(0).BridgeValue.ToString

    End Sub

   

    Private Sub LoadCell1_BridgeData(ByVal sender As Object, ByVal e As Phidgets.Events.BridgeDataEventArgs) Handles LoadCell1.BridgeData

        TextBox4.Text = Math.Round((slope * e.Value) + yInt, 2).ToString
        BarLevel1.Value = Math.Round((slope * e.Value) + yInt, 2).ToString

    End Sub
   

    Dim value1, value2, value1Coor, value2Coor, slope, yInt As Double

    Private Sub Start_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Start.Click

        MinimumValue.ReadOnly = True
        SetMinButton.Enabled = True
        SetMaxButton.Enabled = True
        MaximumValue.ReadOnly = True
        MinimumValue.Text = 0
        MaximumValue.Text = 100

    End Sub

    Private Sub SetMinButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetMinButton.Click

        Try
            value1 = CType(LoadCell1Data.Text.ToString, Double)
            value1Coor = CType(MinimumValue.Text.ToString, Double)

            MaximumValue.ReadOnly = True
            MinimumValue.ReadOnly = True
            SetMinButton.Enabled = False
            SetMaxButton.Enabled = True
        Catch ex As Exception
            MessageBox.Show("Please enter a valid Number", "Invalid Number")
        End Try

        My.Settings.Value1 = value1
        My.Settings.Value1Coor = value1Coor
        My.Settings.Save()

    End Sub

    Private Sub SetMaxButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetMaxButton.Click
        Try
            value2 = CType(LoadCell1Data.Text, Double)
            value2Coor = CType(MaximumValue.Text, Double)

            'Calculate formula
            slope = (value2Coor - value1Coor) / (value2 - value1)
            ' slope = (100 - 0) / (value2 - value1)
            yInt = value1Coor - (value1 * slope)
            TextBox3.Text = "y = " + slope.ToString("F4") + "x + " + yInt.ToString("F4")

            MaximumValue.ReadOnly = True
            SetMaxButton.Enabled = False
        Catch ex As Exception
            MessageBox.Show("Please enter a valid Number", "Invalid Number")
        End Try

        My.Settings.Value2 = value2
        My.Settings.Value2Coor = value2Coor
        My.Settings.Save()
    End Sub
End Class

4
Support Questions / Re: Error at form Load
« on: June 18, 2014, 11:12:11 AM »
Excellent, thanks. I will start using the recommended Try/catch. Thanks for the quick response and great product.

5
Support Questions / Error at form Load
« on: June 18, 2014, 08:53:58 AM »
This is the code for my start screen which is the first screen to load when the program is started. Occasionally I get and error that shuts down the program. I have the error information paste bellow as well.  You can see in my code that I am looking for my heartbeat that is being generated by the PLC so that I can confirm communication. Are there other ways to do that? What is the best way to confirm that I have comms with the PLC before my code begins to execute, such as waiting until I have communications until the timer starts. I know that there is a CommunicationEstablished event for the ethernet driver but I had no success with that. Thanks in advance for the help.
 
Public Class StartScreen

    Private Sub StartScreen_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Threading.Thread.Sleep(1000)
        Timer1.Start()
    End Sub
    Private Sub BevelButtonDisplay1_Click(sender As Object, e As EventArgs) Handles BevelButtonDisplay1.Click
        ShuttleScreen.Show()
    End Sub
    Private Sub BevelButtonDisplay3_Click(sender As Object, e As EventArgs) Handles BevelButtonDisplay3.Click
        InkDelivery.Show()

    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

        Dim A As Integer = EthernetIPforCLXCom1.Read("HeartBeatTimer1.ACC")
        If A >= 500 Then
            HeartBeatIndicator.Show()
        Else
            HeartBeatIndicator.Hide()
        End If
    End Sub
 
End Class



This is the error that I get occassionaly when my form loads:
An unhandled exception of type 'MfgControl.AdvancedHMI.Drivers.Common.PLCDriverException' occurred in MfgControl.AdvancedHMI.Drivers.dll

'This line of code is highlighted in the Ethernet driver code:
DLL(MyDLLInstance).ReadTagValue(PLCAddressByTNS(SequenceNumbershort), numberOfElements, CUShort(SequenceNumber))

6
Support Questions / Re: Scaling for Bar level
« on: June 17, 2014, 03:33:34 PM »
I worked it out. Had to do some some math functions and conversions. Thanks.

7
Support Questions / Scaling for Bar level
« on: June 17, 2014, 10:26:30 AM »
Hey everyone, here is my question/Issue I am using a USB enabled load cell to measure the amount of liquid in a small reservoir. I am able to read the value just fine inside the textbox.  What I want to do is use a bar level as a level indicator for the reservoir using the textbox value. I will be using the load cell data inside the PLC but I don't wan to send the data to the PLC and then send it right back for the bar level value. I would like to do this with code. Is this easily done via VB code or should I send the value to the PLC and then send it back to the bar level?  Any help would be great. Thanks.

8
Support Questions / No numeric readout for bar level
« on: May 21, 2014, 12:37:48 PM »
Hello all, I would like to know if there is a way to disable the numeric readout for the bar levels. All that I want is to see the bar raise and fall with no numbers. Thanks

9
Support Questions / Re: Transparant Button over an Image
« on: April 24, 2014, 01:12:22 PM »
Thanks for the replies. I will try both suggestions and let you know. Thanks again.

10
Support Questions / Transparant Button over an Image
« on: April 23, 2014, 02:24:33 PM »
I am sure there is a simple solution to this but I can't seem to get it. I have an image of a machine and I want a transparent button overlaid on the machine. I want a button on the machine but I don't want to see the button. I have tried changing the properties of a basic button but can't seem to get it. Thanks.

11
Support Questions / Re: ShapeContainer is "ambiguous" in the namespace
« on: April 21, 2014, 03:45:43 PM »
That took care of it. Thanks for the quick reply and great product. Keep it up!

12
Support Questions / ShapeContainer is "ambiguous" in the namespace
« on: April 21, 2014, 03:16:05 PM »
Hello all, I am new to the forum and advanced HMI. I am getting the following error message when building the solution.

"ShapeContainer is ambiguous in the namespace Microsoft.VisualBasic.Poweracks."

Any help would be great. Thanks

13
Support Questions / Re: Communicating Over wireless
« on: February 03, 2014, 04:23:50 PM »
I got it. I didn't have the tag addressing correct. Love the software and can't wait to start coding. Thanks a lot for the free software.

14
Support Questions / Communicating Over wireless
« on: February 03, 2014, 01:38:03 PM »
Hello, I am communicating to a compactlogix L24ER via a wireless router. I can get online and have built a simple program in Studio 5000. For my program I created a bool tag named "toggle" that turns on output 0. Again very simple. No I am attempting to create a simple program via Advanced HMI to turn the output on. I would like to use a selector switch, that when clicked will turn on the output. I would also like an indicator light that comes on when the output is on. I have attempted to do this but have not had any luck. Can someone please point me in the right direction.

Regards, Chris

Pages: [1]