LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get a list of case states

I have a LARGE state machine that uses a producer consumer configuration.  I need to do some "paper" documentation.  Is there a simple way to export or otherwise get a list of the states in the case statement so I can stuff them into Word and expound on what each does?

 

I guess I can write a code snippet that takes the case and converts it to an array of strings and then display them, highlight, copy and paste, but I was hoping not to have to modify my code.

0 Kudos
Message 1 of 6
(2,679 Views)

If you turn on scripting you can use a property node property to list the cases. I list the cases if you open the code attached in this thread

0 Kudos
Message 2 of 6
(2,674 Views)

What is the case selector datatype? If it is an enum you could do this

 

Example_VI_BD.png

=====================
LabVIEW 2012


0 Kudos
Message 3 of 6
(2,672 Views)

I ended up taking the enum for the case and converting it to a string array, then writing it out to a text file using a write spreadsheet VI, but that is not what I had hoped for.  That meant that I had to modify the code.  Due to controls on the source, I ended up having to copy the code somewhere else and do the mods.  I was just hoping there was a project related dropdown equivelent.

0 Kudos
Message 4 of 6
(2,668 Views)

Do you know that you can print VIs or projects to an html file? It is highly configurable on what to include in the report. The case structure names are not listed as text but are part of the images so parsing is out of the question. But maybe the report will give you a good starting point for your "paper" documentation.

=====================
LabVIEW 2012


0 Kudos
Message 5 of 6
(2,657 Views)

IF the enum is a type def then you can write external code (so your traget code in unchaged) to open the type def get a ref to the enum and then list its strings.

 

Put a stirng on the FP to select diffeent type-defs and you have a re-uable tool that does NOT change your code.

 

Ben

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