We are attempting to use the um6 as well but we chose to utilize SPI instead of serial since we are using the serial port for CAN bus. Would a state machine do the trick or is there a better way to do this? I am a complete novice at data communications. To make things simple, I need to know a good strategy on how to grab the correct amount of data from a serial port and read it to decide how much more data I need to get, and then continue to get that amount. I’m not sure how to grab the bytes from the serial and have the code figure it out as I go. I might grab a data where the packet starts half way through the data, meaning I have an incomplete packet now. In addition to that, most of the packets I grab are not structured right. I can say “always grab 7” but since not all packets are that length, I may not grab all the data I need and that will mess up the read of another packet. ![]() We are connecting the CH Robotics UM6 Position sensor (Attached is its datasheet) to the serial and the packet lengths can be anywhere from 7 to 71 bytes in size depending on what length is given in the Packet type header of the packet. The Read VI allows me to select the number of bytes I want to read. ![]() I can use the open serial VI and the read serial VI (WPI Robotics Library-> Communications -> Serial Port). I am looking to get data from the serial interface on the cRIO.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |