![]() |
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:
|
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. |
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. ![]() |
Re: Refnum Defining
Nothing strikes me as obviously wrong with what you posted. How are you running the code?
|
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 |
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.
|
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.
|
Re: Refnum Defining
Quote:
|
Re: Refnum Defining
Quote:
|
Re: Refnum Defining
1 Attachment(s)
Quote:
Attached is my code and a picture of the error message. ![]() |
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.
|
Re: Refnum Defining
How are you running the code? I don't see a Robot Main vi window open anywhere.
|
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...
|
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.
|
Re: Refnum Defining
Quote:
Also your indicator is going to appear in the teleop front pannel not the driver station or robot main front pannels. You can have these front pannels open when the program is running though without any problems |
| All times are GMT -5. The time now is 11:48. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi