Author Topic: Have a Keypad write to any PLCAddress  (Read 12997 times)

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Have a Keypad write to any PLCAddress
« Reply #15 on: July 04, 2015, 11:03:44 PM »
The file in the previous post was replaced with new one that now shows the current driver (because of the complexity of how this control works, I couldn't add an option to enable/disable showing of the current driver, so it's always showing).

The initial Runtime screen will show general type of the currently selected driver but once the driver is changed it will have an instance number next to it as well. Here is an example:

You have the following drivers: OpcDaCom1, OpcDaCom2, ModbusTCPCom1 and currently selected driver is OpcDaCom1.
The initial screen will show as "KeyPadPopUp [OpcDaCom]" and if you don't remember which instance it is (1 or 2) then change the driver and then you will get instance number next to it.

I couldn't figure out showing the instance number on the initial screen since DesignMode and Runtime values were just different.

Take it as it is.

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Have a Keypad write to any PLCAddress
« Reply #16 on: July 08, 2015, 11:41:14 PM »
Here is the latest and slightly different version of the KeypadPopUp control (I currently consider it to be the best choice).

This time the initial screen will wait for the driver to be selected first and will populate the combobox with tags specific to that driver only.

String collections for either User or Admin have to be organized for each driver by starting with line separators (star, star, space (** ) which cannot be changed) and the name of the driver. Once all the tags are entered for that specific driver, there has to be the same line separators, and optionally any text, placed after the last tag. Check the attached picture for string collection example. Also attached is a picture of the screen outputs for the mentioned string collection. If tags are not organized this way then there should be no tag showing in the combobox.

Descriptive Comments for tags can still be entered, as with previous versions (default separators are space, slash, slash ( //) and can be changed").

Check the last post on the 1st page of this topic for available button combinations and instructions of what to do when adding/removing drivers after the control has been placed on the form.
« Last Edit: July 09, 2015, 01:11:44 AM by Godra »

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Have a Keypad write to any PLCAddress
« Reply #17 on: July 09, 2015, 06:17:58 PM »
The latest version has been slightly changed:

1) Line separators can be changed now but the new string needs to be used in the User/Admin collections as well
2) Once the driver is selected then it is sufficient just to click the button to go to KeypadPopUp screen (instead of using SHIFT key)

The new file is attached.
« Last Edit: July 23, 2015, 06:21:23 PM by Godra »

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Have a Keypad write to any PLCAddress
« Reply #18 on: July 19, 2015, 02:08:44 PM »
A new addition to KeypadHMI is a screen that shows Allen Bradley PLC type that the control is connected to (check the attached picture). It only works for DF1Com and EthernetIPforPLCSLCMicroCom drivers.

The screen is accessed by pressing CTRL button and clicking on either of KeypadPopUp or Select Driver buttons. Clicking the label will take you back to the previous screen.

If you do get the number showing in brackets but no description then report the number and type of PLC you are using so it could be added to the list. Also report if the description doesn't match your PLC.

The control doesn't work in v3.98t since there was a change in DF1Com driver. If you need to use version t then you can always add, as Existing Item, DF1Com driver from previous version. This control did work in previous versions p, r, s.

« Last Edit: July 23, 2015, 06:24:18 PM by Godra »

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Have a Keypad write to any PLCAddress
« Reply #19 on: September 04, 2015, 02:05:59 AM »
Archie,

DF1Com driver in V399 doesn't work properly.

It is already set to return &H49 processor value and even if I force it to return &H58 it still doesn't communicate with MicroLogix 1000.
I used the DF1Com driver from V398r and it works fine.

For those using KeypadHMI control, attached is a slightly modified version to work with V399 (this due to changed names of the drivers).
« Last Edit: September 04, 2015, 02:08:17 AM by Godra »

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Have a Keypad write to any PLCAddress
« Reply #20 on: September 05, 2015, 02:22:33 AM »
A new addition to KeypadHMI control is a Basic Button which allows quick setting of the boolean type PLC addresses (for other addresses it can perform WriteValue but I would suggest to use KeypadPopUp instead).

Its output type can be changed on-the-fly by right-clicking the button.

The button is accessed by pressing Alt + KeypadPopUp buttons (and switch back to KeypadPopUp button in the same manner).
« Last Edit: September 10, 2015, 07:03:45 PM by Godra »

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Have a Keypad write to any PLCAddress
« Reply #21 on: November 23, 2016, 07:18:40 PM »
This is the latest version of KeypadHMI control which appears to be working fine with v3.99r and v3.99s. It might be somewhat difficult to use this control without a keyboard, this since CTRL / ALT / SHIFT buttons are used to perform switching (for touchscreens this might help http://advancedhmi.com/forum/index.php?topic=1532.0).

The feature to show AB PLCs was removed due to new drivers architecture.

ToolTip will pop-up on MouseHover for both buttons (Keypad and BasicButton). It shows how different combinations of keyboard buttons work:

          CTRL+ALT+Click  switch between Admin / User mode
          SHIFT+Click         switch between Keypad / Drivers mode
          ALT+Click             switch between Keypad / BasicButton

The BasicButton feature is currently available for Admin use only. This implies that ALT+Click functionality is currently only available in Admin mode. 2 lines of code inside btnKeypad_Click sub are marked that could be commented out to enable this button for User as well.

The attached version of the BasicButton could be used instead of the stock version (it allows writing only with the left click of the mouse while the right click will show pop-up menu to change the OutputType of the button on-the-fly  <-- Archie might make these available in the next release).

Also attached is a text file with example strings that could be used in CollectionOfPLCAddress User or Admin.

Try adding the KeypadHMI control after you have placed all the drivers on the form.

If you add/remove drivers after the control is placed on the form, then do either of the following:

-- save all the User/Admin strings/tags, remove the existing KeypadHMI control, save and then add a new KeypadHMI control and populate its User/Admin collections with the saved tags

-- close and re-open the form and then perform a "dummy" update of the CollectionOfPLCAddressUser (literally add word dummy at the end of the collection, close and save and then remove the word and close and save <-- this is a kind of a bug in the control since the Visual Studio updates the drivers collection in the DesignMode but not for Runtime until some additional change has been made).
« Last Edit: December 06, 2016, 11:18:54 PM by Godra »