07-12-2012 01:13 PM
Hello,
I am having a problem with my ni-imaq serial read. I have a camerlink camera that is sending serial commands through the camerlink cable with a baud of 115,200. I am using the PCIe-1427 cameralink card for this project. Using the camera file generator, I configured the serial port to read in at the baud and also to detect the termination character which is \r. The problem is when I am reading from the port using this method I will get one full message then the next message will be a piece of message. I do not know if my cameralink card is able to keep up with the baud rate or not. I have attached a pic of my vi. Should I be doing this or should I just read in byte by byte and when I get a termination character I will assume that is the end of message and parse that.
Thanks
07-13-2012 06:31 PM
Have you tried giving it a bit more time to write data? You might want to use a flat sequence structure and embed a bit of a wait in there, maybe 100ms, and see if you get the full message. Does this change things?
07-16-2012 08:01 AM
Yes it does change things but I also miss data. My data is coming in at 30hz and if i put in 100ms wait then I am reading at 10hz.
Thanks.
07-17-2012 04:20 PM
Actually, you might be able to eliminate the wait and try putting in a timeout that corresponds to the rate you want to read at. It seems right now you're reading too fast; without a wait function, that's likely what will happen. It'll result in your message being broken up, since the serial read doesn't know when the incoming message is complete.