Real Time Serial Read Block
I want to receive 10 byte data packet with Serial Read block in Real time block category of Altair Embed. This 10 byte data is coming at every 100ms. How to receive this data in one go with this block after all 10 bytes are available in Receive Queue?. Can it be received as a character array instead of string and without using start, stop and separator string fields?. For this block how to use 'Vector length' option and 'Vector' Data Type? . It is also not mentioned in the user manual.
Answers
-
Hi Nitin,
Unfortunately, the serial block does not support purely time delimited packets at the moment. I will add a request that it be supported in the next release. Would you like to be a Beta tester? What is the format of your packet? We can add that as a test case to your support ticket.
Pete
0 -
Hello Peter, Thanks for the reply. I will be happy to be a part of beta testing for this feature. My packet structure is as below: Byte1(HeaderByte1-0xAA) Byte2(HeaderByte2-0xAA) Byte3(Data Byte1) Byte4(Data Byte2) Byte5(Data Byte3) Byte6(Data Byte4) Byte7(Data Byte5) Byte8(Data Byte6) Byte9(Data Byte7) Byte10(CHKSUM Byte) Can you suggest any stop gap solution for this?. As a temporary measure I have tried some workaround by adding Start string, Separator string and Stop string in the Transmit packet (modified the protocol resulting in increase in packet size). I was able to receive all bytes through the Serial Read Block by using Vector Data type and Vector Length option in the block. But my problem is that all byte values got changed to equivalent ascii characters. How can i convert it back to equivalent ascii value to do further processing? Thanks Nitin GuptaPeter Darnell said:Hi Nitin,
Unfortunately, the serial block does not support purely time delimited packets at the moment. I will add a request that it be supported in the next release. Would you like to be a Beta tester? What is the format of your packet? We can add that as a test case to your support ticket.
Pete
0 -
Nitin Gupta said:
Hello Peter, Thanks for the reply. I will be happy to be a part of beta testing for this feature. My packet structure is as below: Byte1(HeaderByte1-0xAA) Byte2(HeaderByte2-0xAA) Byte3(Data Byte1) Byte4(Data Byte2) Byte5(Data Byte3) Byte6(Data Byte4) Byte7(Data Byte5) Byte8(Data Byte6) Byte9(Data Byte7) Byte10(CHKSUM Byte) Can you suggest any stop gap solution for this?. As a temporary measure I have tried some workaround by adding Start string, Separator string and Stop string in the Transmit packet (modified the protocol resulting in increase in packet size). I was able to receive all bytes through the Serial Read Block by using Vector Data type and Vector Length option in the block. But my problem is that all byte values got changed to equivalent ascii characters. How can i convert it back to equivalent ascii value to do further processing? Thanks Nitin Gupta
Hi Nitin,
I'm not quite sure what you mean. Can you post your diagram so I can have a look?
Thanks,
Pete
0