crichter Posted September 14, 2011 Report Share Posted September 14, 2011 Refering to the attached VI, please help me make my first while loop behave like the second, upon pressing of the booleon. The labview style guide says I should use "value change" in most cases. I have tried "mouse up" and "mouse down" to no avail. I have also tried all six options for mechanical action on the booleon and tried wait 50 mS instead of the "-1" on timeout. Flashing string indicator1.vi Quote Link to comment
Ton Plomp Posted September 14, 2011 Report Share Posted September 14, 2011 Your bottom while loop runs continiously, and the sinus gets simultated every 0 ms (try to add an indicater to the loop counter and see how fast it goes, it also utilizes full power of your CPU, that is bad coding style and the speed of blinking will depend on the used computer. If you want to flash with every boolean press, you can use the 'New Value' of the Value changed event, for your case structure. If you want a timed flash, you can abuse the time-out event, the only thing you need to make sure is that you don't have other events that can reset the time-out: Ton Quote Link to comment
crichter Posted September 15, 2011 Author Report Share Posted September 15, 2011 Thanks Ton, My intention is to have the string flash after a certain button is pressed. The user then inputs new data into the string and essentially presses an "enter" button which will stop the flashing. Quote Link to comment
Ton Plomp Posted September 15, 2011 Report Share Posted September 15, 2011 There are several options to do so. Your first start with a seperate loop will work, however I would use a 'Wait n ms' function instead of your square block function. Where the changing only happens if the button is True (You reset the button with a Value change of the string). Or a seperate VI that you tell to start and stop, with a reference to the string control. Ton Quote Link to comment
crichter Posted September 16, 2011 Author Report Share Posted September 16, 2011 Sorry Ton. I don't understand what my "square block function" is. Quote Link to comment
Ton Plomp Posted September 16, 2011 Report Share Posted September 16, 2011 The express VI you use to create a block-form wave to switch on and of the blinking. Ton Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.