Go to Post Let me tell you, the scariest day ever was the day that I realized since I am a mentor, people actually take my advice and I should be careful of what kind of advice I give. :ahh: - Elgin Clock [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-06-2014, 10:09
burde1jb's Avatar
burde1jb burde1jb is offline
Registered User
FRC #4327 (Q Branch)
Team Role: Coach
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Battle Creek, MI
Posts: 46
burde1jb will become famous soon enough
Help with Relay Code in Labview

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!
Attached Thumbnails
Click image for larger version

Name:	4327SampleCodeTeleop6242014.jpg
Views:	108
Size:	139.8 KB
ID:	17126  
Reply With Quote
  #2   Spotlight this post!  
Unread 24-06-2014, 10:50
adciv adciv is offline
One Eyed Man
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2010
Location: Southern Maryland
Posts: 478
adciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to alladciv is a name known to all
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.
__________________
Quote:
Originally Posted by texarkana View Post
I would not want the task of devising a system that 50,000 very smart people try to outwit.

Last edited by adciv : 24-06-2014 at 10:50. Reason: typo
Reply With Quote
  #3   Spotlight this post!  
Unread 24-06-2014, 11:11
burde1jb's Avatar
burde1jb burde1jb is offline
Registered User
FRC #4327 (Q Branch)
Team Role: Coach
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Battle Creek, MI
Posts: 46
burde1jb will become famous soon enough
Re: Help with Relay Code in Labview

Good memory! Worked as you said. Thanks so much!
Reply With Quote
  #4   Spotlight this post!  
Unread 24-06-2014, 11:12
Aren Siekmeier's Avatar
Aren Siekmeier Aren Siekmeier is offline
on walkabout
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: 대한민국
Posts: 735
Aren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond reputeAren Siekmeier has a reputation beyond repute
Re: Help with Relay Code in Labview

Quote:
Originally Posted by burde1jb View Post
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.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:48.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi