|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
||||
|
||||
|
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? |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
||||
|
||||
|
Re: Dashboard display
Thanks Greg I will try that tonight
|
|
#4
|
||||
|
||||
|
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. |
|
#5
|
|||||
|
|||||
|
Re: Dashboard display
Quote:
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? |
|
#6
|
||||
|
||||
|
Re: Dashboard display
Alan,
Thanks for looking at it. Quote:
Quote:
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:
|
|
#7
|
||||
|
||||
|
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 |
|
#8
|
||||
|
||||
|
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. |
|
#9
|
||||
|
||||
|
Re: Dashboard display
Are you using the Boolean array read and write vis for the compressor or just the normal vis?
|
|
#10
|
||||
|
||||
|
Re: Dashboard display
Just normal read boolean and write boolean
|
|
#11
|
||||
|
||||
|
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.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|