Firs of all I'm working with Structured Text on B&R Automation Studio 4.0:
I have a binary message on a string (collected from serial port). The string contains values such as '10001000' and it's a buffer with the binary representation of several sensor's values. I will parse the data and then convert each sequence. My struggle is to convert an specific string of 1s and 0s into: USINT, UINT, SINT, REAL or LREAL.
I know the data sequence, length and can successfully parse each value. However, is such conversion possible on ST (for example: '10001000' to 136)? Does it makes sense to struggle on ST or I should make a C routine to handle the conversion (AS does supports C, but provides no help/documentation)?
Comments and toughs are appreciated.
I have a binary message on a string (collected from serial port). The string contains values such as '10001000' and it's a buffer with the binary representation of several sensor's values. I will parse the data and then convert each sequence. My struggle is to convert an specific string of 1s and 0s into: USINT, UINT, SINT, REAL or LREAL.
I know the data sequence, length and can successfully parse each value. However, is such conversion possible on ST (for example: '10001000' to 136)? Does it makes sense to struggle on ST or I should make a C routine to handle the conversion (AS does supports C, but provides no help/documentation)?
Comments and toughs are appreciated.