TwinCAT 3 SPLIT STRING

Vijolica555

Member
Join Date
Apr 2018
Location
Germany
Posts
21
Hello guys,

I am using TwinCAT 3.
I am having string: 'OK;FFT;1.0;8.0$NX;0.0001;0.375;0.0053;3.5$NY;0.0001;0.375;0.0053;3.5$NZ;0.0001; 0.375;0.0053;3.5$NV;0.0003;1.125;0.0161;3.5($R' and I would like to split it at 5 string, after every $N.
Example:
'OK;FFT;1.0;8.0$N
X;0.0001;0.375;0.0053;3.5$N
Y;0.0001;0.375;0.0053;3.5$N
Z;0.0001;0.375;0.0053;3.5$N
V;0.0003;1.125;0.0161;3.5($R'

I tried some things but did not succeed. Does anybody have any suggestion maybe? Is there any Fb or function in TwinCAT that I did not found?

(Later I would like to read every data in string separately but I assume I can delate $N and $R and wrote it to the Array, or?).

(And the length of the string is changeable, depending on the measured values).

Thank you.
 

Similar Topics

I am using twincat 3 to send some strings over TCP/IP. Where the server is a sensor and my PLC is the client. I noticed that the sensor didnt...
Replies
0
Views
22
I'm trying to control a device via MODBUS RTU and the ModbusRtuMasterV2_PcCOM in Twincat 3. I've configured a device with the right com port and...
Replies
7
Views
219
Hi! I am trying to run the 'SimpleSample' (https://infosys.beckhoff.com/content/1033/TF5100_TC3_NC_I/Resources/3438746891/.zip ) to understand the...
Replies
2
Views
102
I am developing a library in twincat and one of the function uses IID_ITcVnAccess_TcVnPoint2_DINT and the definition of this type is defined in...
Replies
0
Views
70
Sorry if this has been asked before, and apologies if this seems like a trivial issue, but I am new to Beckhoff and have been banging my head...
Replies
2
Views
150
Back
Top Bottom