LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically get names of all cases in a case structure

Solved!
Go to solution

You can get my plugin from the link in my signature.  You can use the latest version (3.0.0.4) if you're using LV 2010, otherwise use 2.0.1.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 11 of 22
(3,423 Views)

ds_1

 

I've handled a similar situation using enums.  I like the enum because it forces the user to select a 'defined' state or function.  I use an array of clusters to define the sequence with each element of the array being a single step.  The enum is just part of the cluster.  When it's time to save the sequence to a text file, convert the enum to a string.  Reverse the process when reading in a text file.

 

 

Message 12 of 22
(3,415 Views)

Hi,

 

I can recreate all of the code you show a picture of, but I can't create the "CaseStructure" reference that is Light Blue and is connected to the "to more specific class".  I have 2010 installed and the 8.6 scripting vi items turned on, but all I get on my Scripting VIs palette are 4 light blue icons.

 

Thanks,

 

Ed B.

0 Kudos
Message 13 of 22
(3,320 Views)

I scoured the selections and finally found the Case/Loops/etc.

 

Sorry for the false alarm.

 

Ed B.

0 Kudos
Message 14 of 22
(3,316 Views)

There is plug-in released for the scripting by the R&D  which you can install so that you can see all the property nodes ....

 

http://decibel.ni.com/content/message/5745#5745..

Regards
Guru (CLA)
0 Kudos
Message 15 of 22
(3,315 Views)

Hi All,

 

I know this was a while ago but I came across this problem myself recently and created a function which can name all cases in a case structure provided the case structure has been given a unique name. The function uses labview scripting to achieve the result.

 

You can download the function at my personal site:

 

http://www.globalarry.com/labview-functions.html

 

The function is called "Get Case Names" under the "Scripting Functions" section.

 

Let me know what you think and if you think I need to chage anything.

 

Kind Regards,

 

Larry


Larry Colvin
Associate Principal Engineer
Dyson Technology Ltd.

Message 16 of 22
(2,899 Views)
This thread is exactly what I need. Unfortunately even after installing an activating scripting, I cannot get it it to open Larry's example. I am missing the Transverse for GObjects.vi. However, the scripting library IS installed. It's just that VI isn't part of the library. Did you install something different Larry, or that a custom VI that you forgot to include? I also can't seem to activate the scripting palette in LabVIEW 8.6. Although I can open and run the examples. Any idea how to get the scripting VIs onto the palette?
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 17 of 22
(2,829 Views)

It was too late to edit my reply, so I'm writing another. 

 

For some reason I could not open Larry's example as the Traverse GObject.vi appeared to be missing from the traverseref.llb

 

Although that VI is missing from the library, I was still able to extract Case Structure names by attempting to copy JMacody's code snippet.  ( Although I was not able to open the image as a snippet in my LV 8.6 ) 

 

TRef Traverse for References.vi was required and included in the scripting library I had.  I was then able to cast to a more specific class.  It was tricky finding CaseStructure reference.  I wish there was a way to search through the classes. 

 

I'm still not sure why I appeared to be missing a VI from traverseref.llb   Since I was able to typecast to a GObject type...maybe the library changed slightly and now a more generic VI has replaced some of the more specific ones?  

 

Working code has been attached.  (....in case I need to find it again one day )  Smiley Happy

---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 18 of 22
(2,820 Views)
Hi,
I am Nirmal,doing project in LabVIEW for calibration of4-20mA systems.we are analog io card STM32F100C6.I want to know how to communicate with labview without using DAQ assitant.
0 Kudos
Message 19 of 22
(2,809 Views)

Hi Nirmal,

 

You need to post your question AS a question on the board, NOT as a reply to another question.  Nobody other than the people subscribed to this thread will see your question. 

 

I looked up the part number you reference in your post.  http://www.st.com/web/catalog/mmc/FM141/SC1169/SS1031/LN775/PF216838?sc=internet/mcu/product/216838....

 

This device does not appear to be an analog input card.  It is a microcontroller.  I'm not even sure if this device is capable of reading current.  I didn't see 4-20 inputs listed anywhere. 

 

Your first step though is to post this question where more people will see it. 

 

Then you need to be clear about the type of hardware you're trying to interface with. 

 

I don't think there's a driver that will work for your microcontroller.  But perhaps you can communincate with it serially?

 

http://forums.ni.com/t5/LabVIEW/serial-communication-betwen-microcontroller-and-labview/td-p/1397024

 

 

---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 20 of 22
(2,798 Views)