LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

imgSessionSerialReadBytes IMG_ERR_SERIAL_READ_TIMEOUT

Hi,

 

I'm trying to control a  camera called "Cedip Titanium", it's an older version of the http://www.flir.com/thermography/eurasia/en/content/?id=11354. The code belows results in a time-out error:

 

IMAQSession* session = 0;
int result = InitializeAquisition((void**)&session);

char* buffer = new char[8192];
buffer[0] = 0x02; // start byte
buffer[1] = 0x04; // command name size

buffer[2] = 0x00; // command name size (2x bytes)

buffer[3] = 0x43; // command name (C)
buffer[4] = 0x43; // command name (C)

buffer[5] = 0x4D; // command name (M)
buffer[6] = 0x2C; // command name (,) (CCM, = check communication)

buffer[7] = 0xFF; // control bit
buffer[8] = 0x03; // end byte

uInt32 bufferSize = 9;

result = imgSessionSerialFlush(session->Sid);
result = imgSessionSerialWrite(session->Sid,buffer,&bufferSize,2500);

bufferSize = 11;

result = imgSessionSerialReadBytes(session->Sid,buffer,&bufferSize,2500);

 

The last line (imgSessionSerialReadBytes) freezes for the time specified in the timeout (setting a really high timeout does not help) and it then returns the error code:  -1074397037 (IMG_ERR_SERIAL_READ_TIMEOUT). Switching to imgSessionSerialRead results in the same error as imgSessionSerialReadBytes. 

 

The manufacture did not provide any camera file to load into Measurement and Automation so I had to create my own using the following specifications from the manufacture: 

 

"The camera communication baud rate can be set by commands. Cirrus tries to establish the communication at the highest possible baud rate. It can be 57000 or 115000 depending on the cable length.

The camera is initiated at power up with 9600bds, 8 bits,1 top bit, no HW or SW control bit."

 

I also tried changing some of the settings (buad rate ect) with no luck. Trying to send a command using the Test-thing under the Serial Settings in the NI Camera File generator always returns an array (8192 bytes long) contaning \x00\x00\x00... (so basically, an empty array is returned). I've read some other posts at this forum, most of them suggest that you should add a termination-char. The protocol specifies a stop-bit 0x03 which should be added at the end of each package. I tried to add it but it did not matter, and from what I've read, imgSessionSerialReadBytes ignores the termination char anyway.

 

I'm using the 1427 grabber card (PCI-express) running under Win2k8 64-bit. 

 

I've been trying to solve this one by myself for several days now but I've run out of ideas. Any help would be greatly appreciated

 

Best regards, Olof 

 

0 Kudos
Message 1 of 1
(3,163 Views)