01-16-2009 06:36 PM
Hello all,
The question that I have is probably really trivial, but I apparently I am stuck with it. The task I am trying to perform is to transfer a "string of data" that I am getting from reading through RS232 port of a motion controller(relative coordinates of the motor position), into an array, so I can use it further to plot path curve. The string looks as follows:
TPM:*TPM+1274.36,+56.149,+0,+0
and I want to move two of those four numbers into data file, something like this +1274.36,+56.149, per row
when I put "write LVM" express VI and wired "read from rs232" to "signal in VI" it gives me error that data does not match. So I have a feeling that the string needs to be modified in some way before it can be written into data file.
Can anybody help me with this issue please?
Thanks in advance
This is my VI:
Solved! Go to Solution.
01-16-2009 08:10 PM - edited 01-16-2009 08:13 PM
You will need to use a function such as Match Pattern on the string palette. The pattern to search for would the the TPM:*TPM part assuming that is common on every line of data coming in. Then write the part after the match string to a text file.
Since you just want to write the data to a text file, don't use the Express Measurement File function. That really only works well if you already have a "Signal" data type like the ones coming from other Express VI's. Just use the Open, Write, Close text file functions on the File I/O palette instead. Search the Example Finder for some examples.

01-16-2009 08:10 PM
01-16-2009 08:14 PM
Thanks Ravens, I was typing repy to myself before I saw your reply 😉 I am going to correct the output into more appropriate one, as you suggested 😉