LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set 'Quality' attribute of Shared Variable

Is there a way to set the quality of a shared variable? I am polling a piece of hardware and publishing it's data to a shared variable, and the quality attribute seems to be a natural place to put status info (e.g. that the hardware hasn't responded and the data in the variable is now stale, or the hardware has reported a questionable status so the value in the variable may be inaccurate).

 

There are many variables, so creating sidekick variables to carry the status is quite cumbersome, but obviously a possible solution.

 

Creating a typedef which bundles the value and status into a single variable makes the variables too complex, and un-displayable by things like the Distributed System Manager.

 

As a slightly parallel question, besides setting the Quality attribute, can arbitrary attributes be written (and read)?

 

George

0 Kudos
Message 1 of 7
(3,027 Views)

Last time I heard someone lamenting about this, the answer was no: you can't set the quality. That would make me thing that other (arbitrary) attributes are also out of reach.

0 Kudos
Message 2 of 7
(2,977 Views)

wiebe@CARYA wrote:

Last time I heard someone lamenting about this, the answer was no: you can't set the quality. That would make me thing that other (arbitrary) attributes are also out of reach.


That is another reason I avoid global variables and shared variables...

 

They are what they are and you can not adjust them when they fall short. If you find out too late in a project you may find yourself in a world of ...

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 7
(2,971 Views)

@Ben wrote:

wiebe@CARYA wrote:

Last time I heard someone lamenting about this, the answer was no: you can't set the quality. That would make me thing that other (arbitrary) attributes are also out of reach.


That is another reason I avoid global variables and shared variables...

 

They are what they are and you can not adjust them when they fall short. If you find out too late in a project you may find yourself in a world of ...


I also never use them, but if you are forced into using OPC, it's a fit. Then at some point you will indeed find out the missing functionality, and you'll have to face the consequences that you described so well...

 

I'd say it's just not finished, but IFAIK there's no development being done.

Message 4 of 7
(2,964 Views)

wiebe@CARYA wrote:

@Ben wrote:

wiebe@CARYA wrote:

Last time I heard someone lamenting about this, the answer was no: you can't set the quality. That would make me thing that other (arbitrary) attributes are also out of reach.


That is another reason I avoid global variables and shared variables...

 

They are what they are and you can not adjust them when they fall short. If you find out too late in a project you may find yourself in a world of ...


I also never use them, but if you are forced into using OPC, it's a fit. Then at some point you will indeed find out the missing functionality, and you'll have to face the consequences that you described so well...

 

I'd say it's just not finished, but IFAIK there's no development being done.


OPC was all the rage about 15 or more years ago. Most of my application that had that as a requirement, never actually used it.

 

Spoiler

 

I delivered an update of an old DSC application developed in LV 7 and used classic FieldPoint and DSC to access 300 I/O points. I rewrote it using a DAQ engine I had developed and used ethernet cDAQ instead of cRIOs which would have been used if I stuck with DSC. SO it turns out there was an odd issue with one of the cRIO where an analog input task would get stuck and stop updating with no errors but no updates either. Since I had written the code, I was able to add logic to detect if the updates had paused and if so, stop the task and restart it. The customer decalred that a fix and the project was done.

 

Now if that had happened using cRIOs and DSC... I may have gotten a fix in six months

 

Spoiler
Or even longer if NI could not duplicate the error!

 

 

I love it when "crtl-e" works.

 

Ben 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 7
(2,958 Views)

The idea behind OPC is OK, when it's implemented as OPC-UA. I think they missed the boat by 20 years or so...It might be too little, too late. I'd feel a lot better doing a project with UA then that old COM\DCOM\AX mess. At least with XML there's a way to do everything we want.

0 Kudos
Message 6 of 7
(2,954 Views)

Well these are not the responses I was hoping for! I tried a couple of ways to trick the SVE but to no avail, it does what it wants, and the attributes are nearly out of reach... nearly because I found a compromise what will work for our application. If the datatype of the Shared variable is 'Variant' then a vehicle for attributes (quality, timestamp, etc, etc) is available. The cost of this is that both ends of the pipe need to understand Variant, the strict typing is lost (if it was wanted to begin with...) and also that DSM can't read the values. This also does not give clear access to the "real" Quality attribute, but it you use the Datasocket API for the SVs, it can actually get confused and return the impostor attribute on reads of the Variant. Whether this is a feature or a bug...

 

In any case, we are using the SV read and write VI's and the variant is faithfully transported with all of its attributes, so we get to use the SVE for the communication and we avoid the extra variables and awkward cluster typedefs.

0 Kudos
Message 7 of 7
(2,935 Views)