I need to decode a message received via TCP/IP with the following
format:
Begin String, Message Header, Message Data and an End String
4 bytes, 20 bytes, variable length and 4
bytes.
The header will indicate the message length and also a checksum.
Once the message is received I pass it on to a state machine to decode
the message.
I created a LabWindows/CVI component for TS to read the data. At first
I tried to store the received data in a TS string this worked for the
first 4 bytes or if the whole message was received.
How ever if the message is fragmented the first 4 byte received works
correctly but the remaining data is not stored and/or retrieved
correctly by TS.
I use the following TS calls in the CVI dll.
TS_PropertyGetValString - get the storage string for the local data.
(Lookup String)
TS_PropertySetValString - store the data received in TS using the
lookup string.
I also tried to create my own TS string Type. I did this so that I
could specify the byte alignment and size of the string. Using this
method no data is stored in TS.
When one does this must one use the TS_PropertyInterface or
TS_PropertyDispatch functions in the code module?
How should I handle the data received in the code module?
Regards,
TN