Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 communication through PCI-1428 camera-link image grabber card

I want to communicate (RS232) to my camera link camera (UNIQ UP-1830CL) through the frame grabber card PCI-1428.
As I was advised by NI support engineer, I followed the following steps....
1) Go to www.ni.com/camera
2) Select the NI Camera File Generator under Option 3
3) Click the link to download the NI Camera File Generator
4) Open the latest version (2.0.1)
5) Run Setup.exe
6) Go  to  Start  -> All Programs -> National Instruments -> Vision -> NI
Camera File Generator
7) Select Open Existing Camera File and open the camera file you are using
😎 Go to Settings -> Serial Settings
9) Click on Test Serial Settings
 
Now after all these, in the 'Test serial settings' whatever command is given it returns
"\x00\x00...." and says 8192 bits returned.
All the parameters in the serial setting are set as defined by the camera
manufacturer. But still I am not able to read any information from
the camera by this protocol. The camera is working fine and grabbing images otherwise.
I just want to change some settings in it.
 
When I send command 'rp' which reads the present state of the camera
and should return (g xx b xx s x ns nm). But for all the commands
given it returns the same string of 8192 bits.
What might be wrong in the settings and/or in the procedure in sending
RS232 commands to the camera ??



 
Manas Khan
Department of Physics
Indian Institute of Science
INDIA
0 Kudos
Message 1 of 6
(4,594 Views)

Hi iisc,

    It sounds like there may be a setting that is incorrect.  I looked at the manual for your camera and there are specific settings.  I know that you said that you set it as per the manufacturer settings, but I would double check that you have 9600 bps baud, no parity, 8bit data, 1bit Start and Stop, and no Xon/Xoff.  Also, this set of bits (8192) that you are getting back, do they form any sort of message or series of characters?  Or are they completely random as far as you can tell?  If you have any more information about the message you are getting back (I am assuming that every command you send receives the same return message, if I am incorrect please let me know) that would be helpful.  Thank you.

-Allison S.

Applications Engineering

-Allison S.
Calibration Services
Product Support Engineer
0 Kudos
Message 2 of 6
(4,569 Views)

Hello Allison S,

Thanks a lot for your reply.

I have chacked it onace more after receiving your reply. I have set 9600 Baud Rate, data bits : 8, stop bits 1 and Parity : None, and 10 ms of delay. I am not using any termination string.

I am geeting the same response for every command.... 8192 bytes.... but they are not random. They are \x00\x00\x00.... in repetation. If I choose 'Normal' display format in the 'Test serial settings' panel, it does not show anything, If I choose 'Codes' display format, it shows \00\00\00 in repetation and 'hex' display format it shows 0000 0000 0000 0000 0000 in repetation. I hope you would be able to figure out something from these.

regards,

 

Manas Khan
Department of Physics
Indian Institute of Science
INDIA
0 Kudos
Message 3 of 6
(4,567 Views)

Check your baud rate. If I remember correctly, the baud rate for these cards is fixed at 57.6 kBaud and cannot be changed, no matter what you set in the controls.

Paul

0 Kudos
Message 4 of 6
(4,559 Views)

I was just browsing the FAQ and saw something that may be related:

IMAQ Serial Read.vi and imgSessionSerialRead read serial data until a termination character is reached. If no termination character is being used they will return an empty buffer. The default size of the IMAQ serial buffer is 8192 KB which is why you see this data.

This is from http://digital.ni.com/public.nsf/allkb/AC2718B38FF2CD5F8625726E00068CA5 

Hope that helps...

--steve

0 Kudos
Message 5 of 6
(4,551 Views)
Thanks a lot stevebar.
The VI helped a lot. Now I have joined a IMAQ init.vi and IMAQ serial write.vi to send command to the camera and to receive response.
Now whatever command I am sending I am receiving '?' and 'Bytes read' - 2.
Do you have any idea how to get rid of that ?
 
I have attached screen shots of the VI. and the actual VI
 
 
 
regards,  
Manas Khan
Department of Physics
Indian Institute of Science
INDIA
0 Kudos
Message 6 of 6
(4,507 Views)