Recent Posts

Pages: 1 ... 8 9 [10]
91
I'm using the ClxDriver and I create a new connection like this:

Code: [Select]
_CLXDriver = new ClxDriver.EthernetIPforCLX
{
CIPConnectionSize = 508,
DisableMultiServiceRequest = false,
DisableSubscriptions = false,
IPAddress = ClientIP,
PollRateOverride = 500,
Port = 44818,
ProcessorSlot = 0,
RoutePath = null,
Timeout = 4000,
UseOmronRead = false
};

I wan't to make a class that automatically connects to the PLC when it is available, keeps retrying to connect when the PLC is not available and publishes an event when the connection changes. I subscribe to the following events:

Code: [Select]
           
_CLXDriver.ConnectionEstablished += OnConnectionEstablished;
_CLXDriver.ComError += OnConnectionLost;
_CLXDriver.ConnectionClosed += OnConnectionClosed;

The problem is that "ConnectionEstablished" does not fire if there is no Read called. So just creating the "ClxDriver.EthernetIPforCLX" object and waiting for "ConnectionEstablished" to fire whenever the PLC is booted up doesn't work since it never fires. If I do a read when the PLC is booted up it does fire, but if I do a read when the PLC is not booted up, an unhandled "System.Net.Sockets.SocketException" is thrown that I cannot catch since it is thrown on a different thread. So how can I know when the PLC is connected and how can I wait indefinately for a PLC to connect to?

Thnx!
92
Support Questions / Re: basic label or other help
« Last post by NotGnu on January 20, 2024, 01:42:37 PM »
Thank you so much.
If I lose you, I am effed.
93
Support Questions / Re: basic label or other help
« Last post by Archie on January 20, 2024, 11:34:05 AM »
Use HighlightColor, HighlightForecolor, and PLCAddressHighlight
94
Support Questions / Re: basic label or other help
« Last post by NotGnu on January 19, 2024, 03:33:28 PM »
Thank you very much for the quick reply.
It worked perfectly.
But, I am having trouble changing the background and text color.
96
Support Questions / basic label or other help
« Last post by NotGnu on January 17, 2024, 11:16:50 AM »
I'm trying to make a square indicator change colors like I like based off a boolean value. (currently am able to do)
I would like the text to change from 'OK' in black font or 'Not OK' in white font. - need help doing. I can change it to true/false, 1/0, et all on the basic label.
97
Support Questions / Re: RE: Display Position By Integer Value
« Last post by zach_a_ary on January 13, 2024, 10:24:33 PM »
awesome, that worked, thanks Archie
98
Support Questions / Re: RE: Display Position By Integer Value
« Last post by Archie on January 13, 2024, 12:08:26 PM »
The reason PLCAddressLeft worked is because of an AdvancedHMI feature known as Auto Properties. The software will look for properties with the name PLCAddress*. It will strip the PLCAddress off those properties then use what's left to see if a property exists by that name. If so, it will use the value from the PLC to push into that property.

The BasicIndicator has a property named Top that will set its distance from the top of the form (or container that it exists in). If you modify the BasicIndicator by adding :

Public Property PLCAddressTop as string

AdvancedHMI's Auto Property feature will link the PLC value from the tag/register to the property Top.
99
Support Questions / RE: Display Position By Integer Value
« Last post by zach_a_ary on January 13, 2024, 12:22:42 AM »
hello Archie, in a previous topic named "Display Position By Integer Value" you mentioned adding this property "PLCAddressLeft". I added this property to a basic indicator and it worked. Is there a property for vertical position? I tried "PLCAddressUp" and "PLCAddressDown" just to see if it would work and it did not.
100
Open Discussion / Re: adding page to mainform
« Last post by TCE on January 04, 2024, 05:46:30 PM »
Tanks Godra i missed that didn't know you had to do that for every page. Works now😊😊😊
Pages: 1 ... 8 9 [10]