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.

Using expressions on Read and Write (with Live Binding)

More
22 Aug 2013 17:55 #1413 by support
Dear Sir,

The feature that you describe below can be achieved using a Converter object/property, which is available on each binding. The conversion object needs to implement the IDataConverter interface, which has just two methods: Convert, and ConvertBack.
We already supply one kind of converter component (StatusToColorConverter); the linear conversion you describe below was in the plans. The architecture is already extensible, new converters can be added without affecting existing design.

There are two ways to do it:
a) Implement a converter that is also a Component. In this case, you can then drag it from Toolbox and simply select it in designer for the Converter on the binding, no coding necessary after the converter is developed. This is the “better” way, and it is how currently the StatusToColorConverter works.
b) Or, you do not have to write a full Component. Just create an object that implements the IDataConverter interface the way you want it, and then assign an instance of this object to the Converter property on the binding. This is less work in implementing the converter, but a bit more cumbersome to actually use it.

Best regards,
Zbynek Zahradnik

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

More
22 Aug 2013 17:44 #1412 by support
From: A.
Sent: Wednesday, August 21, 2013 10:02 PM
Subject: Re: QuickOPC 5.22 build 342.1 available [RE: OPC Labs Contact Form - Bug?]

.....
About features

1) this is important for industrial automation, i meet this case in many oil pumps and valves.

For example in many valve i got 0 closed and 255 open but i must display 0-100% in hmi. So it better implement in uabinding object properties easy expression when read and when write
Properties
Use expression on read
True or false
Read expression
You can insert easy expression like
X = x / 2.55
So if i read tag and i will have 255 it display 100
Same thing about write
In expression will have
X=x*2.55
So when write in textbox 100 it will write 255

Let me Know
Br,A.

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

Moderators: support
Time to create page: 0.044 seconds