Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Dashboard display (http://www.chiefdelphi.com/forums/showthread.php?t=127459)

Mike AA 03-03-2014 22:37

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?

Greg McKaskle 04-03-2014 06:34

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

Mike AA 04-03-2014 12:09

Re: Dashboard display
 
Thanks Greg I will try that tonight

Mike AA 15-03-2014 17:47

Re: Dashboard display
 
4 Attachment(s)
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.

Alan Anderson 15-03-2014 23:38

Re: Dashboard display
 
Quote:

Originally Posted by Mike AA (Post 1359311)
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?

Mike AA 16-03-2014 20:59

Re: Dashboard display
 
Alan,

Thanks for looking at it.

Quote:

Originally Posted by Alan Anderson (Post 1359420)
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 (Post 1359420)
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 (Post 1359420)
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?

Kevin Phan 16-03-2014 21:34

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.

Mike AA 16-03-2014 22:47

Re: Dashboard display
 
3 Attachment(s)
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.

Kevin Phan 17-03-2014 18:00

Re: Dashboard display
 
Are you using the Boolean array read and write vis for the compressor or just the normal vis?

Mike AA 17-03-2014 18:59

Re: Dashboard display
 
Just normal read boolean and write boolean

Kevin Phan 17-03-2014 19:09

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.

Mike AA 17-03-2014 20:11

Re: Dashboard display
 
Quote:

Originally Posted by Kevin Phan (Post 1360532)
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.

The air compressor works fine in real life, pressure switch connects and compressor runs. On my test bed I am doing this simply by connecting ground to my digital I/O port and I see the compressor relay LED turn on.

The difficulty I am having is trying to get an indicator on the dashboard to turn on when the compressor is running, that's all.

I got my ultrasonic sensor working and giving me inches from the metric sensor via some simple math.

I must be missing something

Kevin Phan 17-03-2014 20:20

Re: Dashboard display
 
I know, but I have done the same thing as you did for your compressor and I am getting normal feedback. I used a Boolean array write and get vi to get the values of when the compressor is running and if the compressor is enabled. I can not see why your code is not working at all. I know I shouldn't be asking this, but by ground you do mean the power, ground and signal wires are all connected to the digital sidecar right?

Mike AA 17-03-2014 20:48

Re: Dashboard display
 
Quote:

Originally Posted by Kevin Phan (Post 1360558)
I know, but I have done the same thing as you did for your compressor and I am getting normal feedback. I used a Boolean array write and get vi to get the values of when the compressor is running and if the compressor is enabled. I can not see why your code is not working at all. I know I shouldn't be asking this, but by ground you do mean the power, ground and signal wires are all connected to the digital sidecar right?

yes



Frustrated with this I hooked up some indicators to a limit switch and it works fine. It must be something with where I am connecting to the compressor. Could you post a picture of your compressor code?

Kevin Phan 17-03-2014 21:37

Re: Dashboard display
 
1 Attachment(s)
Sorry about your frustration :( . I think this is the setup I made for the compressor. I don't have access to the team's programming laptop, but I'm fairly certain this is close to what it is. The read vi is the dashboard code and yes it should be in a while loop, but I wrote this in a new project and I didn't bother to make another project. I will post a picture of the actual code I made tomorrow night. Again, I am sorry about the frustration about your compressor.


All times are GMT -5. The time now is 07:01.

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