![]() |
Help with Relay Code in Labview
1 Attachment(s)
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! |
Re: Help with Relay Code in Labview
You're getting a red dot becuase the data types do not match. you can fix this by using the enumerated type def the relay uses instead of floats.
(From memory, may be wrong on some things) Step one: Delte wire to relay set port, the '0', and '2' on the T/F gate Step two: Right click on the relay set port and click "create constant" Step one: Delte wire to relay set (but not the new constant) Step three: Copy this variable and wire up one each to the inputs of the T/F gate Step four: Rewire T/F gate to relay set port Step five: Left click on the constants to set them to the status you want. This should bring up a drop down menu giving "off/forward/revers/on" as options. This should not select the constant for movement around the screen. |
Re: Help with Relay Code in Labview
Good memory! Worked as you said. Thanks so much!
|
Re: Help with Relay Code in Labview
Quote:
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. |
| All times are GMT -5. The time now is 06:31. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi