LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean controls doesn't update from DS

I connected boolean controls to a tag and used the "Publish and Subcribe" option. (DS does the same).
When I toggle the control, the value changes in the plc, but when the plc changes the value the boolean control doesn't show the changes.

I've linked a numeric control to the same tag and it updates the way it should. All changes from the plc is shown in it, but not on the bool control. If I change the numeric from 0 to 1, the plc updates, but not the boolean control.

Using Labview 6.1 DSC. Coding to link 400 bool controls to the numeric controls is not an option.
0 Kudos
Message 1 of 3
(3,101 Views)
Are the tags configured to be discrete tags or numeric tags? Are they also set up as input/output tags?
Did you use the HMI wizard to link to the tag or only front panel datasocket?

I read one of your previous post(Boolean Indicator shows -1 as True I.S.O 1) and I think the problem is there:

"OPC Server is a derivate of ActiveXwhich has Variant as Datatypes.
Windows defines this datatypes in its header files... in this case in the wtypes.h

There we have the definition:
/* 0 == FALSE, -1 == TRUE */
typedef short VARIANT_BOOL;

...
#define VARIANT_TRUE ((VARIANT_BOOL)-1)
#define VARIANT_FALSE ((VARIANT_BOOL)0)"

The OPC Specs specify that:

"Recommendations:
· The VARIANT types VT_I2, I4, R4, R8, CY, DATE, BSTR, BOOL, UI1 as well as single arrays
of these types (VT_ARRAY) are expected to be most commonly used (in part because these are the legal types in Visual Basic).
· It is recommended that whenever possible, clients request data in one of these formats and that whenever possible, servers be prepared to return data in one of these formats.
· It is expected that use of other extended types will most likely occur where the Server and Client were written by the same vendor and the server intends to pass some non-portable vendor specific data back to the client. In the interests of interoperability, such transactions should be minimized"


Since your PLC and/or OPC server doesn't follow the norm here, I am afraid that coding is the only option you have here, unless somebody else has an idea out there...

Regards,

Cyril Bouton
Applications engineering
National Instruments
Cyril Bouton
Active LabVIEW Developper
0 Kudos
Message 2 of 3
(3,101 Views)
Since the question was posted, the number of tags have doubled to 800 and is still climbing. I'm now trying to use a ring control in stead of booleans. This seems to do the trick. Only the behaviour is different. (shows menu of pics i.s.o changing state), but i can live with that.

Thank you very much.
0 Kudos
Message 3 of 3
(3,101 Views)