From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-17-2019 03:57 AM
Hello gents, I would like to ask how I can give or not a command with a string (text): if I enter (or select) 'OK' my subVI will run, if I enter (or select) 'FAILURE' my subVI will not execute its tasks. Thanks in advance.
Solved! Go to Solution.
10-17-2019 04:05 AM - edited 10-17-2019 04:07 AM
Hi Edmond,
@EdmondDantes wrote:
if I enter (or select) 'OK' my subVI will run, if I enter (or select) 'FAILURE' my subVI will not execute its tasks.
In LabVIEW a case structure is used to implement this typical pseudocode:
IF condition THEN do something ELSE do something different ENDIF
10-17-2019 04:13 AM
I understand, but a user (who knows the result of an external test,but who doesn't know how my VI works) is supposed to select or to text "OK" or "FAILURE" and according to this condition a subVI will execute or not.
So, can the condition of this case structure be a string or a select of "OK" or "FAILURE"?
10-17-2019 04:21 AM
Hi Edmond,
@EdmondDantes wrote:
So, can the condition of this case structure be a string or a select of "OK" or "FAILURE"?
Why don't you read the LabVIEW help for case structures? It explains all datatypes the case structure can handle at its selctor input…
10-17-2019 05:38 AM
ok, THANKS.
May I just ask you how to create a control display that can make me select 'OK' or 'FAILURE', so that I can send the condition to the case structure. I tried with text ring control and with combobox control but I didn't success.
10-17-2019 05:47 AM
10-17-2019 06:37 AM
Hello Endmond,
what and how did you do so far? Can you attach a (simplified) VI showing your not working solution?
10-17-2019 06:47 AM
I cannot attach the subVI, but I can explain in details the situation:
I'm dealing with some tests, if the test successes (and the user knows it), the user has to enter or select 'OK' (as a text/string) and then, through the case structure, I will tell the subVI to not execute cause it is not needed.
On the other hand, if the test fails I have to calculate with this subVI some parameters: the user has to enter or select 'FAILURE' to tells the subVI to execute.
But I'm not familiar with string, so I cannot how to manage boolean text and stuff. I have the clear idea in my mind, but I don't know how to move the first steps.
10-17-2019 06:54 AM
Hi Edmond,
@EdmondDantes wrote:
the user has to enter or select 'OK' … if the test fails … the user has to enter or select 'FAILURE' to tells the subVI to execute.
Put two buttons on your frontpanel and label them "OK" and "FAILURE". The user clicks one of them.
Use an event structure to detect which button is pressed…
10-17-2019 07:13 AM
I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
Learn LabVIEW