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

Pages: [1] 2 3
1
Support Questions / Re: Problem with ModbusTCPCom and DataSubscriber2
« on: September 20, 2019, 10:09:16 AM »
The register numbers provided in the earlier post contain single and group. The group is just me too lazy to type them all. I subscribe programmatically rather than using the collector at design. And all registers are subscribed individually, hence I have "else if" for each one in the change event. I have Excel spreadsheet to track all the registers, then I column copy & paste to the tag cs file. It is easier for me to manage register number update with the single register method.

2
Support Questions / Re: Problem with ModbusTCPCom and DataSubscriber2
« on: September 19, 2019, 10:22:03 AM »
TagAI is analog input type, 30000 series, specifically 30001, 30041, 30042.
That is just part of the code, the else if continues for each subscribed register.
The actual register number is irrelevant.

3
Support Questions / Re: Problem with ModbusTCPCom and DataSubscriber2
« on: September 18, 2019, 03:01:37 PM »
        private void dataSubscriber2Std_DataChanged(object sender, MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs e)
        {
            int nPLCAddress;
            int iData;

            if (!int.TryParse(e.PlcAddress, out nPLCAddress))
                return;

            if (nPLCAddress == TagAI.TAG_ActiveCS.nTag)
            {
                iData = int.Parse(e.Values[0]);
                TagAI.TAG_ActiveCS.Value = iData;

                labelActiveCSValue.Text = (iData == 1) ? ShareVar.TextUnit2 : ShareVar.TextUnit6;

                ShareVar.ActiveCS = (ShareVar.bConsoleLocal) ? (iData == 1) : (iData == 2);

                ledButtonLocal.LEDState = (iData == 1);
                ledButtonRemote.LEDState = (iData == 2);
            }
            else if (nPLCAddress == TagAI.TAG_FwdLight.nTag)
            {
                iData = int.Parse(e.Values[0]);
                TagAI.TAG_FwdLight.Value = iData;

                gTrackBarHMIFwdLight.Value = iData;
                gTrackBarHMIFwdLight.Label = ((int)BarValueToPercent[iData]).ToString() + "%";

                if (TagAO.TAG_FwdLightNew.Value != iData)
                {
                    TagAO.TAG_FwdLightNew.Value = iData;
                    modbusTCPComStd.Write(TagAO.TAG_FwdLightNew.sTag, e.Values[0]);
                }
            }
            else if (nPLCAddress == TagAI.TAG_FwdIR.nTag)


4
Support Questions / Re: Problem with ModbusTCPCom and DataSubscriber2
« on: September 18, 2019, 11:18:10 AM »
These were the mixed registers in DataSubscriber2
10039 - 10048, 10052, 30001- 30003, 30008, 30011 - 30014, 30041 - 30064, 30075

The problem register is 30001. I would get callback initially, but some random period later, no callback even thought the value had changed (confirmed by separate read).

The modbusTCPCom PollRateOverride is 500. The inputs are slow changing values. I did more testing this morning, could not reproduce the problem (with separate DataSubscriber2 for 10000 and 30000 registers).

5
Support Questions / Re: Problem with ModbusTCPCom and DataSubscriber2
« on: September 17, 2019, 04:50:20 PM »
It seems the problem is caused by having both discrete input registers (10000) and analog registers (30000) in the DataSubscriber2 subscription. I now separate the two register types into two DataSubscriber2 and the problem is not showing up. I will do more testing to ensure it is fixed.

Archie, can you confirm my finding (cannot mix register types in DataSubscriber2)?


6
Support Questions / Re: Problem with ModbusTCPCom and DataSubscriber2
« on: September 16, 2019, 05:46:05 PM »
I am running AdvancedHMIv399yBeta33. Still the same problem. What would cause the DataSubscriber2 not to fire the DataChanged event. I confirmed that using a timer based read of the problem register had the value changed, but no callback from DataChanged event.

I am stuck. What can I try to debug this?

7
Support Questions / Problem with ModbusTCPCom and DataSubscriber2
« on: June 26, 2019, 06:36:44 PM »
Using AdvancedHMIv399xR1, DataSubscriber2 linked to ModbusTCPCom. I added a bunch of registers to DataSubscriber2, process the register value changes in DataSubscriber2_DataChanged. There are situation (random?) that a register value changed but the change does not pickup by DataSubscriber2_DataChanged; when this happens, DataSubscriber2_DataChanged does not report any more changes on that register but still does for other subscribed registers.

When the problem occurs, I switch to an error screen that displays some debug counters in DataSubscriber2_DataChanged and also manually read that register using modbusTCPCom.Read. The manual read reports the register value is changing but does not trigger DataSubscriber2_DataChanged because all debug counters did not change.

Any workaround?

8
Support Questions / Re: Missing modbus drivers in toolbox pane
« on: June 07, 2019, 03:33:47 PM »
Here is a workaround. Drag any driver onto the form, rebuild, open the code tab or any other tab, click back to the form design tab, all the missing drivers are now in the toolbox. Now delete the test driver, drag the correct driver, all the drivers are still in the toolbox when visual studio is restarted. However, if the form contains no driver, then all the missing drivers are missing again when visual studio is restarted. Weird.

9
Support Questions / Missing modbus drivers in toolbox pane
« on: June 07, 2019, 02:55:45 PM »
Compiled the latest AdvancedHMIv399xR1 in VS2010 with SP1. The Modbus drivers are not in the toolbox. I see the ModbusRTUCom.vb and ModbusTCPCom.vb files in the AdvancedHMI\AdvancedHMIDrivers\Modbus folder. How to get these 2 drivers to show up in the toolbox?

10
To work around the problem, I manually use new MfgControl.AdvancedHMI.Controls.AlphaKeyboard().ShowDialog().

Is it possible to displayed the entered characters as "*"?

11
How to enter string into the basicLabel using the alphanumeric virtual keyboard?

When alpha is entered, hit the ENTER key, this error is displayed. "Failed to validate value. Conversion from string ABC to type Double is not valid.

I think the 2 tags associated with the basicLabel need to be string. How to declared a Modbus tag is for a string value?

I need to have a textbox to enter password from a virtual keyboard.

12
Open Discussion / Re: scrollbar width
« on: March 16, 2016, 06:15:40 PM »
I got the arrows to scroll the listview.
I'm unable to find the correct event for the thumb drag. Need some help to implement the thumb drag scroll.

Edit:
It seems the thumb part has to be done from scratch with the mousedown event as this feature is not in the inherited base object "control"

13
Open Discussion / Re: scrollbar width
« on: March 02, 2016, 03:00:24 PM »
Archie, nice trick. It is 50% better. The up/dn buttons and the drag bar need to have larger vertical size. Any trick for this?

14
Tag management - export & import of tags.
Overload Modbus read & write methods for int, float; currently all data are string

15
Open Discussion / scrollbar width
« on: March 02, 2016, 02:06:33 PM »
I need to increase the listview control's vertical scrollbar width to be useable on a touch panel without using a stylus. I am trying to avoid using 2 buttons (up/down) to simulate the scrollbar.

Any suggestion?

Pages: [1] 2 3