PA-Paul Posted August 6, 2009 Report Share Posted August 6, 2009 Hi all, I have a small problem I'm not sure how to deal with. I've written a subvi to control the movement of a stepper motor. The subvi sends the appropriate command to make the motor perform a movement and then monitors the stepper driver until the movement is complete (it's marginally more complex than that - it deals with limit switches on the drives and a hardware E-Stop implementation as well). What I want is for the top level VI which calls this subvi to know when the drive is in motion. I have a boolean control within the subvi, but obviously, the top level vi can't see that. I created a (boolean typed) control reference and property node within the subvi and hooked it up to the connector pane. This works as I expected, but I want this functionality to be optional - and if I don't connect a control reference to the subvi, I get an error saying "invalid reference". How do I make it not worry if I don't wire a reference in? Thanks in advance! Paul Quote Link to comment
silmaril Posted August 6, 2009 Report Share Posted August 6, 2009 There is a function called "Not a Number/Path/Refnum?" on the comparison palette. Use this to check if the reference is invalid (which will be the case if the reference input is unwired). Quote Link to comment
PA-Paul Posted August 6, 2009 Author Report Share Posted August 6, 2009 Brilliant, had forgotten about that. Thanks! 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.