PDA

View Full Version : Axis camera without the cRIO


CrazyCarl461
12-19-2008, 09:46 PM
Does anyone know if it is possible to access the Axis camera inside LabVIEW VIs while the camera is plugged directly into the computer instead of going through the cRIO? When I use the Axis camera VIs in the WPI Library and wire all of the parts (Open, Start, IMAQ Create, Get Image, Stop, Close) to an image display on the front panel, I get a bunch of error dialogs come up. The funny thing is the image display does update successfully, so I know it is at least theoretically possible. The errors look something like this:

Error 1 occurred at Release Notifier in Camera.lvlib:Acquire Image.vi:3

Possible reason(s):

LabVIEW: An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.

I am developing code in the Vision Assistant and want to create VIs as per the Image Processing tutorial (http://decibel.ni.com/content/docs/DOC-2929) to test them (as the Vision Assistant does not allow continuously-updating images from the camera). The NI/WPI folks may have disabled direct access to the camera to keep people from abusing their FRC LabVIEW licenses, but I think it would be really useful to test vision code without a cRIO around. Anyone been able to do this?

Jon236
12-19-2008, 09:55 PM
Is this what you are looking for? As long as you don't use FPGA dependent VI's, you can run your code. Just be sure to put it under the 'My Computer' target.

CrazyCarl461
12-19-2008, 10:22 PM
It must be a problem with my WPI Libraries or configuration because I get the same errors with that VI too. Stuff like:

Error 66 occurred at TCP Wait On Listener in TCP Listen.vi:6->Camera.lvlib:Send Images To PC.vi:5

LabVIEW: The network connection was closed by the peer. If you are using the Open VI Reference function on a remote VI Server connection, verify that the machine is allowed access by selecting Tools>>Options>>VI Server:Machine Access on the server side.

However, I did notice (because that VI has a continuous loop) that the errors only come up while the camera is being started. After I close out the initial errors, the image display continues to update fine until I stop the VI.

Hopefully I can find the source of these errors. They may be due to a slow connection to the camera. Thanks for the VI, Jon!

koo_04
12-20-2008, 12:42 AM
Hello,
I was trying to use the VI to test the camera, but when ever I try to run it. I get a bunch of errors.

Error 60 occurred at TCP Create Listener in Internecine Avoider.vi->TCP Listen.vi:2->Camera.lvlib:Send Images To PC.vi:1

And more.
I dont know if its because I am running on vista? But I would lik esome help. Thanks!

Greg McKaskle
12-20-2008, 06:56 AM
Nothing was disabled, but the WPI libraries are specifically built to work on the cRIO and allow stuff to be sent back to the dashboard. I think the errors you are seeing are just the Back to Dashboard stuff being confused.

If you set your computer up to be on a 102.168.0.x subnet, with x something other than 90 because that is the camera, and you have an account on the camera, I believe the VIs will work. I may look at modifications so that they don't produce errors.

If you want to modify them, you can temporarily disable launching the Back to PC stuff. Let me know and I'll help.

Greg McKaskle

rsisk
12-20-2008, 08:44 AM
If you set your computer up to be on a 102.168.0.x subnet, with x something other than 90 because that is the camera, and you have an account on the camera, I believe the VIs will work. I may look at modifications so that they don't produce errors.

I think you meant to set the IP address to 192.168.0.x, right?

Greg McKaskle
12-20-2008, 09:23 AM
Yep, 192. Oh I miss DHCP.

Greg McKaskle

CrazyCarl461
12-20-2008, 12:41 PM
If you set your computer up to be on a 192.168.0.x subnet, with x something other than 90 because that is the camera, and you have an account on the camera, I believe the VIs will work.

The camera does work on DHCP but explicitly specifying the computer's IP address and subnet does seem to get rid of all the TCP errors like you say. This leaves only the Error 1 occurred at Release Notifier in Camera.lvlib:Acquire Image.vi message about an invalid input parameter.

This topic does seem to be double-threaded now, but maybe it means we'll resolve it twice as fast!

Jon236
12-22-2008, 10:23 AM
Here's another example. By taking the ServoCamera example in the FRC distribution, I simply got rid of the servo control loop (good reason to have it separate from the camera loop) and retained the reference to the servos by changing a control to an indicator. I also try to translate the gyro output into motor control inputs.

Greg McKaskle
12-22-2008, 07:59 PM
Looking into this a bit further, you will likely see an error on startup and another on shutdown. These errors are running through code that is ensuring that a reference isn't left open, and is in turn producing an error that it wasn't ignoring on the desktop version.

These errors will disappear with the next update.

Another point I'll make regarding the PC vision. You should keep in mind that algorithms and tests developed on the PC may cause you to be far too ambitious. In general, I find that a PC is eight to ten times faster than the cRIO at vision processing. This is expected when looking at clock rates and computer architecture, but this is good to keep in mind when writing code destined for a different platform.

Greg McKaskle

Jon236
12-22-2008, 08:05 PM
Another point I'll make regarding the PC vision. You should keep in mind that algorithms and tests developed on the PC may cause you to be far too ambitious. In general, I find that a PC is eight to ten times faster than the cRIO at vision processing. This is expected when looking at clock rates and computer architecture, but this is good to keep in mind when writing code destined for a different platform.

Greg McKaskle

Greg. would you suggest adding a wait until timing vi then? what sort of delay for each loop, 100 ms?

Greg McKaskle
12-22-2008, 08:29 PM
Greg. would you suggest adding a wait until timing vi then? what sort of delay for each loop, 100 ms?

What I've done is simply to time the processing and apply a multiple. Note that the camera frame rate is controlled by the camera settings and lighting, and not by the processor speed of the cRIO.

Greg McKaskle

EMill09
01-17-2009, 09:53 AM
I am having the exact opposite problem with the Axis and the Dashboard
The camera images will not show up on dashbaord when hooked up to the cRio I get this error:

TCP Close Connection in Camera.lvlib:Get Image From Controller.vi->Dashboard Main.vi