Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with null characters when using imaq serial read

Hi, I use 'IMAQ serial write' and 'IMAQ serial read' VIs to command and get status information of a Camera link (basler A501k). When I do a reading using the 'Imaq serial read', my string is truncated after a null character if one is present in the camera's response. Can someone help me solve this incomplete reading. Thanks
0 Kudos
Message 1 of 4
(3,426 Views)
Guibook,

I would suggest you use the NI camera file for the basler A501k camera. ftp://ftp.ni.com/support/imaq/camera_support/camera_files/digital/basler/
This camera file does not use null as the termination character. If your camera file has null set as the termination character then it will stop at null.

A Talley
0 Kudos
Message 2 of 4
(3,426 Views)
the NI camera file for the  basler A501k camera does not support all the settings for this camera. for example, I need to edit the Area of Interest at the camera's level in order to increase the maximal frame rate. This cannot be done using the NI file for A501k. The 'Imaq serial read.vi' is supposed to overcome these limits.
0 Kudos
Message 3 of 4
(3,426 Views)
OK,
I found out one solution.
I modified the *.lcd file and specified the termination character as a NULL character(\x00).
Then when doing a serial read of the camera's registry I have to check the number of bytes received, compare with the number of bytes that should arrive and, if necessary, redo an 'Imaq serial read' to get the rest of string. It works well but still it would be nice to have a function that would read all incoming characters, even null characters.
0 Kudos
Message 4 of 4
(3,426 Views)