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.
01-14-2022 11:28 AM
Great afternoon Labview team,
I was trying to get assistance in converting string to boolean to illuminate the corresponding LED, please refer to attachment. I had issues trying to figure out move pen VI, need more instruction. I just want to match the string to the correct LED to identify valve position.
01-14-2022 12:38 PM
01-14-2022 12:51 PM
I know the result string is going to be go1, go2, go3, go4, go5, go6, trying to figure out how to change string to Boolean? Is there a way to convert string to illuminate the corresponding LED?
01-14-2022 01:12 PM
I cannot see your code to get a better idea, but I believe a simple case structure with your string as the case selector input should work. Based on the received string (go1, go2, etc), you can switch the respective led (as boolean constants).
Cheers,
Renato.
01-14-2022 01:14 PM
I was able to come up with this, it functions to identify the correct valve. Only issue is the time the LED stays illuminated, its too short. Any recommendations?
01-14-2022 01:23 PM
that code section inside the event strucure is attached to a 100ms timeout, that is, every 100ms the serial buffer will be read. In case there is no new data to read, nothing will be sent to the leds. Try to increase that time or even define other event. Moreover, do you really need an event structure for that?
01-14-2022 01:27 PM
Something like this work?
(Haven't seen the code yet)
James
01-14-2022 01:38 PM
I increased the time, but that only changed how long it took to read and write. Should I put that portion of the VI in a while loop?
01-16-2022 10:07 AM
Use a case structure as Renaldo said, creating a case for each possible outcome. Every case defaults to "False" and the selected case goes to "True". Take all of the Boolean outputs and build them into an array and create an indicator for this array. Create a property node for this indicator so you can reset the LED's to all "False" at the beginning of the vi. The proper LED in the array will stay lit until the vi is run again.
01-17-2022 01:56 AM
@JC54 wrote:
Use a case structure as Renaldo said, creating a case for each possible outcome. Every case defaults to "False" and the selected case goes to "True". Take all of the Boolean outputs and build them into an array and create an indicator for this array. Create a property node for this indicator so you can reset the LED's to all "False" at the beginning of the vi. The proper LED in the array will stay lit until the vi is run again.
So nothing like the code I posted at all???😉
the only thing wrong is the simulation of the go string and breaking it out into multiple processes.
It could be done as one function instead.
James