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

Pages: [1]
1
Open Discussion / Combobox selection value
« on: January 01, 2021, 10:57:42 AM »
First Happy new year  to everyone  :)

I am battling with a small issue this afternoon and hope someone could give me a hint

I have a combobox where I select a supplier and display it i the combobox selection and a second column with a Supplier_ID, which I pull out as the combobox.value into a BasicLabel

If there is a barcode on the product, I will get the supplier_ID via the Barcode scanner and would like to pick the selection in my combobox using the combobox.value

Would this be possible ?

/Holmux

2
Hi List

I hope someone can point me in the right direction  :)

I am battling with this Error that shows up when I open the project, if I ignore the communication to the PLC is OK, but the communication I have to the database fails without any warnings.

Method 'System.Collections.ObjectModel.ObservableCollection`1[[MfgControl.AdvancedHMI.Drivers.PLCAddressItem, MfgControl.AdvancedHMI.Drivers, Version=3.99.19.2, Culture=neutral, PublicKeyToken=null]].Add' not found.

I am running windows 10, I get the same error if I open in VS 2017 or 2019

Is this a Microsoft thing ?

/Flemming

3
Open Discussion / change language on labels and buttons
« on: May 17, 2020, 04:31:09 PM »
Hi
I have a project where I need to be able to change the language and have been searching for the best solution, the perfect solution would be a setup where the customer would be able to edit the translation, for example in a text file.

Or do i make a local db and use the databinding setup ?

/Holmux

4
Open Discussion / Add functions to existing buttons
« on: March 22, 2020, 06:33:27 AM »
Hi
I hope everyone is safe and in good health.

I hope I can get a little help with a task
I generate a array of basic buttons on a page, when one of the buttons is pushed first time I set an "X" into the text, if the same button is pushed again I highlight it, and if pushed again I clear both.
I am using the valueToWrite option, which simplifies my PLC code, using this value as a pointer speeds up my reaction time, Everything is working great :)

But now my customer would like a third option, like first push "X", second push "Orange", third push "Red", fourth push clear the button, I was thinking Basic Indicator would do the job, but  am missing the ValueToWrite option, would that be possible to add to the basic indicator ?
Or is there a different option i can use ?

/Holmux

5
Open Discussion / Datasubscriber2 code firering twice
« on: March 03, 2020, 02:13:54 AM »
Dear All

I need some help figuring this one out  :)

I have a Datasubscriber2 that inserts some data into a MS SQL DB, but every record is inserted twice in the DB
I have double checked the PLC code, debugged the AdvancedHMI code, they are only firering once, here is my
code:
Code: [Select]
Private Sub DataSubscriber25_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber25.DataChanged
        If e.ErrorId = 0 Then
            If e.Values(0) = True Then
                Using Con As New SqlConnection("Data Source=192.168.100.100;Initial Catalog=DB;Persist Security Info=True;User ID=Tarzan;Password=****")
                    Dim command As New SqlCommand("insert into dbo.Products(UPID, XPOS, YPOS, Error, Employee, Employee2) values(@UPID, @xpos, @ypos, @error, @employee, @employee2)", Con)
                    command.Parameters.Add("@UPID", SqlDbType.Int).Value = BasicLabel16.Value
                    command.Parameters.Add("@xpos", SqlDbType.Int).Value = BasicLabel2.Value
                    command.Parameters.Add("@ypos", SqlDbType.Int).Value = BasicLabel3.Value
                    command.Parameters.Add("@error", SqlDbType.Int).Value = BasicLabel4.Value
                    command.Parameters.Add("@employee", SqlDbType.Int).Value = BasicLabel5.Value
                    command.Parameters.Add("@employee2", SqlDbType.Int).Value = BasicLabel33.Value
                    If Con.State.ToString <> "Open" Then
                        Con.Open()
                    End If
                    command.ExecuteNonQuery()
                    If command.ExecuteNonQuery() <> 1 Then
                        Con.Close()
                        Con.Dispose()
                    End If
                End Using
                EthernetIPforCLXCom1.Write("DB_Tricker_1", 0)
            End If
        End If
    End Sub
/Holmux

6
Open Discussion / ScreenCleanButton
« on: December 17, 2019, 11:06:46 AM »
Hi

I have a setup where I have a main page with different Mediforms on top, I would normally place the ScreenCleanButton on the mediform it self, if I do this the cleaning screen open and closes and I still have the mediform open.

But I would like to move the Cleaning button to the main page, but when I do this the mediform that was open, will closes together with the cleaning screen.

Is there a quick way of keeping the mediform open or call it again after the cleaning screen closes ?

Regards
/Holmux

7
Open Discussion / MS SQL generate value via trigger in DB
« on: October 30, 2019, 12:17:03 PM »
Dear forum

I am looking for some help with a task I have.
I need to collect a value from a MS SQL DB, but the value in the DB will not be generated before I execute a trigger in the DB, I received the code I need to generate the number, but not sure how to attack this in AdvancedHMI, her is the SQL code I received:

Code: [Select]
DECLARE              @return_value int,
                                @newKey nvarchar(20)

EXEC      @return_value = [dbo].[NAP_UniqueKeyGen]
                                @newKey = @newKey OUTPUT

SELECT  @newKey as N'@newKey'


How do I attack this the right way?

/Holmux

8
Open Discussion / Set PLC bit to run VB SUB
« on: October 15, 2019, 10:13:34 AM »
HI

It turns out after using AdvancedHMI for for some time now, I never had to start a SUB from the PLC.

This is probalbly very simple I just haven't been able to google this one.

I am sending some data to a SQL database, and would like to tricker the sub from the PLC, how
do I get the state of a PLC(Compactlogix) Boolean to tricker the Sub ??

Thanks
Holmux

9
Open Discussion / Dynamic array of basic buttons
« on: September 10, 2019, 07:58:16 AM »
Hi All

I am trying to make a dynamic array using AdvancedHMIControls.basicButton and I am strucling a bit with getting a value from each button to the plc.
Code: [Select]
Dim xPos As Integer = 0
        Dim yPos As Integer = 0
        Dim n As Integer = 0
        Dim p As Integer = -1
        Dim s As String = ""

        For i As Integer = 0 To 10
            ' Initialize one variable
            btnArray(i) = New AdvancedHMIControls.BasicButton
        Next i

        While (n < 10)
            With (btnArray(n))
                s = (n + 1).ToString
                .OutputType = 5
                .PLCAddressClick = BValue
                .ValueToWrite = n + 1
                '   .BackColor = Color.DarkGray
                '   .ForeColor = Color.Lime
                .Width = 100 ' Width of button
                .Height = 100 ' Height of button
                p += 1
                If (p = 5) Then ' Location of second line of buttons:
                    xPos = 0
                    yPos += 100
                    p = 0
                End If
                ' Location of button:
                .Left = xPos
                .Top = yPos
                ' Add buttons to a Panel:
                pnlButtons.Controls.Add(btnArray(n)) ' Let panel hold the Buttons
                xPos = xPos + .Width ' Left of next button
                n += 1
            End With
        End While

    End Sub

Any help would be great.
Thanks

10
Support Questions / Mark a map and get the coordinates from your mark
« on: August 12, 2019, 11:05:46 AM »
Dear all

I have an application where an operator will have to place a mark on a map and link that mark to a text, close to the same setup you have when renting a car, you have a small drawing of the car with some handwritten marks for each scratch or dent on the car.

The routine would be that the operator will leave a mark on the screen when touched with a pen (working on a touch screen) and lock the coordinates from the last mark with the button that is activated.

I was hoping there was something simuler already made or someone had an ideer to make this work :)

Any help would be greatly appreciated.

Thanks
/Holmux

11
Support Questions / Modbus TCP communication
« on: January 01, 2019, 07:30:47 AM »
Hi All

Programming PLC's for over 20 years, with ton of serial comm and never used Modbus :) I guess that's from mainly using AB PLC's.

Anyway I have this load cell module with Modbud TCP, where I would like to do some communication via the AdvancedHMI, I have been reading ton of manuals the last few days but is still stuck :( If I was a hardcore Modbus expert I guess the manual that came with the module would be easy to decode, but for a Newbie it is not black and white.

From what I understand, I send a request to the module and it replies with the data I was asking for, for example to get the Gross weight out of the module I will have to send "GG" to the module and it will return the value of the Gross weight.

If anyone could point me in the right direction, it would make my start at the new year a lot easier :)

Here is a link to the module i am trying to communicate with: https://www.flintec.com/electronics/weight-indicators/dad-141-1

Happy New year
/Holmux

12
Support Questions / Rotate pipe 45 degrees
« on: December 20, 2018, 10:00:43 AM »
Hi all

Anyone have an idea how I can rotate a pipe 45 degrees ?

Thanks
/Holmux

13
Support Questions / How to place a form on top of the mainform
« on: September 08, 2018, 09:18:42 AM »
Dear Forum

I am very new to the AdvancedHMI setup and Visual for that matter, so this newbie level questions :) 

My plan was to use the mainform and place a row of 7 buttons in the bottom of the form, from these
buttons I would like to call forms that will lay on top of the mainform, all the forms I call will be shorter
then the mainform, so the buttons always are visable.

But when I call a form on top, it is positioned to the left of the mainform, how do i change this so they are
positioned from the left top corner of the mainform ??

I have tried all combinations in the layout section but haven't found the solution,

Please advice

/Holmux 

Pages: [1]