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

Pages: [1]
1
Support Questions / Touch events are unresponsive
« on: September 14, 2018, 01:10:22 PM »
I'm using ModbusTCP with a touchscreen computer running Win10. When I touch a button sometimes it takes 2-3 presses before it responds. When using a mouse it works every time. It feels like main GUI thread blocking so I changed to a DataSubscriber model, it didn't make any difference. I thought it was a windows bug but I have a few other apps on other machines (not talking to a PLC) and they work fine.

Anything I can try to narrow down the problem?

2
Support Questions / Change Pilot Light color in code
« on: September 14, 2018, 01:04:58 PM »
I'm using a DataSubscriber to change a pilot light color but it's not working.

Code: [Select]
if (e.PlcAddress == "10014")
               {
                  if (e.Values[0] == "0")
                  {
                     plLowLevelA.LightColor = PilotLight.LightColors.Green;
                  }
                  else
                  {
                     plLowLevelA.LightColor = PilotLight.LightColors.Red;
                  }
               }

The code gets to this section just fine but the light color is always red.

3
Clean unzip of V399w, open solution and build, no problems. I delete the MfgControl.AdvancedHMI.Controls.dll from the support folder in SolutionExplorer. Copy new dll to that folder and add back into project and Rebuild. I get errors and the Toolbox for the controls doesn't populate. I can replace the patched dll with the original (even just in WindowsExplorer) from the zip package, rebuild and all is well again.

My plan was to update to V399w and apply latest patches, it worked fine with Patch4 of the drivers.

4
Support Questions / PC rebooted and wrote zeros to PLC
« on: April 18, 2017, 10:38:45 AM »
Last week the PC running AHMI was in the process of installing updates and rebooting and for some time it was on the "please don't turn off" Win10 screen. Somewhere during that process, it set all the PLC registers that the app writes to, to zero. Trying to understand why/when it wrote zeros and if it's a bug, intended, etc.

5
Support Questions / ModbusTCP driver invalid cast
« on: April 03, 2017, 05:25:30 PM »
OK - modbusTCPCom1.Write("00014", "1");
OK - modbusTCPCom1.Write("00014", "0");
OK - modbusTCPCom1.Write("00014", "TRUE");
ERROR - modbusTCPCom1.Write("00014", "FALSE");

The error is conversion from String to Double is not valid.

6
Support Questions / SelectorSwitch graphics alignment
« on: March 22, 2017, 05:04:52 PM »
I have a couple MomentaryButton controls on a page and I have a couple SelectorSwitches on another page that are in the same position. I noticed that when I switch back and forth, the selector switch center point of the graphic is not the same as the button, so it looks like the switch moves a bit.

Maybe it doesn't bother anyone else but thought I'd point it out.

7
I get errors whenever I try to get this to work. I want to be able to enter (and display) minutes on a DPM keypad but write milliseconds to the PLC. So if I type in 1, I need to write 60000 to the PLC. If 60000 is in the PLC, display 1 on the DPM. Can I do this with the DPM settings?

8
Support Questions / Writing a 32-bit integer ModbusTCP
« on: March 14, 2017, 10:13:35 AM »
Is there a way to set the PLCAddressKeypad to write a 32-bit integer or do I have to do it in code?
Code: [Select]
string[] data = new string[] { "13", "0" };
modbusTCPCom1.Write("40001", data);

9
Support Questions / Writing a MomentarySet from code
« on: March 08, 2017, 11:36:02 AM »
What I need to do is write an integer value to 40009, then do a MomentarySet to 00011, sort of an automatic enter key. I can use either a BasicButton or windows form button to write to 40009. Then I made a BasicButton to do a MomentarySet to 00011 but I can't get the button to fire after I hit the integer buttons. I tried btnMoveManual.PerformClick(); which indeed does fire the event handler but it does not write to the PLC.


10
If I set the Modbus driver like so:

SwapBytes = False
SwapWords = True

and I read a 32-bit real and convert like so:
Code: [Select]
         string[] values = modbusTCPCom1.Read("30006", 2);
         byte[] byteValue = new byte[4];

         BitConverter.GetBytes(Convert.ToInt16(values[0])).CopyTo(byteValue, 0);
         var floatValue = ConvertByteToFloat(byteValue);

      public static float[] ConvertByteToFloat(byte[] array)
      {
         float[] floatArr = new float[array.Length / 4];
         for (int i = 0; i < floatArr.Length; i++)
         {
            if (BitConverter.IsLittleEndian)
            {
               Array.Reverse(array, i * 4, 4);
            }
            floatArr[i] = BitConverter.ToSingle(array, i * 4);
         }
         return floatArr;
      }

All is great. But, I have a couple of TIME variables that then get broken. If I swap the bytes and words settings, then the TIME vars are correct and the float is all messed up.

Can I have my cake and eat it too or am I going to have to manipulate one of them in code? Maybe a tweak in the Modbus driver?

11
Support Questions / SelectorSwitch3Pos question ModbusTCP
« on: March 02, 2017, 07:43:31 PM »
Using this control for an HOA and I have a question just to make sure I have things set up correctly. When I have the switch in left or right position, the value in the PLC register is 256 and zero in the middle. Is that right? Seems like an odd value.

Also, what I'd really like since I'm trying to make a new .NET HMI for an existing PLC, is there a way to have one value sent to one address based on position? So 0 for off, 1 for Auto, 2 for Hand all sent to 40005?

12
Open Discussion / How to update AdvancedHMI on an existing project
« on: March 02, 2017, 10:00:59 AM »
Say I have a project that I've been working on with an older version of AHMI. A new version comes out with a feature I'd like to use and I'd like to update. How do I go about this without breaking the project?

Thanks

Pages: [1]