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

Pages: 1 [2] 3 4 ... 8
16
Tips & Tricks / Printing to a Zebra Printer from AdvancedHMI
« on: September 30, 2018, 05:42:21 AM »
Attached are some code bits from a project I did to print to a Zebra printer. I used Zebra Designer software to create a label, then exported it to a "prn" file. Within the label, I specified variable fields by closing them in brackets. The code would look for those fields and substitute it with the data.

The code does use native methods so it will only work on Windows. It sends information to the printer that has been installed using the Zebra printer driver.

17
Tips & Tricks / Speech Recognition
« on: June 21, 2018, 07:53:26 AM »
A fun little experiment on speech control. This is definitely not up to the caliber of the more advanced speech recognition devices, but does work.

- In Solution Explorer, right click the AdvancedHMI project and select Add reference
- Select System.Speech reference from the list
- In Solution Explorer right click the MainForm.vb and select View Code
- Add this code:
Code: [Select]
    Private WithEvents sp As New System.Speech.Recognition.SpeechRecognitionEngine(New System.Globalization.CultureInfo("en-US"))

    Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        '// Create And load a dictation grammar.
        sp.LoadGrammar(New System.Speech.Recognition.DictationGrammar())

        '// Configure input to the speech recognizer.
        sp.SetInputToDefaultAudioDevice()

        '// Start asynchronous, continuous speech recognition.
        sp.RecognizeAsync(System.Speech.Recognition.RecognizeMode.Multiple)
    End Sub

    Private Sub sp_SpeechRecognized(sender As Object, e As System.Speech.Recognition.SpeechRecognizedEventArgs) Handles sp.SpeechRecognized
        Me.Text = e.Result.Text

        If e.Result.Text.IndexOf("press", StringComparison.CurrentCultureIgnoreCase) >= 0 And e.Result.Text.IndexOf("button", StringComparison.CurrentCultureIgnoreCase) >= 0 Then
            '* Write the button press bit to the PLC
            '* EthernetIPforCLXCom1.Write("MyButton","1")
            MsgBox("Button will be pressed")
        End If
    End Sub

- Run the application and talk to it. You will see the result in the form's title bar.



The next step for improved recognition would be to use Microsoft's Azure services. I tried this demo and it works quite well:

https://azure.microsoft.com/en-us/services/cognitive-services/speech-to-text/

18
Tips & Tricks / ControlLogix ReadUDT and WriteUDT
« on: May 28, 2018, 02:40:56 PM »
As of version 3.99y Beta 11, it is now possible to read and write complete UDTs into an equivalent class. To use this, you must create classes and map the data types from CLX to .NET equivalents. The following link has a chart that shows the data type equivalents:

https://advancedhmi.com/documentation/index.php?title=WriteUDT

An example would be the UDT shown in the attached picture. An equivalent class for this UDT would be:
Code: [Select]
Public Class DateTimeUDT
   Public Year As Integer
   Public Month As Integer
   Public Day As Integer
   Public Hour As Integer
   Public Minute As Integer
   Public Second As Integer
   Public Microseconds As Integer
End Class

Then to read the value of the UDT:

Code: [Select]
Dim MyUDT as DateTimeUDT = EthernetIpForCLXCom1.ReadUDT("MyUDT",GetType(DateTimeUDT))


NOTE : Creating a class with public fields is considered bad OOP practice. But in order to map arrays, it was necessary to bend that rule a little to make the ReadUDT possible.

19
This is a n updated control that will be in a future version, but I wanted to put it out there for some initial testing.

- Download the attached file
- In Solution Explorer, expand down AdvancedHMIControls
- Right click the PurchasedControls folder and select Add Existing
- Browse to the attached file
- Expand down the Controls folder
- Right click the GraphicalInidcator.vb and select View Code
- On line 7 , change the Inherits line to this
Code: [Select]
Inherits GraphicIndicatorBase

20
Application Showcase / PanelView Upgrade to AdvancedHMI Panel PC
« on: March 10, 2018, 06:57:47 PM »
This is the second machine that was upgraded from an old PanelView 1000 to AdvancedHMI. This one used the AdvancedHMI 15" Panel PC

https://www.advancedhmi.com/index.php?main_page=product_info&cPath=1&products_id=16

Part of the upgrade was to add a wireless access point and a tablet for maintenance to setup the machine.

The machine uses a ControlLogix (L63 processor) with a combination of Ethernet/IP and DeviceNet IO. The program was so large it was taking 120-200ms to scan the program. Also part of the upgrade was to go update to an 1756-L85E processor. This brought the scan time down to 7ms and the HMI was re-configured to refresh at 50ms which made a huge difference in HMI response.


21
Additional Components / Charting App for BasicDataLogger
« on: March 06, 2018, 11:53:22 AM »
This started out as an update to the QuickChart provided by Godra, but changed significant enough that I wanted to post it on its own thread. You can open the solution and run it as it. Either Reload the test file or browse to your own log file.

The biggest differences from Godra's Quickchart:

- No auto mode, you must manually click Reload file
- Pan and zoom buttons as opposed to date and time selection

Still a work in progress, so it may still have some bugs. The next step is to make it into a control that can be added to a form in an AdvancedHMI project.

22
Additional Components / TCP Client Socket
« on: January 21, 2018, 12:45:54 PM »
The attached component is a group of files that will add a generic TCP client. After adding the files and building the solution, you will get a new component in the Toolbox. Add this to your form, set the IPAddress and port number, then double click the component to get back to the code that will receive the data from the server.

An example of its use would be an Serial to Ethernet converter with a barcode scanner hooked up to the serial port. This component will receive the data from the scanner.

Installation and use:

- Download and unzip the files
- Open your AdvancedHMI solution in Visual Studio
- In Solution Explorer, expand down the AdvancedHMIControls project
- Right click the PurchasedControls folder and select Add-Existing Items
- Browse to the extracted files and select all 4 files
- Build the solution
- Open the Mainform
- From the ToolBox, add a GenericTCPClient to your form
- Set the IPAddress and port to that of your TCP server
- Double click the GenericTcpClient1 component which will take you back to the code
- Enter this code:

MsgBox ("Received: " & e.DataAsString)

- Run the application and have your server send data


It also has the capability to send data back to the server like this:

GenericTCPClient1.SendString("MyDataString")

23
Support Questions / TwinCAT 3
« on: December 17, 2017, 07:51:42 PM »
On a few occasions the question came up about the compatibility of AdvancedHMI with TwinCAT 3. Previously I did not have a good answer because I only tested it with TwinCAT 2. I finally had the opportunity to test it and found out that it does work. The main difference is the TargetAMSPort will start at 851 by default.

24
Support Questions / Various OPC Server Names
« on: October 27, 2017, 01:01:01 PM »
Setting up an OPC server for the first time to work with AdvancedHMI is very often problematic. Since the OpcDaCom does not have a browse feature, it can sometimes be difficult to figure out the exact name to put in OPCServerName. I want to consolidate the names to use for various servers and any other helpful information. If anyone has successfully used an OPC server with OpcDaCom, can you post the server name you used?

These are a couple that I am aware of:

RSLinx  = RSLinx OPC Server
Bosch Rexroth = OPC.IwSCP

25
Additional Components / Color Picker
« on: September 16, 2017, 02:52:50 PM »
This is a color picker that uses the same picker used by the properties window.

26
Tips & Tricks / EthernetIPforCLXCom - Reading Complete UDT
« on: September 15, 2017, 08:04:35 AM »
It is frequently asked about reading complete UDTs since reading each element individually is slow and inefficient. A page has been added to the documentation wiki that will help shed some light on this.

http://advancedhmi.com/documentation/index.php?title=Reading_Complete_UDT_with_ControlLogix_Driver

27
Open Discussion / Anyone going to Pack Expo Las Vegas?
« on: August 17, 2017, 09:55:10 AM »
I'll be at the Pack Expo in September and was wondering if anyone else will be there also?

28
Open Discussion / AdvancedHMI on the Road
« on: August 16, 2017, 12:22:11 PM »
Over the next six months I will be travelling to various places in the eastern US. I will have one of the new panel PCs with me to be able to demo the hardware and software.

If you are East of the Mississippi river and interested in me stopping by, either send me a message or post here your location and I will try to work it in my travel schedule to stop by. Whether you want to see a demo, just to meet and discuss the software, or even show projects you have done with AdvancedHMI, I will be interested in stopping by for any reason.

29
Open Discussion / Memphis, TN area users?
« on: August 02, 2017, 09:46:17 AM »
I want to check to see if anyone here is close to the Memphis area. A presentation on PLCs and HMIs will be given in Memphis in a few weeks and I wanted to see if anyone in the area is interested. If my schedule works out, I do plan to be there myself and I am always interested in meeting AdvancedHMI users.

30
Open Discussion / New Version 3.99x Now Available
« on: July 17, 2017, 09:45:39 AM »
V3.99x
BarLevel - Added ShowValue property
EthernetIPforCLXCom - fixed problem with writing UDINT
Keypad - Was throwing exception if limits were set and Enter was clicked with nothing
Modbus - Fixed problem when writing "FALSE" to a bit
PLCAddressItem - did not support the ListSeparator for globalization
EthernetIPforCLXCom - Added BeginWriteRaw and WriteRaw for writing complete UDTs using byte array
GraphicIndicator - Added Flash1 property
EthernetIPforCLXCom - Added WriteCustomString for user defined strings
EthernetIPforCLXCom - Added WriteUDT for writing complete UDT based on Structure or Class
EthernetIPforCLXCom - Added ReadRaw to return the byte array in raw format
Emailer - fixed a problem when using Username and password
IniParser - Made values preserve case, but section and keys remain case insensitive
BarMeter - New control
SelectorSwitch3PosByValue - corrected image alignment with small legend plate
BasicLabel - New numeric keypad



A new feature has been added to the EthernetIPforCLXCom driver that has been heavily requested for a long time. This is the ability to write all data to a UDT in a single call. Since this feature takes a little knowledge of code writing and can get complex, there are a couple resources to help with it:

http://advancedhmi.com/documentation/index.php?title=WriteUDT

https://github.com/AdvancedHMI/AdvancedHMICodeSamples/tree/master/EthernetIPforCLXCom/WriteUDT



Pages: 1 [2] 3 4 ... 8