08-25-2016 11:16 PM
@Blokk wrote:
Thanks altenbach! The only difference here is that, if the binary string has more data after the starting 16 bits.
Yes, I mentioned the "4.x typecast mode" more as a curiosity that most younger programmers don't know about. 🙂
We really need to know much more about the actual application to decide on the best solution. I went with the assumption (as described in the original problem description) that we have exactly 16 bits total.
08-25-2016 11:25 PM - edited 08-25-2016 11:26 PM
A few posts before I mentioned some info about this special PLC data block which i need to convert into several LV data types. Just as a second thought, I think I could use the "4.x TypeCast" method, If first I split up my binary string. In a normal string one character takes 1 byte, 8 bits. Keeping this in mind, for example I could split out 2 characters from the string at the appropriate position, and typecast this 16 bits into Boolean Array. This should also work, yes?
Edit: of course, I would use the "4.x" version for the Bool array, and the "normal" TypeCast for other data types...