LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview object oriented programming (oops)

It sounds like the write and the read are not connected through data flow.  The zero value is probably the default value.  Do you branch the class wire?  

 

Treat class wires as special clusters.  Just like clusters if you branch the cluster wire and write in one branch and read in another, the value is not passed between them.

 

Here is a picture of the example code attached: (wires are not broken in the attach code)

Code.png

 

Output 1 will read the correct value that was written.  Output 2 read the default value which is zero.

 

View of Front Panel:

Front Panel.PNG

 

Hope this helps.

Quentin "Q" Alldredge

Chief LabVIEW Architect, Testeract | Owner, Q Software Innovations, LLC (QSI)
Director, GCentral | Admin, LabVIEW Wiki | Creator, The QControl Toolkit
Certified LabVIEW Architect | LabVIEW Champion | NI Alliance Partner



0 Kudos
Message 11 of 24
(1,177 Views)
So that i can't change the default value??...and I was on the doubt about using data member access VI's because of it shows when I write some value was written but in th e time that I want to read it means it shows zero always that's a thing I'm asking..

0 Kudos
Message 12 of 24
(1,170 Views)

Post your code.  I think you're making a simple mistake but it's hard to help without any code to go by.

0 Kudos
Message 13 of 24
(1,158 Views)
I attached those normal class with its data member access VI's ...
Here my doubt is
I was written a value to string using write vi
But the time used to read the value by read vi it shows nothing
Download All
0 Kudos
Message 14 of 24
(1,133 Views)

Do you have a String data fiels included in each level of the class hierarchy?  A Child:String is NOT the same data field as Parent:String.  I made this mistake at the beginning until I properly understood how to use inheritance in LabVIEW.

 

If you are mixing methods between different levels of your hierarchy, this can lead to problems.  Make sure that all VIs are trying to access the same data field by making a single "String" data field in the parent and access ALWAYS via accessor.

 

As a hint, try flattening the class to string and displaying the data before and after writing the data.

0 Kudos
Message 15 of 24
(1,127 Views)
Here i m not using any of inheritance ...
I can't get the meaning of this VI's basic functionality..
So only I'm asking....
0 Kudos
Message 16 of 24
(1,107 Views)

Yes you ask, but you provide so little.

Post an example of the code where you write to and then read from a class which does not retain the value.  Just posting the accessors does not tell my HOW you are using these.

0 Kudos
Message 17 of 24
(1,105 Views)
OK here I'm simply creating a class and give a private data control as a string and after I create data member function VI's for it..I cant go ahead further because of those uncleared doubtz
0 Kudos
Message 18 of 24
(1,101 Views)

Code, code, code.  Please let us see some code.

Your words do not help me at this point.  If you really want help, at least post pictures of the code if you don't want to atcually post the real code.

0 Kudos
Message 19 of 24
(1,098 Views)
sorry sir and i attached picture of it and i once repeat i was done only thiss
0 Kudos
Message 20 of 24
(1,083 Views)