LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQdx: how to send a command to a camera?

Hello,

I would like to send a command to a camera using IMAQdx property node. (I guess it is the way to do. If using the property node is not the right method, please notify me the right method.)

Using the property node I'm able to change parameters of the camera, but the commands are not considered.

Please look at the attached image. When I set the ShutterOpen to true or to false using the property node, for example, it works fine. However, when I want to execute the BackgroundAcquire, it doesn't work. It neither works for other commands. If I add a value to the attribute, it says that BackgroundAcquire is a command and no value can be set (fair enough).

I guess I didn't implement the command execution the right way... So how do I do it?

Many thanks and kinds regards,

Stephan

0 Kudos
Message 1 of 11
(3,474 Views)
  1. I cannot "execute" (and therefore test, inspect, get help on ...) a picture.  Please attach the VI.
  2. What hardware are you using?  Whose Camera?  What model?  How does it connect (USB, TCP/IP, etc.)?
  3. How much experience with IMAQdx and NI Vision do you have?

Bob Schor

 

0 Kudos
Message 2 of 11
(3,445 Views)

Attached, the incriminated VI (Camera_BackgroundRemoval.vi) as well as a quick and dirty example to make it work (camTest.vi) with an open and close camera function.

The camera I am using is a Tachyon 16K from NIT https://www.niteurope.com/en/tachyon-16k/. It is connected over TCP/IP. I am currently able to grab some images and modify the attributes. But I am unable to send a command, whether this BackgroundAcquire function or any other.

I have quite some experience with LabVIEW; I feel overall comfortable with this software. However, it is the first time I try to control a camera and use the NI Vision toolbox and the IMAQdx library.

0 Kudos
Message 3 of 11
(3,427 Views)

Thanks for the code.  As a hint, the best way to submit "big code" is to compress the file containing the Project and attach the resulting .zip file.  When I opened Camera_Open.vi (the first one I looked at), it wanted the definition of type_camera.ctl, which wasn't in my PC (although I do have both Vision Development Module and Vision Acquisition Software installed).  I'm guessing it's a TypeDef associated either with your specific Camera or a TypeDef you created -- in any case, it took 3-4 minutes to look through all of the VIs in the libraries in vilib and instrlib ...

 

The LabVIEW Vision tools are, shall we say, slightly "under-documented", with many details left to the user to "discover by experimentation".  When I first was introduced to IMAQdx, it was also with respect to a network-connected camera.  It took quite a few "experiments" to get the idea of an "image" clear in my head (it is not a "collection of pixels", but rather a reference to a "collection of pixels").

 

Have you tried using the low-level function IMAQdx Enumerate Attributes?  I recommend writing an "Experiment VI" that opens this and generates a "report" for you listing all the Attribute Names, their Type (pay special attention to those with the Enum Type) and their Read/Write Attributes.  I notice that you don't set any value for Background Acquire -- is this an oversight (i.e. "bug")?  I trust the other Attributes that you are assigning Boolean values show up as Boolean Attributes ...

 

If these comments are helpful to you, and you have further questions, it would help me (to help you) if you found/attached the mysterious type_camera Control (I'm guessing, seeing the Semaphore in there, that is being provided by the Camera Vendor), as well as the array output of the Enumerated Attributes mentioned in the previous paragraph.  In particular, there's a little more "fiddling" you need to do if you want to set an Enum Attribute ...

 

Bob Schor

0 Kudos
Message 4 of 11
(3,417 Views)

Indeed, I missed the necessary .ctl file. That's the "dirty" part of quick and dirty. Sorry for having made you waste time... I won't send you the whole project because It's quite huge. I made another one with my quick and dirty example, added the .ctl file, zipped and attached it to the present message. I hope I didn't miss any file this time... At least I have the impression the remaining dependencies are not mine, it should be ok...

 

Talking about the .ctl file, I made it indeed myself to avoid having to connect too much wires between my VIs...

 

Indeed I read all the available attributes of the camera. Those I use are listed in the output of the "Enumerate Attributes" function. The attributes I modify in the present example (e.g. ShutterOpen) are indeed boolean. And they work, I'm able to make the camera "react" to these attributes changing! Regarding the BackgroundAcquire "Attribute", it is not a parameter of the camera. It is a command I have to send to the camera. Again, it is listed out of the "Enumerate Attributes" function! However, I cannot attribute a value of any type to it. It tells me that I can't set a value to a command, or something like that. I can run the code again and tell you the exact message. That's why I thought that just changing the ActiveAttribute of the IMAQdx property node would be enough to send the command. I guess no as the camera is not reacting to it! But I don't know how to send this command...

 

I wanted to give you more information about the attributes. Unfortunately, the camera is switched off and on another test site. Currently nobody is there to switch it on! I'll have to wait on Monday to run some examples and give you the exact results (attributes and error messages).

 

Thank you very much for your help! But if nothing come to your mind you with those partial information, don't lose too much time and wait for additional inputs on Monday.

0 Kudos
Message 5 of 11
(3,404 Views)

As it happens, I'm wrestling with similar issues with a Point Grey camera a colleague wants to use ...  Figuring out which Attributes can be Read and which Written (particularly when these can change depending on the setting of other Attributes, for example, an "Enable") can be a nightmare.

 

Bob Schor

Message 6 of 11
(3,394 Views)

I've finally been able to solve the issue. In fact, the manufacturer provided an update of the firmware of the camera. I am now able to set a boolean value (to true) to the BackgroundAcquisition attribute for it to apply the background removal. And it works well now. Anyway, thanks for your support!

Message 7 of 11
(3,375 Views)

I have a similar issue that brought me here so I thought I'd contribute.

 

I'm using a third party camera that uses IMAQdx and I want to send a command (or so I thought). Like OP, I tried using a property node like I use for all the other attributes setting, but I was wanting to send a "command" as the attribute is so categorized from the enumeration VI. The said command is listed as "CameraAttributes::AcquisitionControl::TriggerSource". The equivalent used in the COTS software from the manufacture is used to send a software trigger event. I was unsuccessful in various experiments attempting to use the property node.

 

But I took a step back and realized that I already had worked out a work-around. I

was already getting images in an equivalent method by using the "IMAQdx Get Image2.vi"

 

I never figured out how to send a "command" through a property node, so I don't know how or if it's possible.

0 Kudos
Message 8 of 11
(1,105 Views)

Have you tried like this?

raphschru_0-1694508992848.png

 

0 Kudos
Message 9 of 11
(1,084 Views)

Whenever I start to work with a new camera, I generally try to run it using the example VI:

Advanced Functionality with Attributes.vi found in the NI-IMAQdx examples.

This VI will populate a tree with all of the camera attributes and allow them to be tested.

Some cameras are not standard so this does not always work.

Message 10 of 11
(1,070 Views)