LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display value (Class Structure)

On my main GUI, I can't seem to view values I'm obtaining from my class structure. I've included my LabVIEW project, the project is called "Mass Spectrometer", GSE_mod is the main LabVIEW program. Under "Instrument Data", there is a field called "Last CMD". Somehow when I'm trying to trying to capture data, it's not updating. Not sure if it's an issue I have with my class formatting? 

0 Kudos
Message 1 of 4
(3,488 Views)
I can't look at your code right now, but there is nothing special or magic about objects. In LabVIEW it is important to remember that:

Object = Wire

Consequently, objects obey all the rules of dataflow just like any other wire.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 4
(3,444 Views)

Your 'Last CMD' in 'Instrument Data' doesn't use objects - it's just using a VISA reference to the VISA instrument you are controlling so classes here have nothing to do with it (you're essentially using a class like an lvlib - without any class  private data).

 

It probably has something to do with the weird array operations you're performing in InstrData Status.vi - picking out random subsets from arrays and then doing a subset/indexing on that. Are you sure you're receiving the data you're expecting from the instrument? I don't actually understand what you're trying to do in that VI - find a termination character? If so, why not use the termination character option in VISA? Also, if you have a 1651 byte string in, search for something that's not at the start of the string, trying to get 1651 characters after that (your subset 'length') will return a shorter string than you're expecting. The 'last CMD' will also only ever return a single character (i.e. the 'A' of hex 'AA', since you convert the string into hex), is that what you were expecting?

 

Edit: In fact, I looked at your other classes for other instruments and it is completely pointless to use classes and have the class wires being passed around your VIs in this project. The idea of the 'class' is to have data (e.g. class private data such as device references, configuration settings) + methods (e.g. 'configure', 'start', 'stop', 'close'). Inside your class VIs, you never bundle/unbundle anything from the class wire so it might as well not be there. I suggest you take a look at some of the LabVIEW OOP tutorials or try to find some class-based examples of instrument drivers.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 3 of 4
(3,430 Views)

Yea my implementation of class structure sucks ... I'll have to look more into it. Any examples you think my code can benefit from? 

 

In the meanwhile in the current code, this is what I'm getting within my block of code (InstrData Status.vi). "Last CMD" is displaying here, however it's not appearing on the page, GSE_mod. This is running data, and I'm supposed to extrace info. The size of the data coming in is 1651 characters, and I start extracting the data after finding A5, index it thereafter. 

 

Data.png

0 Kudos
Message 4 of 4
(3,414 Views)