Quote:
Originally Posted by Mark McLeod
Yea, your data type in Autonomous is a floating point number not the integer type of the Case. The floating point number doesn't equal any of the integer cases, so it is taking the default.
The problem exists on both the Dashboard side and the robot side.
You need to write/read an integer on both sides and you need to make sure the enum order matches the numbers you expect.
|
This is how I managed the different datatypes in our code. (The image contains two screenshots, one from the dashboard and one from the robot code.) On the robot code side, the mode is being casted into an enum typedef using the Type Cast function in the Numeric Palette under Data Manipulation.
However, LabVIEW should be (and I assume is) automatically casting the double into an integer, as shown by the red dot in this screenshot that you are referencing:
http://puu.sh/ggnQW/e4c23b7496.png
So technically, that part should be working fine, but it is better to cast it yourself, just as good practice. There is probably some communication issue occurring here, however, so try to recreate the problem in practice with a similar setup to how you run your robot at competition, specifically the boot order and time of connection.