LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Display EMG Signal Flowing from Left to Right Starting from an Empty Screen?

Hello,

 

I’m a biomechanics researcher and currently deal with a LabVIEW template to measure electromyogram (EMG) data.

I have a question that I could not solve. In LabVIEW, I have set up a system to display a EMG signal on a graph (chart) that flows from left to right. The data is being recorded correctly. However, the issue is that instead of having the signal appear from an empty screen and move from left to right as new data is measured, the signal is already displayed in a straight line and responded only when fluctuations appearing (normally working). How can I achieve the effect where the signal starts from an empty state and progressively appears from left to right without the tail being present initially?

 

If anyone could kindly provide a solution or guidance, I would greatly appreciate it.

Thank you.

0 Kudos
Message 1 of 8
(492 Views)

We cannot tell what you are doing wrong (there are billions of possibilities!) unless you actually show us what you are doing. Please attach a simplified version of your VI and tell us how you use it.

 

Replace the IO with a random generator and make sure to "save for pervious, 2020 or below" before attaching.

Message 2 of 8
(469 Views)

Check out the Chart example

santo_13_0-1722964026008.png

santo_13_1-1722964053025.png

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 3 of 8
(451 Views)

To. altenbach 


Very thank you for answering my question. 

As you told me, I share the VI (template) and an attatched photo (expressing a problem I questioned). 
I setup the VI that is simultaneously working and measuring multi-asix force (FROM NI DAQ Nano17 TO LabVIEW block diagram) and EMG (from Delsys; FROM EMGworks (a Delsys hardware) TO NI USB-6210 TO TCP/IP in LabVIEW block diagram). 
And, the VI is normally working. the VI is have been made and operated on 'NI LabVIEW 2015 SP1 (32 bit)'

I am looking forward to receiving your reply.

 

Sincerely yours,
From. HSKHS

0 Kudos
Message 4 of 8
(423 Views)

Hi HSKHS,

 


@HSKHS wrote:

As you told me, I share the VI (template) and an attatched photo (expressing a problem I questioned). 
I setup the VI that is simultaneously working and measuring multi-asix force (FROM NI DAQ Nano17 TO LabVIEW block diagram) and EMG (from Delsys; FROM EMGworks (a Delsys hardware) TO NI USB-6210 TO TCP/IP in LabVIEW block diagram).


Well…

  • You should better cleanup your VI, both frontpanel and blockdiagram! (I could reduce your block diagram to one HD screen with little effort!)
  • Do you really use a screen of atleast 5500 pixel width? That's the current width of your frontpanel…
  • There is no syncing between both DAQ tasks: how do you ensure sync'ed data?
  • When you know which data is important to you: only use that data and get rid of the non-interesting part…
  • Learn LabVIEW basics and use the functions provided by LabVIEW.
    Example: there is no need to create filepath with pure string functions when there are functions like BuildPath. Most of your array handling looks way to complicated…

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 8
(406 Views)

Without seeing your code, but listening to your description, it sounds like you are (correctly) using a Chart to plot your data.  I assume the Chart is initially clear (nothing plotted) -- if not, create a Property Node for the Chart showing the "History Data" (the last element in the list of Property Values), right-click its input, and "Create Constant" (which puts an empty array of whatever Type the Chart accepts, effectively clearing it).

 

Until you start writing values (to be plotted) to the Chart, it will remain empty.  When you start giving it values, they will appear left-to-right, and start scrolling (right-to-left, as values are added on the right).

 

Bob Schor

Message 6 of 8
(386 Views)

Hi 

 

I checked your code and the EMG signals are being plotted on a waveform Graph, instead of Chart. 

You are also adding new incoming data into an existing array that goes into the shift register creating the behavior that you don't want. 

LVNinja_0-1723036999125.png

If you plot directly into a plot graph it will create the effect you want. 

 

 

Message 7 of 8
(377 Views)

Do you want your plot to scroll (that is, start at the left, adding points to the right until the screen is full, then continuing to add points to the right and having the other points shift left)?  Then you want to use a chart, which has a fixed-size buffer that LabVIEW manages for you "behind the scenes" so you only need to worry about adding the "latest data".  Charts also have two other modes -- a "Scope" mode (which works like an oscilloscope, blanking the Chart when full and starting the next sweep from the left (to right) again, and a "Sweep" mode, similar to "Scope", but without erasing the entire Chart when a new Sweep starts, only erasing the points being "replaced".

 

Many years ago, I read a fascinating article by @CoastalMaineBird that he called a "Monster Graph" (and I call a FlexiGraph) that uses clever tricks to create (using a graph) something that acts like a Sweep Chart, but lets you have several "X Gains" (so you can see the last 10 minutes, 30 minutes, 60 minutes, 3 hours, 10 hours) of your data (which you are constantly streaming to disk -- the data being plotted remains in memory, and takes surprisingly little time to update).  I believe his company is called "Culverson Software".

 

Bob Schor

0 Kudos
Message 8 of 8
(314 Views)