Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Using the analog sensor .vi's (http://www.chiefdelphi.com/forums/showthread.php?t=72019)

Hazmatt 13-01-2009 09:18

Using the analog sensor .vi's
 
So after 6 hours of troubleshooting, my programming team and I have finally found out why the analog sensors vi's weren't working in labview. First of all, when the "open" vi asks for a channel and slot input, instead of just putting in 1, 2, etc... we needed to put in "slot one" and "AI 1" for slot one channel one. Secondly, since we didn't have any analog output devices we decided we would just use channel 8 in slot one, which should have given us a modified battery voltage response. The only problem is that it seems that there is a conflict with this situation. I believe that since the DS is also trying to read the battery voltage from this channel, and so there is some sort of a programming conflict and the battery voltage won't show up in labview. I don't know if there is any work around to this problem, I just thought I would let other teams know in case there were in the same situation as ours.

Greg McKaskle 13-01-2009 09:32

Re: Using the analog sensor .vi's
 
The first part of that, using 1 instead of the enum "AI 1" will result in a coercion dot, and will work as long as you know the encoding. This is sometimes useful when casting between enums or when using a loop to get all values. So in other words, this isn't really an error, but when doing constants, it is much more readable to use the specific ones.

Greg McKaskle

Hazmatt 13-01-2009 17:38

Re: Using the analog sensor .vi's
 
Quote:

Originally Posted by Greg McKaskle (Post 800070)
The first part of that, using 1 instead of the enum "AI 1" will result in a coercion dot, and will work as long as you know the encoding. This is sometimes useful when casting between enums or when using a loop to get all values. So in other words, this isn't really an error, but when doing constants, it is much more readable to use the specific ones.

Greg McKaskle

Hm, i'm really interested to know where I could have read about this beforehand.

BLAQmx 13-01-2009 20:47

Re: Using the analog sensor .vi's
 
When make controls and constants for in LabVIEW (especially for WPILib) it will help you greatly if you right-click on the input terminal and select Create » Constant/Control. This will ensure the constants and controls are the correct data type(s) etc.

Greg McKaskle 13-01-2009 22:49

Re: Using the analog sensor .vi's
 
Anytime you are given a subVI that you intend to use, I recommend looking at the front panel. You will usually get a better sense of what the author intended to have wired in. You can then copy/paste, or from the icon create control or constant. The create... is a short cut to opening and copy/paste.

Greg McKaskle

PhilBot 13-01-2009 22:57

Re: Using the analog sensor .vi's
 
Quote:

Originally Posted by BLAQmx (Post 800462)
When make controls and constants for in LabVIEW (especially for WPILib) it will help you greatly if you right-click on the input terminal and select Create » Constant/Control. This will ensure the constants and controls are the correct data type(s) etc.


I call that action the "easy button" with my team.

I can't beleive there isn't a hotkey for "create constant"


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

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