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

Pages: [1] 2
1
Open Discussion / Re: Broadcast over internet
« on: September 24, 2022, 06:57:27 AM »
I use AHMI with OpenVPN in an aplication for pumping system with 3 pumping stations and 5 submergibles pumps, a total of 5 PLCs.

2
Support Questions / Re: How to read and write form 3 Micrologix 1400
« on: April 18, 2022, 01:42:56 PM »
Hi Everyone,

I am trying to connect to 3 Micrologicx 1400 PLCs to read and write data from one to another to control some functions between them. I need to read and write words and bits. Can some one please explain how to to this in the best way possible?

Its very, but very simple just RTFM and your done!

3
Open Discussion / Re: Label text is ugly at runtime
« on: April 21, 2021, 03:07:07 PM »
The problem its the size of TV or monitor.
If you try it on a 15 or 17 or 21" will appear better. But if you use a 50" TV or monitor it becames really ugly.
One solution its use a diferent font or font size, ex font Segoe UI or Arial size 12

4
Open Discussion / Re: Digital counter Display
« on: April 21, 2021, 03:02:18 PM »
In the NumericFormat property just put N0.
This way it follows the numeric format of your system.
If you want 1 decimal place it will be N1, N2 for 2 decimals and so on

5
It also occurs in 3.99y beta 38.  I am not sure how the drivers work, but this issue appears to be happening with all of the serial drivers.  The error is thrown before communication is attempted.

It only happens if the scale factor results in a decimal.

To replicate this all you need to do is put a DigitalPanelMeter on the main form of a fresh project, give it a Keypad scale factor of 2, keypad min 0 max 100, and send it to any of the SerialDF1 drivers with a PLCAddressKeypad of N17:1 for example.
Run the project, if you enter "4" into the keypad you'll get a "no response form PLC" error.  If you enter 5 you'll get a "input string was not in a correct format" error.

I have, some times ago with a Micrologix 1400, the same problem.
This tries to write a string with the decimal separator, be a coma or a point, to a integer element.
This its what i use to solve:

 m_ComComponent.Write(m_PLCAddressKeypad, CInt(CDbl(KeypadPopUp.Value) / m_KeypadScaleFactor))

6
Tips & Tricks / Re: Raspberry Pi as Serial to Ethernet adapter
« on: March 07, 2019, 01:15:04 PM »
Hello Jeremy

I dont have those instructions and i've closed my dropbox account.
But i think i can help you.
Open a terminal on Raspberry:
sudo apt update
sudo apt upgrade -y
sudo apt install ser2net -y

with your serial-usb adapter attached try find out wath port is with:
sudo dmesg | grep tty*  or  ls /dev/tty*

next let'sedit the configuration file of ser2net:
sudo nano /etc/ser2net.conf

the only line that should be uncommented is like this:
4000:raw:120/dev/ttyUSB0:9600 8DATABITS NONE 1STOPBIT

Where:
4000 - is a tcp port on the raspberry not blocked for a firewall and also the same port to use on the PC.
raw - is the format of the data (other options could be for example telnet).
120 - is te timeout in seconds.
ttyUSB0 - is an example and must be that port you find above.
9600 - is the baud rate, must adjust to you PLC.
8DATABITS -  the length of each block of information.
NONE - is the parity, others optios = ODD or EVEN
1STOPBIT - how the information block ends

To make ser2net autorun every time the raspberry is turned on, do this:
sudo nano /etc/rc.local

Add the following above exit 0

/usr/local/sbin/ser2net -n -c /etc/ser2net.conf

Now on the PC you need:
com0com
Serial-TCP or RealTerm (https://sourceforge.net/projects/realterm/)

The configuration of Serial-TCP or RealTerm is very simple, just match the tcp port. Both, Raspberry ant th PC must be on the same network or bridged by a gateway.

The connection to AHM is made by com0com.

PLC <=> ser2net <=====> Serial-TCP <=> com0com <=> AHMI

When i published in the forum, in 2015, i have used to connect a Micrologix 1000 via a TP-Link Wi-fi AP to a PC over 400m (1,312ft). But before i have tryed also with a Micrologix 1200, with DF1 and Modbus protocols and worked well without flaws.

Any questions?

7
Support Questions / Re: SLC 5/02
« on: April 20, 2017, 06:21:28 AM »
You just cannot use the UIC with AdvanceHMI, just not work because the UIC uses a special DF1 protocol. Thats why in Rslinx the driver is 1770-KF2/1785-KE/SCAN... and not the normal DF1/Micrologix/PanelView. But i think, not shure, the SLC 5/02 as a RS232/DF1 port.

8
Support Questions / Re: Read/write in Mysql DB
« on: February 17, 2017, 11:27:00 AM »
If helps you here is a litle piece of code working with DataSubscriber2.
I have a button only for testing the connection with the database for debuging purpose.

This code i placed in the main form.

Imports MySql.Data.MySqlClient

Public Class MainForm
    Dim MySqlConn As MySqlConnection
    Dim COMMAND As MySqlCommand

    '*******************************************************************************
    '* Stop polling when the form is not visible in order to reduce communications
    '* Copy this section of code to every new form created
    '*******************************************************************************
    Private NotFirstShow As Boolean

    Private Sub Form_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.VisibleChanged
        '* Do not start comms on first show in case it was set to disable in design mode
        If NotFirstShow Then
            AdvancedHMIDrivers.Utilities.StopComsOnHidden(components, Me)
        Else
            NotFirstShow = True
        End If
    End Sub

    '***************************************************************
    '* .NET does not close hidden forms, so do it here
    '* to make sure forms are disposed and drivers close
    '***************************************************************
    Private Sub MainForm_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
        Dim index As Integer
        While index < My.Application.OpenForms.Count
            If My.Application.OpenForms(index) IsNot Me Then
                My.Application.OpenForms(index).Close()
            End If
            index += 1
        End While
    End Sub

    Private Sub DataSubscriber21_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber21.DataChanged
        Dim estacao, alarme As String
        Dim datahora As Date = "2007-01-02 09:10:00"
        datahora = Now
        'datahora = datahora1
        estacao = "Estação 1"

        MySqlConn = New MySqlConnection 'Create the object
        'Parameters to connect to the database
        MySqlConn.ConnectionString =
        "server=localhost;userid=vitor;password=mypassword1977;database=teste_db"
        Dim READER As MySqlDataReader

        If e.PlcAddress = "Inp_1" Then
            alarme = "Entrada 1" + " " + e.Values(0)
        End If

        If e.PlcAddress = "Inp_2" Then
            alarme = "Entrada 2" + " " + e.Values(0)
        End If

        If e.Values(0) = "True" Then
            Try
                MySqlConn.Open() 'Open the database
                Dim Query As String
                Query =
                "insert into teste_db.alarmes (data_hora,estacao,alarme) values ('" & datahora & "', '" & estacao & "', '" & alarme & "')"
                COMMAND = New MySqlCommand(Query, MySqlConn)
                READER = COMMAND.ExecuteReader
                'MessageBox.Show("Data Saved")
                MySqlConn.Close()

            Catch ex As MySqlException
                MessageBox.Show(ex.Message) 'In case of error show the error
            Finally
                MySqlConn.Dispose() 'Destroy the object
            End Try
        End If
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        MySqlConn = New MySqlConnection 'Create the object
        'Parameters to connect to the database
        MySqlConn.ConnectionString =
        "server=localhost;userid=vitor;password=mypassword1977;database=teste_db"

        Try
            MySqlConn.Open() 'Open the database
            MessageBox.Show("Connection Successeful")
            MySqlConn.Close() 'Close the database
        Catch ex As MySqlException
            MessageBox.Show(ex.Message) 'In case of error show the error
        Finally
            MySqlConn.Dispose() 'Destroy the object
        End Try
    End Sub
End Class

9
Open Discussion / Re: Documentation
« on: July 16, 2016, 03:54:55 AM »
I have a proposal.
Some of us could post some articles and build a sort of manual under Archies supervision.
In first place must have an table of contents.
IMO it can be build and storage in sourcefourge in a directory.

10
Support Questions / Re: IO address for embeddded 1100 analog inputs
« on: January 24, 2016, 04:43:05 AM »
Hope this reply is not to late.
I:0.0 is the digital inpupts of the PLC.
I:0.4 is the first analog and I:0.5 the second.
Both analogs are 0-10VDC and the PLC returns an integer from 0 to 1023
Beware not override 10.5V on inputs, will permenant damage occur.
Hope to be usefull

11
Tips & Tricks / Re: AdvancedHMI on a Raspberry Pi
« on: August 19, 2015, 03:23:52 AM »
Until now i tried not only with Pi but with PC´s running Debian 7 and 8 with no success. But code writen in C seems to work where in V.Basic not.
For those who want to know if the serial adapter is working here is one usefull command that list all the serial ports:
dmesg | grep -i tty

12
Tips & Tricks / Re: AdvancedHMI on a Raspberry Pi
« on: August 17, 2015, 11:25:52 AM »
One question... You want to run AdvHMI in Linux, using Mono and a serial port?

13
Tips & Tricks / Re: AdvancedHMI on a Raspberry Pi
« on: August 11, 2015, 06:38:04 AM »
Hi,
I have corrected the link, it was missformated, sorry.

14
Godra
Ethernet/IP and DF1 are diferent protocols.
The sugested 1761-NET-ENI is a piece of skilled hardware+software that makes the translation between the two, like the 1747-UIC makes the same between DF1 and DH485.
I think its possible to do what you want at software level, but also i think in the mighty effort it will be...

15
Tips & Tricks / Raspberry Pi as Serial to Ethernet adapter
« on: August 07, 2015, 06:23:59 AM »
Here is the result of one of mine experiments.
This uses the Raspberry to connect a PLC with a serial port trough a ethernet network to be accessed by AdvancedHMI.
Follow the link:

https://dl.dropboxusercontent.com/u/67765472/Instrutions-Software.zip

Pages: [1] 2