Test Mode

I read the test mode tutorial but I would like to see some examples of test mode code to put in the vi. If I want to see if am getting a digital signal from a magnetic switch on my solenoid how would I write the code?

You don’t need to write any code for that. Jut put the robot in Test Enabled and click on the Test tab on the Dashboard. Then find the appropriate Digital Input in the list and observe the value.

Yep. Test mode supports immediate viewing of the most common settings and value of sensors and actuators. It allows you to test most actuators. And it also has a plug-in for running self-tests. This is where you’d plug in a VI to run the elevator up and down and verify the limit switches, pots, etc.

Greg McKaskle

Thanks, we used it to test a digital input we programmed and it worked fine, we did have problems testing the compressor though. When we tested the compressor the spike never changed color and the compressor never started. When we switched to teleop the compressor did not work. Rebooted the crio went to teleop compressor worked. Switched back to test mode and same issue.
Any ideas?

I don’t have a test rig handy, but I’ll try to remember to test it on one tomorrow. Test mode went in late in the beta and had only basic testing, so it could be that you’ve found a bug. Thanks for the good description of your issue.

Greg McKaskle

The most likely thing you are seeing is that Test mode has a side-effect of stopping the compressor. If you simply start it in Begin and never expect anyone to stop it, then test mode is breaking that assumption.

If you want to put a Compressor Start in Disable or somewhere else in your code, like in teleop on a button, that will fix it.

While looking, I also found a few issues with how test mode controls the compressor. At least in the code I was looking at, it would start but turn off the relay each second. I’ll fix that for next year.

Greg McKaskle