Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

splitstr no delimiter


heiko Sep 15, 2011 11:36 AM

Hi,
I got a string from the RS232 Com-Port1 of the CR1000 and the values are not seperated with a delimter

The string is like

I00..013500180000-,(8970;
where
I00 -> hardware-adress
0135 -> first value
0018 -> second value
0000 -> third value

the number of digits are allways fixed to 4.
Now I have to separate the strin into the 3 values! But I could´nt found any solution with the splitstr-command.

Does anyone have an idea how to solve this problem. In MATLAB it´s easy, bit I will do this withn the Loggerprogram of the CR1000

thanks in advance!!


aps Sep 15, 2011 11:49 AM

You will need to chop the string up using one of the standard strings functions, such as Mid, Left or Right. If you assign the result directly to a numeric variable the logger should do the conversion automatically.


Sam Sep 15, 2011 03:07 PM

Example:

Public StringIn As String * 31 = "013500180000"
Public Values(3)
Dim I, Point
BeginProg
Scan (1,Sec,0,0)
Point = 1
For I = 1 To 3
Values(I) = Mid (StringIn,Point,3)
Point = Point + 3
Next I
NextScan
EndProg


heiko Sep 15, 2011 05:19 PM

Thanks!!
I used 'Mid' and it´s working.

Log in or register to post/reply in the forum.