Quote:
Originally Posted by burde1jb
I'm attempting to fix a red dot of trouble in our Teleop code. As seen in the attached picture of the code [BOTTOM RIGHT], we are using Button 3 of the controller to send the Spike Relay into the forward position (we used a numerical value of "2" because we could not pull up the Enum Constant which provides forward/reverse/on/off, but that is another section of help...).
Sending the two values through the T/F gate and onto the Relay Set, we get that little red dot which we know from past experience does not mean anything good. Any advice as to how to fix the issue would be appreciated. Thanks!
|
The red dot just means that a data type cast is taking place. You are providing values with double precision float point type (coloured orange in LabVIEW), but the Relay Set VI is looking for an enum constant of the appropriate type (which is really just a relabeling of a uint of some sort - mapping one label to 0, another to 2, as you've done in your code). Assuming 0 and 2 are the values you want (couldn't help you here, you'll have to check this in LabVIEW - see below), the code will correctly cast your float types to uint types, and it should work fine.
However, the proper way to do this is, of course, to use the enum constants. As adciv pointed out, you can access the enum type by right-clicking the terminal on the Relay Set block, and selecting "Create Constant." Furthermore, if you right-click the enum constant and on the context menu select "Edit Items," you'll see the label-to-uint associations I mentioned above.