Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

problem

More
16 Dec 2016 10:36 #4660 by support
Replied by support on topic problem
I am afraid that there is no direct way to do this with Live Binding today. It would require a custom converter, as described in the previous post.

A weird trick occurred to me now: If the values indeed come from the OPC Server as Booleans, you may try to ask for them in as integers: That is, set RequestedDataType (I think in ReadParameters) to I2 (corresponds to VT_I2) or so. But you are likely to end up with 0 for False (which is good) but -1 (negative) for True (which is not good, as you need +1).

Regards

Please Log in or Create an account to join the conversation.

More
15 Dec 2016 10:29 #4657 by alr1976
Replied by alr1976 on topic problem
ok i use imagelist so when is false i need display image with index 0 and when is true display image with index 1

Please Log in or Create an account to join the conversation.

More
14 Dec 2016 14:30 #4649 by support
Replied by support on topic problem
Can you please describe what you want to achieve? The OPC value is a Boolean, and you want to show it as 0/1 on the screen? And you also want the user to be able to write it back, or not?

Please Log in or Create an account to join the conversation.

More
14 Dec 2016 14:24 #4648 by alr1976
Replied by alr1976 on topic problem
Ok i ll see it in next future.....

in live binding it possible to convert true/false (Boolean) in 0 and 1 (int) and viceversa? How can i do?

Please Log in or Create an account to join the conversation.

More
14 Dec 2016 13:06 #4646 by support
Replied by support on topic problem
Both the requirement of the original point #3 (i.e. hiding based on a condition), and this new one (switching images based on a value) should be doable with a custom data converter. In first case, it would convert an analog value to a Boolean; in the second case, it would convert a numerical value to an image object.

An example data converter - our StatusToColorConverter - is here: kb.opclabs.com/Implementing_a_data_converter_component . All converters are same in the principle, they just need to do different computations internally.

But let me state once again, Live Binding is meant to be used mainly for applications where its existing capabilities are a good fit. It is possible to extend it, but it's not easy. You may be trying to stretch a bit too far.

Please Log in or Create an account to join the conversation.

More
14 Dec 2016 10:32 #4645 by alr1976
Replied by alr1976 on topic problem
Yes i need an example(point #3)....

Ok i need to have a component like statustocolor but with value to image ... for example

value 0 show image 1
value 1 show image 2

it is possible?

Please Log in or Create an account to join the conversation.

More
02 Dec 2016 15:32 #4622 by support
Replied by support on topic problem
Ad example: Do you mean for #3 ? Please confirm. Yes I can provide it, but can that wait until you really know you are going this route and need it? Because I do not want to put the effort into it just to show that it is possible.

Ad 1: No, it is not possible. But I cannot quite understand why you'd want to RESTRICT it ("only to show localhost or only anyhost with my nodes") during the development process - in the Visual Studio? It's not for end users (users of the application you develop), it's for you, as a developer. What's wrong with seeing a couple of extra nodes?

Please Log in or Create an account to join the conversation.

More
02 Dec 2016 10:50 #4619 by alr1976
Replied by alr1976 on topic problem
Hi!

It Possible to have a simple example with source code?

about 1st point is not possible to have own dialog schema in point to bind? For example i need only to show localhost or only anyhost with my nodes.

Please Log in or Create an account to join the conversation.

More
02 Dec 2016 10:21 #4618 by support
Replied by support on topic problem
An addition to #3:
Actually, it is kind of possible, but with a trick.

First, it were easily doable if you had a Boolean tag in OPC, or a numeric tag that had 0 for "hidden" and anything else for "visible". In these cases, you could add a second binding to the control, and bind to the Visible property.

Things become complicated if you do not directly have this, and want to use a condition like yours. The trick lies in using a Conversion that we can have with each binding. So you need a Conversion that would convert the incoming value to the case described below, so that it can be bound to the Visiable property. a) In some cases, this can be done by using the LinearConversion component we provide. b) In other cases, this can be done with extra manual coding: Defining a new conversion class in the code, instantiating it and assigning to the binding. It is a somewhat ugly solution, though.

Please Log in or Create an account to join the conversation.

More
02 Dec 2016 10:13 #4617 by support
Replied by support on topic problem
Hello.

As a note, I am a bit confused by your mention of Delphi, and TButton. I am not sure how these apply here, because Live Binding in QuickOPC is for .NET Windows Forms applications only.

Second, it should be made clear that Live Binding is meant to be (with some exceptions) a model in which you do not write code. This brings some limitations. The Live Binding is good for certain scenarios and within its capability boundaries; for more complicated tasks, Live Binding may not be the best choice.

Now to the specifics:

Ad 1) When invoking the OPC browsing dialogs from the code, it is possible to specify the starting node (server). When talking about invoking a subsequent "bind" dialogs in Visual Studio designer, this is not currently possible. As I have stated in the answer in the other topics, subsequent invocations of "Bind to Point" should open it with the same server&node as before.

Ad 2) Live Binding currently requires that everything is fixed - server endpoints, node IDs etc. If you are talking about on-time change in the project during the development time, you can simply use Search and Replace functionality in the Visual Studio, because all the parameters of the bindings are actually represented in code files (.cs or .vb), and can be edited there as well.

Ad 3) Currently this is not possible. It would be possible to combine Live Binding with some extra code that would do this.

Ad 4) I am not quite sure if I understand, but you can use a CheckBox with Appearance set to Button, and then bind to its Checked property.

Regards

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.062 seconds