LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting Multiple points on XY Graph from a serial string

Hello,

I am stuck with plotting multiple points on XY graph from a serial strings with different string ID's. I want to plot separate point from data corresponding to each string ID on a single XY graph.

Serial Strings are coming from different sources at different time i want to make each point persistent on XY graph as well.

But in the VI attached when one point corresponding to a string ID gets plotted the previously plotted points of other string ID get removed please help me to make every point persistent corresponding to each string from different source(different String ID's) 

 

0 Kudos
Message 1 of 4
(2,234 Views)

Well, you just need to build the data structure inside a shift register. Here's a simple example.

Shift registers are some of the most fundamental tools, make sure you understand them.

We don't really know how a typical received string looks like, so modify as needed.

 

 

Notes:

  • Use of bytes at port is not recommended. Don't you have a termination character?
  • Why do you think you need all that duplicate code? Combine and reuse!
  • You only need to resize "index array" for the number of elements you actually need.
  • please don't maximize the diagram to the screen!
  • You did not attach any of the subVIs. They probably need to attention too.
  • ...

 

Message 2 of 4
(2,206 Views)

Hello Sir,

Sorry for not attaching sub VI's with previous example i have attached the sub VI's with this message.

What i am trying to do that there are some strings which is continuously coming through serial port each string have a node ID like node1, node2, node3, node4 etc. firstly the string starts with some junk values which i am not able to remove but i know that the actual string starts with '$' and ends with '&&' so i am searching for '$' and then splitting and searching for '&&' and again splitting, now using commas i have separated the string into array the 1st index of array contains string ID and i compare the string ID and enters the desired switch in position 6&7 latitude and longitude is stored so i am taking that value and plotting in XY graph but here whats the problem is the string comes of node ID node2 so it displays node2 lat long position of node 2 but then another string comes with different node ID and it suppose node3 so the node3 lat long is now plotted but problem is node2 mark has been removed from X-Y graph i want to show all those lat long values of those string to also unless and until it is updated

Download All
0 Kudos
Message 3 of 4
(2,186 Views)

Hi Anjaney,

 

there is no shift register in your VI - despite Christians suggestion.

 

And most of the rest is still way to complicated!

Like:

- why convert the same strings in 4 different case structures?

- why convert all those data from serial port to hex-formatted strings? Why not operate with "original" data?

- Using BytesAtPort is not useful. Using a wait of 2.5s in parallel surely isn't helpful either!

 

Btw. when you want to attach more than 2 files you should put them all inside a ZIP file!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(2,182 Views)