09-17-2010 02:19 PM
Hi
I have built my almost first and simple program that reads the NXT 2 color sensor value and present it on the brick display and also (when I use debug mode should be displayed on the PC.
Since the new NXT toolkit does no allow to set if to generate light , I used the case structure connected to a toggle switch control
See attached program screen shots
During Runtime i get the following error message :
Problem: Booleans with a latch mechanical action are not supported by the debugger.
Suggestions: - Change the boolean to have a switch mechanical action. Right-click the boolean and under Mechanical Action, select a switch mechanical action.
I do not understand this meaning nor did I find any mechanical action when i pressed tright-click on that icon?
Any idea?
Thanks
Moshe
Solved! Go to Solution.
09-18-2010 12:51 PM
I don't have any real experience with NXT, but generally, boolean controls in LV can have one of several modes of operation when you click them. The error window tells you how can fix this - right click the boolean control (on the front panel) and select a different mechanical action.
This is a fairly basic concept in LV. It sounds to me like you should try looking at some of these tutorials.
Also, there's an NXT board here. I assume they might point to more tutorials.
09-18-2010 01:32 PM
Hello
I found the machine setting for the bolean and tried all avaliable options but neither worked, I did not use any latch option
Moshe
09-20-2010 12:21 PM
Try right clicking on the stop button on the front panel, expand Mechanical Action and select Switch when Pressed. Please post back if that fixes the error.
09-20-2010 12:38 PM
This error is most likely refering to the Stop button you have to stop your code. Right click on the stop button on your front panel and go to "Mechanical Action->Switch when pressed" That should fix your issue.
09-20-2010 05:41 PM
Thanks
The stop button indeed was not set Stop when pressed, I am not sure if it was setting it in a latch position or was it initially created that way. but anyhow the error gone now.
But, this leeds me to a second question : when i run the program in debug mode the program starts with the led on or off depending on the toggle switch position. but why is the switch not affecting the light during execution?
Moshe
09-21-2010 10:28 AM - edited 09-21-2010 10:28 AM
You should probably add a wait (ms) vi to your loop so as not to overtax the processor. This will lead to better responsiveness of the UI.
09-21-2010 03:20 PM
Hello
Let me clear the question (see attached vi)
There are two similar Vi's. Both need to do the same function: measure light intensity and disply the value on the chart with an option to the user to switch (during debug run) the flood light on or off.
The first vi is working ok and the second is not
The vi that is not working is using the new NXT color sensor sub vi (that has no input for light on/off) and therefore i used a case structure to check the control.
What am I missing here? is it the use of the case structure?
Thanks
Moshe
09-22-2010 07:52 AM
Hello
Just found out that if I take the control icon out of the loop in the second vi everything is working OK (see atached vi)
How come that in the first program the control was working OK inside the loop but on the second (the one that uses case structure) I had to take the control out of the loop ?
Can anyone help
Moshe
09-23-2010 10:44 AM
If you place the control outside of the loop it will read once then use that value for every iteration of the loop. If you put it in the loop it will read the current value after each iteration.