Go to Post I'm probably going to make somebody feel old right now... - NorviewsVeteran [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 Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 03-03-2014, 22:37
Mike AA's Avatar
Mike AA Mike AA is offline
Programmer and Mentor
AKA: Mike Aalderink
FRC #3458 (Code Blue)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Holland, Mi
Posts: 698
Mike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to behold
Send a message via MSN to Mike AA
Dashboard display

I am starting, after all my time working with Labview, to modify the dashboard and use some other sensors. We are hooking up an ultrasonic sensor which I can figure out how to read and display on the dashboard using the dashboard read and write numbers. Following code tutorials and examples I am sure I can get that going easily.

However we would like to put an indicator (already on the dashboard) to show when the air-compressor is running. I have a simple indicator on the dashboard. I am not sure how to read the compressor spike status or the pressure switch status off the robot. Is this even possible without causing the code to crash via recalling the variables?
Reply With Quote
  #2   Spotlight this post!  
Unread 04-03-2014, 06:34
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Dashboard display

Have you caused it to crash doing this before?

My suggestion is that you place the indicator in one of the binding tabs. The Operation and Auto tabs will automatically bind anything placed into them to a SD variable of the same name.

The next step is to publish the spike value on the robot using the same name. So find a place on the robot that makes sense, perhaps periodic tasks, and call the GetEnabledState VI. Write that value to the SD variable. That function tells you whether the compressor control loop is telling the spike to run the compressor. If it is different than what is actually happening on the robot, you may want to check the electrical connections, LEDs, make sure the robot is enabled, etc.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 04-03-2014, 12:09
Mike AA's Avatar
Mike AA Mike AA is offline
Programmer and Mentor
AKA: Mike Aalderink
FRC #3458 (Code Blue)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Holland, Mi
Posts: 698
Mike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to behold
Send a message via MSN to Mike AA
Re: Dashboard display

Thanks Greg I will try that tonight
Reply With Quote
  #4   Spotlight this post!  
Unread 15-03-2014, 17:47
Mike AA's Avatar
Mike AA Mike AA is offline
Programmer and Mentor
AKA: Mike Aalderink
FRC #3458 (Code Blue)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Holland, Mi
Posts: 698
Mike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to behold
Send a message via MSN to Mike AA
Re: Dashboard display

Finally had a chance to respond and apparently hooking up the sonic range finder isn't as easy as I thought and I am not getting the compressor indicator to work.

I ran the analog range finder program from my computer after changing the ip address of the crio and I get values from the range finder, not accurate since someone ordered a metric range finder... but atleast i know the port and range finder are functional.

With regards to the compressor indicator I think I have the code correct but somehow not getting it to send to the dashboard and say true. I am just looking at the variables tab within the dashboard on the driverstation.

The compressor just says false (the compressor works properly otherwise)
The range finder just shows 0.000

What am I missing? There are not any errors that pop up int he diagnostic tab and the controller otherwise seems to function normally. The is on a test board mounted from the ceiling.
Attached Thumbnails
Click image for larger version

Name:	compressorbegin.png
Views:	35
Size:	14.0 KB
ID:	16560  Click image for larger version

Name:	compressorperiodic.png
Views:	36
Size:	29.7 KB
ID:	16561  Click image for larger version

Name:	rangebegin.png
Views:	31
Size:	13.0 KB
ID:	16562  Click image for larger version

Name:	rangeperiodic.png
Views:	27
Size:	27.2 KB
ID:	16563  
Reply With Quote
  #5   Spotlight this post!  
Unread 15-03-2014, 23:38
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Dashboard display

Quote:
Originally Posted by Mike AA View Post
With regards to the compressor indicator I think I have the code correct but somehow not getting it to send to the dashboard and say true.
compressor:
It looks like you are only setting the Smart Dashboard variable once when the program begins. Unless you put the CompressorGetEnableState and SD Write functions in a loop, you won't get updated values.

range:
I don't understand why you're doing the analog configuration every 100 ms. It just needs to be set once, typically in Begin. The only thing you need to do in the Periodic Task loop is read the voltage and set the SD variable.


Thank you for posting your code as vi snippets. It let me clean up the wiring and see something very confusing. In both cases, you are apparently sending the RefNum from the RefNum Get function to a front panel indicator, and the RefNum you are using to read the value is coming from a separate front panel control. Can you explain what you are trying to do there?
Reply With Quote
  #6   Spotlight this post!  
Unread 16-03-2014, 20:59
Mike AA's Avatar
Mike AA Mike AA is offline
Programmer and Mentor
AKA: Mike Aalderink
FRC #3458 (Code Blue)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Holland, Mi
Posts: 698
Mike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to behold
Send a message via MSN to Mike AA
Re: Dashboard display

Alan,

Thanks for looking at it.

Quote:
Originally Posted by Alan Anderson View Post
compressor:
It looks like you are only setting the Smart Dashboard variable once when the program begins. Unless you put the CompressorGetEnableState and SD Write functions in a loop, you won't get updated values.
I guest I didn't get the snippet to show what was in the loop. The CompressorGetEnableState and SD Write functions are indeed in the Periodic Tasks in the 100ms loop. outside is the compressor refnum, control loop and start. The compressor is running properly I just cannot get the dashboard to read the enabled status when the compressor is running. I am trying to have an indicator on the dashboard showing that the compressor is running. Potentially to see that it is running and we might be too low on air to operate something.

Quote:
Originally Posted by Alan Anderson View Post
range:
I don't understand why you're doing the analog configuration every 100 ms. It just needs to be set once, typically in Begin. The only thing you need to do in the Periodic Task loop is read the voltage and set the SD variable.
Everything but the range refnum is, again, in the periodic tasks 100ms loop. Should I only have the get avg voltage in the loop and everything else on the outside?

We are using an ultrasonic range finder a maxbotix MB1013 (its metric, someone accidently ordered metric...) to find our distance from the wall. I am simply trying to post that numer to the dashboard near the same area as the compressor "on" indicator.


Quote:
Originally Posted by Alan Anderson View Post
Thank you for posting your code as vi snippets. It let me clean up the wiring and see something very confusing. In both cases, you are apparently sending the RefNum from the RefNum Get function to a front panel indicator, and the RefNum you are using to read the value is coming from a separate front panel control. Can you explain what you are trying to do there?
Kinda confused about this part unless I explained it above?
Reply With Quote
  #7   Spotlight this post!  
Unread 16-03-2014, 21:34
Kevin Phan's Avatar
Kevin Phan Kevin Phan is offline
College Student
FRC #0357 (Royal Assault)
Team Role: Alumni
 
Join Date: Apr 2013
Rookie Year: 2010
Location: PA, United States
Posts: 95
Kevin Phan will become famous soon enoughKevin Phan will become famous soon enough
Re: Dashboard display

On the dashboard, did you use the same name as the name you wrote for the cRIO robot project for the read vi for the smart-dashboard vis? I see what Alan is talking about, the wire for the get refnum of the ultrasonic is not connected to the vis after it. The floating analog device refnum is what he is referring too, I am also confused as to why do you need that to the front panel. The answer to your question of where the vis should go for your ultrasonic is to have your get voltage and smartdashboard variable inside the periodic task loop only, everything else outside of it.

Last edited by Kevin Phan : 16-03-2014 at 21:40. Reason: Content
Reply With Quote
  #8   Spotlight this post!  
Unread 16-03-2014, 22:47
Mike AA's Avatar
Mike AA Mike AA is offline
Programmer and Mentor
AKA: Mike Aalderink
FRC #3458 (Code Blue)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Holland, Mi
Posts: 698
Mike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to behold
Send a message via MSN to Mike AA
Re: Dashboard display

Thanks guys!

I am now getting values from the sensor just have to adjust my math to convert it to inches. When the snippet happened it pulled the refnum out of its location and just set it randomly in the snippet... not sure what happened there.

The reason we want to see the values is to see how far we are from the wall to shoot the ball into the upper goals.

Attached are the whole screen shots of my periodic tasks and the right panel of the dashboard the the dashboard vi.

The ultrasonic sensor is now working values are changing when I move it closer to the wall and away from the wall.

The compressor still does not change when I connect what would be the pressure sensor contacts. the LED ont he side car turns on indicating the compressor would be running but the indicator on the dashboard does not change.
Attached Thumbnails
Click image for larger version

Name:	dashboard.png
Views:	14
Size:	16.5 KB
ID:	16581  Click image for larger version

Name:	periodic (2).png
Views:	22
Size:	111.2 KB
ID:	16582  Click image for larger version

Name:	dashboardLV.png
Views:	18
Size:	117.8 KB
ID:	16583  
Reply With Quote
  #9   Spotlight this post!  
Unread 17-03-2014, 18:00
Kevin Phan's Avatar
Kevin Phan Kevin Phan is offline
College Student
FRC #0357 (Royal Assault)
Team Role: Alumni
 
Join Date: Apr 2013
Rookie Year: 2010
Location: PA, United States
Posts: 95
Kevin Phan will become famous soon enoughKevin Phan will become famous soon enough
Re: Dashboard display

Are you using the Boolean array read and write vis for the compressor or just the normal vis?
Reply With Quote
  #10   Spotlight this post!  
Unread 17-03-2014, 18:59
Mike AA's Avatar
Mike AA Mike AA is offline
Programmer and Mentor
AKA: Mike Aalderink
FRC #3458 (Code Blue)
Team Role: Programmer
 
Join Date: Jan 2003
Rookie Year: 1999
Location: Holland, Mi
Posts: 698
Mike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to beholdMike AA is a splendid one to behold
Send a message via MSN to Mike AA
Re: Dashboard display

Just normal read boolean and write boolean
Reply With Quote
  #11   Spotlight this post!  
Unread 17-03-2014, 19:09
Kevin Phan's Avatar
Kevin Phan Kevin Phan is offline
College Student
FRC #0357 (Royal Assault)
Team Role: Alumni
 
Join Date: Apr 2013
Rookie Year: 2010
Location: PA, United States
Posts: 95
Kevin Phan will become famous soon enoughKevin Phan will become famous soon enough
Question Re: Dashboard display

I can't see anything wrong code wise, check your connection from your pressure switch on the regulator to the digital side car. Maybe in your begin vi try to specify the digital module, but I can't see if that works.
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 07:01.

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