|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Refnum Defining
I'm having difficulty with having my sensors read to my front panel. I know that the sensors function because they work in the front panel of the example VIs for digital inputs. I've managed to find an error message that tells me that the refnum I'm calling for my "get" statement does not exist. I had thought that I had created the refnum because I followed these instructions:
Quote:
|
|
#2
|
|||||
|
|||||
|
Re: Refnum Defining
What you describe seems correct, but it would be a lot easier to verify if you posted a picture of your code.
Also show us the code where you're doing the Get so we can make sure you're doing that properly as well. |
|
#3
|
|||
|
|||
|
Re: Refnum Defining
Here is the code. If you need more I'll post it. I'm going to try to create a devref for something other than DIO today and see how that works.
UPDATE: I tried using a joystick devref and it gave me the same error in the error console. ![]() Last edited by Pausert : 19-01-2010 at 17:32. |
|
#4
|
|||||
|
|||||
|
Re: Refnum Defining
Nothing strikes me as obviously wrong with what you posted. How are you running the code?
|
|
#5
|
|||
|
|||
|
Re: Refnum Defining
Because the image in the post is clipped, I can't see what the switch statement has wired to it, but the sensor read and the indicator update are conditional. Is it possible that the code in that case of the switch isn't running because of the logic wired to it?
Greg McKaskle |
|
#6
|
|||
|
|||
|
Re: Refnum Defining
The case statement is definitely active. Other things in the case statement function correctly. I know that the error stems from a bad refnum because I created an indicator on the refnum call function and it told me that the refnum I was calling does not exist. I even went as far as to create a constant on the case structure for the case in which I have the sensor code because I was running low on new ideas.
|
|
#7
|
||||||
|
||||||
|
Re: Refnum Defining
Quote:
Last edited by Joe Ross : 20-01-2010 at 12:30. |
|
#8
|
||||
|
||||
|
Re: Refnum Defining
Because the RefNum Get is outside the case structure, it seems it should be getting called - and the error makes me think it is. One thing to try might be to actually make a copy of the "Sensor" text constant wired to the RefNum Set, and wire that into the RefNum Get. This would be just to make sure the names are identical and there isn't some hidden or nonprintable text.
|
|
#9
|
||||||
|
||||||
|
Re: Refnum Defining
Quote:
Last edited by Joe Ross : 20-01-2010 at 12:19. |
|
#10
|
|||
|
|||
|
Re: Refnum Defining
Quote:
Attached is my code and a picture of the error message. ![]() Last edited by Pausert : 20-01-2010 at 14:33. |
|
#11
|
|||
|
|||
|
Re: Refnum Defining
UPDATE: I have reinstalled LabVIEW with the update and it has not solved the issue. Additionally, I tried another laptop and that gave me the same error.
|
|
#12
|
|||||
|
|||||
|
Re: Refnum Defining
How are you running the code? I don't see a Robot Main vi window open anywhere.
|
|
#13
|
|||
|
|||
|
Re: Refnum Defining
From the teleop loop. Should I be running it from main? i thought that running it from teleop wouldn't be a problem as the other refnums didn't return errors...
|
|
#14
|
|||||
|
|||||
|
Re: Refnum Defining
If you don't run the Robot Main vi, the Begin vi doesn't get called. I think that should adequately explain the problem you've been having.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| refnum registry location | Wendy Holladay | NI LabVIEW | 1 | 17-01-2010 22:11 |
| Defining a joystick | dr_jack3l | National Instruments LabVIEW and Data Acquisition | 1 | 12-02-2009 09:59 |
| Defining First code? | mormannoob | Programming | 4 | 17-01-2008 23:36 |
| Defining Leadership | Bomberofdoom | General Forum | 8 | 17-09-2007 14:58 |
| Defining file name? | Mike | Programming | 2 | 08-02-2006 17:28 |