LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

case structure with string output

I have a case structure with different buttons that activate corresponding lights, at the moment.  I would like for the buttons to also activate a string output.

Example:
If button 1 is pushed, then the corresponding light will turn on, and string 1 will be constantly output (for a different subsystem).

Thank you,
Jim
0 Kudos
Message 1 of 6
(3,570 Views)
Place the string indicator terminal to the right of your event structure. Now place appropriate string diagram constants in each event case and feed them all through the same output tunnel to the string indicator.
 
You could simplify your code quite a but by using arrays instead of individual FP objects. 😉
0 Kudos
Message 2 of 6
(3,557 Views)
I've tried this, but am getting bad circuits. 

I've added a little more of my complete code to show you what I am trying to attempt here.  For each button pushed, I would like a new corresponding string to be contantly output to the COM port.

(I am using ver. 8.2.)

- Jim
0 Kudos
Message 3 of 6
(3,534 Views)
Well, if you want to "constantly" output your string, you cannot block the while loop with an event structure. Currently it only spins exactly once whenever a button changes. To transmit a command once whenever the corresponding event occurs, you would wire it as follows (place all the constants inside its event case).
 
 
 
To constantly output the desired command, you would place the string in a shift register and place the serial code in the timeout case, for example.
 
A good troubleshooting tool is execution highlighting. Try it! 🙂


Message Edited by altenbach on 11-12-2007 11:40 AM
0 Kudos
Message 4 of 6
(3,517 Views)
I was able to solve it.  I hope this helps others.  See attached file.

- Jim Q
0 Kudos
Message 5 of 6
(3,489 Views)
This is not a good solution because you are dealing with a race condition.
 
Most likely you write to the serial port before valid data has been written to the value property node of the string. All you need to do is wire the string output of the event structure to the serial node and turn the "written" indicator into an indicator (right-click...change to indicator). You don't need the property node!
 
Since the string receives data from the program, it might not be good to have it as a control so the operator can interfere and randomly type something else. 
0 Kudos
Message 6 of 6
(3,485 Views)