LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically add case to case structure

Solved!
Go to solution

Hi guys

 

I have a simple command application. Now this command application has only 4 basic command and their corresponding case value. But as we test the board we want to send some arbiters command and if that command works we basically "save" this command and test further. But as the labview application is done at one place and run at different place I can't update the program. Can this be done dynamically?

 

Thanks & Regards

 

Niladri 

0 Kudos
Message 1 of 10
(6,207 Views)

But your firmware from which you are playing command response game, It should recognize the command you sent.

 

If you are adding the command later then how you are going to manage this ?

Labview program should be tested with new command

 

Dont you agree ?

 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 2 of 10
(6,201 Views)

I can manually feed command using "Prompt user for Input" vi. As the Description part of the command is always same(DBC0) I can add the contingency part(DBCOxxxx. xxxx is the contingency part of hexadecimal value). So I can give 0000 to FFFF at each channel of the board and test that it respond or not and onec that particular channel does changes its state the we say this is on/off value for that channel and we save this command and try new channel.

0 Kudos
Message 3 of 10
(6,189 Views)
Solution
Accepted by Newbee_3

In theory, you could detect the new command, save it in an array, and then see that you get it again (using Search 1D Array).  But how you process that command is where you get into problems.  In short, an additional case cannot be added to a case structure while the VI is running or after it has been compiled into an exe.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 10
(6,185 Views)

Thanks for the response. So any other method that I can use? In forum n other places I found that dynamically I can't add value in ENUM variable. I really don't want to add the newly made command to log it a text file add it latter at next version release.

 

Thanks & Regards

0 Kudos
Message 5 of 10
(6,179 Views)

Darin shows how to use tags in a VI to save control values.  My example uses a Combo Box instead of your enum because, as you've noted, you can't dynamically add elements to an enum.  The blue sub-VIs are from Darin's post; you'll need to download them.  This works with a VI in the development environment; I think you're back to an ini file if it's built into an executable.

 

Example_VI.png

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 6 of 10
(6,174 Views)

Thanks Mr.. jcarmody this VI actually solves one of my problem but about case structure... Nothing can be done dynamically? Can I use event structure will that update dynamically

 

Thanx & Regards

 

Niladri

0 Kudos
Message 7 of 10
(6,131 Views)

You won't be able to update any structure dynamically while the VI containing the structure is running.  My solution updated the array with any new command that you'd like to add.  You don't need a Case structure to get the command string; just loop through the array.

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

0 Kudos
Message 8 of 10
(6,118 Views)

The new command string will contain the corresponding value. Now if I loop through the array will I get the corresponding value??

 

Thanks & Regards

 

Niladri

 

0 Kudos
Message 9 of 10
(6,093 Views)

Now if I loop through the array will I get the corresponding value?? 

Yes.  My example shows how the new command string is found in the array.

Example_VI_BD.png

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

0 Kudos
Message 10 of 10
(6,078 Views)