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

Pages: 1 ... 11 12 [13] 14
181
Support Questions / Re: Force a value from HMI into plc address
« on: November 03, 2014, 12:55:10 PM »
I'm using a trackbar with a range  from   0 to 16383  , I also have the value display in a label , then using a button click the value is forced into the integer in the code below. what I would like is to have the value go into N14:50 automatically from the trackbar and not have to use the button to force the value.

        'Writes the value from TrackBar1 into the PLC address N14:50

        Try
            EthernetIPforPLCSLCMicroCom1.Write("N14:50", TrackBar1.Value)
        Catch ex As System.Exception
            System.Windows.Forms.MessageBox.Show(ex.Message)
        End Try



This is the code I used for the TrackBar & the Label

 Private Sub TrackBar1_Scroll(sender As System.Object, e As System.EventArgs) Handles TrackBar1.Scroll

    End Sub

    Private Sub TrackBar1_ValueChanged(sender As Object, e As System.EventArgs) Handles TrackBar1.ValueChanged
        Label11.Text = "Analog Out = " &
           Format(TrackBar1.Value, "#")

    End Sub

    Private Sub Label12_Click(sender As System.Object, e As System.EventArgs) Handles Label12.Click
        TrackBar1.Value = CInt(CType(sender, Label).Text)
    End Sub


Darrell

182
Little things that drive you crazy sometimes , forgot to add the tool tip to the component tray ,

all is good now
thanks

183
when I tried this it was in a regular vb form and it seemed to work fine  but when I tried in advanceHMI ,   I get this error

'ToolTip1' is not declared. It may be inaccessible due to its protection level.   

not sure what it means

thanks
Darrell

184
Support Questions / Enter IP Address into Masked Edit Control
« on: October 30, 2014, 03:10:07 PM »
Trying to get this to work , any help would be appreciated.


Want to enter IP Address into Masked Edit Control, check if entry is valid (0-255) and jump to the next section of the mask using the dot (.) as separator, if the section is shorter than 3 digits (such as : 192.168.24.1).


Private Sub MaskedTextBox1_MaskInputRejected(sender As System.Object, e As System.Windows.Forms.MaskInputRejectedEventArgs) Handles MaskedTextBox1.MaskInputRejected


        Dim myIPValue As String


    End Sub
    Private Sub Form_Load()
        MaskedTextBox1.Mask = "###.###.###.###"
        MaskedTextBox1.PromptChar = Chr(32) 'space character
    End Sub


    Private Sub MaskEdBox1_KeyPress(KeyAscii As Integer)
        Dim mySplit() As String, c As Integer, jumpC As Integer, tmpString As String, tmpSplit As String


        If KeyAscii = 46 Then
            mySplit = Split(MaskedTextBox1.Text, Chr(46), -1)


            For c = 0 To UBound(mySplit)
                If IsNumeric(mySplit(c)) Then jumpC = jumpC + 4
                If Len(Trim(mySplit(c))) < 3 Then mySplit(c) = Space(3 - Len(Trim(mySplit(c)))) & Trim(mySplit(c))
            Next (c)
            tmpString = mySplit(0) & "." & mySplit(1) & "." & mySplit(2) & "." & mySplit(3)
            MaskedTextBox1.Text = tmpString
            MaskedTextBox1.SelStart = jumpC
            KeyAscii = 0
        End If
    End Sub


    Private Sub MaskEdBox1_KeyUp(KeyCode As Integer, Shift As Integer)
        Dim validSplit() As String, v As Integer, validString As String
        validSplit = Split(MaskedTextBox1.Text, Chr(46), -1)


        For v = 1 To UBound(validSplit)


            If validSplit(v) = "" Or v = UBound(validSplit) Then


                If Val(Trim(validSplit(v - 1))) > 255 Or (v = UBound(validSplit) And Val(Trim(validSplit(v))) > 255) Then
                    MsgBox("Invalid value")
                    If Val(validSplit(3)) > 0 Then v = v + 1
                    validSplit(v - 1) = ""
                    validString = validSplit(0) & "." & validSplit(1) & "." & validSplit(2) & "." & validSplit(3)
                    MaskedTextBox1.Text = validString
                    MaskedTextBox1.SelStart = (v - 1) * 4
                    Exit For
                End If
            End If
        Next (v)
        myIPValue = Replace(MaskedTextBox1.Text, " ", "")
    End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles ChangeIPButton.Click
        EthernetIPforPLCSLCMicroCom1.IPAddress = MaskedTextBox1.Text
    End Sub


185
I built a HMI with more than one screen , when I open the 2nd screen I have it hide the 1st one. The hidden screen does it stop communicating with the PLC , If it does, is there a way to hide it and make it stop communicating or do  I just have to close it.

Also how many instructions can pole the PLC before some do not work ,

Darrell

186
Thanks man,  worked like a charm

Darrell


187
Support Questions / Hover mouse over component to show PLCAddressValue
« on: October 27, 2014, 04:03:33 PM »
I would like Hover mouse over a component and have the  PLCAddressValue  show ,  in order to quickly verify what is being read on my HMI , I would like to do this for more than one component on the the screen ,  I've spent the better part of my day playing with this and and can seem to get something to work ,  If someone could point me in the right direction , it would be very much appreciated

Thanks Darrell

188
Support Questions / Re: Testing HMI without being connected to a PLC
« on: October 25, 2014, 11:32:43 AM »
Good stuff Archie , Thanks for the replay , cant wait to see the next version , I been working with Allen Bradley PLC's for over 30 years and had no experience with Visual Basic at all, I was able to get a HMI to work with very little trouble and of course with  help from this forum.

I do a lot of commissioning work, I'm designing my HMI more for that line of work, reading and forcing values , toggling test bits etc, so I don't have to be constantly jumping around my PLC program to do or see things. If some of my questions seem a bit odd or out of the norm, that's probably why.

keep up the good work,
Darrell

189
Support Questions / Testing HMI without being connected to a PLC
« on: October 24, 2014, 06:43:50 PM »
I there a way to test your HMI without being connected to a PLC and getting all the connection errors.

I would like to have all communication off until I click a button to connect. maybe this is not an easy thing to do.

190
For the BasicLabel, set the ValueScaleFactor to 0.1

On the DigitalPanelMeter and NumericSevenSegment, set the DecimalPosition to 1

I set the DecimalPosition to 1   enter a value and see no change

191
how can I display a decimal without Changing PLC code for  a Basic label or NumericSevenSegment .
If i receive a value of 245 for example I need to display 24.5

thanks Darrell

192
Support Questions / Re: Force a value from HMI into plc address
« on: October 20, 2014, 10:08:19 PM »
No I'm using to do some testing of some belimo actuators for positioning , when i need to force a different value into an analog output . I make my output rung always false and the force the value into the output directly . This just makes it easier for me , than constantly entering a value by hand  in my testing stages.

But a way to force an output would be a nice option for me in my line of work.

Thanks
Darrell

193
Thanks for the response Archie , Tried it again and it does work ,

Love this program

194
Support Questions / Force a value from HMI into plc address
« on: October 18, 2014, 10:39:30 PM »
Great Program , started playing with this a week ago and can't leave it alone.

Very new to VB , not sure how I can force a value into a PLC address from HMI , I'm using a Micro logix 1400

I want to us a button to force a number into and integer file or anolog output for testing puposes.

thanks
Darrell

195
I built my HMI for a machine to monitor values etc. , I have several identical machines on the same network , different ip's . The same HMI will be valid for any one of them . I want to easily switch between them.

 I tried this ,
a textbox and button to change the IP in the plc driver , it changes the ip i think but does not connect to the new ip



Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        EthernetIPforPLCSLCMicroCom1.CloseConnection()
        EthernetIPforPLCSLCMicroCom1.IPAddress = TextBox1.Text

Darrell

Pages: 1 ... 11 12 [13] 14