LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot data from a concatenated string /Continuous Serial COM input

Solved!
Go to solution

Dear LabVIEW members, 

 

I'm trying to plot a force graph by reading real time data from the sensor. I use an Almemo device for measurement. According to that, in order to obtain the current value, you need to query with the command 'p'. Hence first I do VISA Write with p and then VISA READ. 

 

Problem: 

As shown below, I concatenate the strings with the previous(similar to shift register) with a feedback loop. Then it works fine and I can take one single long string with values. 1.JPG2.JPG

 

What I want is finally to plot these values Real time on a XY Graph. For that i need to get only the value not the whole string of values. When I get rid of this and if I try "match string" it sometimes, matches and sometimes don't. (figure as follows)

4.PNG3.JPG

 

Could the forum members please help me..  I'm really stuck from this point.

 

Thank you . I have also attached the vi if needed (2015)

Best, 
Shane

Download All
0 Kudos
Message 1 of 6
(3,080 Views)
Solution
Accepted by topic author ShaneJ007

Hi Shane,

 

why do you collect all the received data to a huge string? Why not handle the received message, parse it's data and forget about it?

check.png

Does your device always echo with the command? What's the char before the "p"? (Show your response in \-code or hex display mode.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(3,074 Views)

Dear GerdW,

1. Thank you very much for the support you are giving..

2. My intention was also to get data first as string and then prase it to double, double, string. 

 

But if I don't use the feedback loop, the device outputs, the following.. (i have added the /display for you to analyse) I don't understand why. the correct value always comes at the second iteration. at the first iteration it comes only - 03p/r/n

with feedback onwith feedback onwithout feedback.without feedback.

0 Kudos
Message 3 of 6
(3,064 Views)
Solution
Accepted by topic author ShaneJ007

Because somehow your system is echoing the command you sent out.

 

Is this an RS-232 port?  An RS-485?  Does the device have any Echo ON settings?

 

Don't use feedback node.  Just read 100 bytes.  If you find the response is equal to your command you wrote, then read another 100 bytes.  Parse that.

Message 4 of 6
(3,058 Views)

Device says output- RS232 via USB. Yes you are write. that's an echo. I don't see any echo setting in the device though.. To an earlier device, this problem wasn't there since I used, Instrument IO Assistant. And in the code created there was an exit condition as such.. Maybe this helps for you to understand the prob. better.222.PNG

0 Kudos
Message 5 of 6
(3,054 Views)

While thanking both,   and @ 

 

 

0 Kudos
Message 6 of 6
(3,022 Views)