03-23-2012 08:09 AM
hi all
lm having problem with my Vi, my sub-vi works fine but when i go run the main Vi which is the forward action with true/false boolean switchs the porgram gives no responce as if the sub-vi is gives no output
any help would be great
03-23-2012 08:14 AM
Well your fist major problem is that your buttons are outside the while loop so they will only be read when you start the program. Move them inside of the while loop and see if that helps.
03-23-2012 08:23 AM - edited 03-23-2012 08:24 AM
You also got another problem; Your sub-VI will run for ever if you had no buttons pushed when your run your program. You send "0" to the sub-VI and in the sub-VI you increment the value of your shiftregister and then check if the value = the input, which will never happen.
03-23-2012 08:24 AM
03-23-2012 08:37 AM
OK here is a start to what you need to do. I added an event structure and reworked you code a little. This should give you the concepts to get going further.
03-23-2012 08:38 AM
You will eventually have to have a way to get out of the main loop other than using the stop sign. That is very bad practice. You need to add a stop button. I left it the way you did it just in case you had a reason for doing this that I do not see.
03-23-2012 08:55 AM
I forgot to change the mechanical action of the buttons. Here is a corrected version.