From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Waveform Chart

Hi everyone

 

I am sending sinewave data from the FPGA -> RT -> Windows.

 

I also have a square wave and noise option.

 

The program seems to run fine so far.

 

My problem is, the waveform chart in the windows PC host VI is completely out of sync with the FPGA data and chart.

 

I have tried turning off autoscale x-axis and then changing the x-axis values, but soon as I run the VI, the x-axis extreme values jump right back to what they were. It means I am not seeing up to date values.

 

Any ideas why the waveform chart x-axis seems locked on a particular value?

0 Kudos
Message 1 of 7
(3,076 Views)

You don't seem to initialize/synchronize your Shared Variables.  When your program starts, whatever is in the Shared Variables will be wired to the Chart at 100Hz.  Also, you don't seem to have initialized your Chart.  Personally, I've stopped using Shared Variables in my code -- I've found them too tricky to get to work in a predictable, reliable way.  For communication with an RT Target, I now use Network Streams ...

 

Bob Schor

Message 2 of 7
(3,066 Views)

Ok I will look into network streams as a future topic of development. Thanks.I have noted it down.

 

What do you think I can do to get this code working?

 

How can I make the frequency a bit more dynamic as the frequency may change depending on what type of signal is selected.

 

How do I initialise the chart? I thought it would work ok as it was. Am I better off using the waveform graph or something?

0 Kudos
Message 3 of 7
(3,058 Views)

Since it sounds like you want streamed data, you should be using a streaming technology.  Shared Variables are NOT a streaming technology.  They are good for tags (single values that you only care about the latest state of).  You really need to change your code to use network streams to get it to work properly.

 

As far as initializing the chart, use a property node to clear the history (wire an empty array to the History property).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 7
(3,024 Views)
You could also consider skipping RT altogether if you are using the FPGA module, not scan engine. You can open the FPGA reference in the windows code and read directly from controls or fifo's. The FPGA driver will handle the network communication transparently. You specify the FPGA target by IP address for the open FPGA reference. You should only do this if you do not need any code on the rt target.
Message 5 of 7
(3,003 Views)

Unfortunately for this particular code, the task itself is to send a control signal from PC -> RT -> FPGA and then return a signal back from FPGA -> RT -> PC, so skipping the RT is not an option here.

 

Ok I will have a look at network streams and see if I can get it to work.

 

If you have any specific recommendations for any simple tutorials, that will be greatly appreciated. I will have a google and see what I can find.

0 Kudos
Message 6 of 7
(2,946 Views)

Another question I have. If I am using shared variable to go from PC -> RT, and using FIFO buffer from FPGA -> RT, and Network Stream from RT -> Windows PC, what is the best method of communication between RT -> FPGA for the control signal?

 

Shared variables could not be used as they don't allow RT -> FPGA communication.

 

Its only tag data, so just a control signal stating which type of signal to send back. So its not streaming data.

0 Kudos
Message 7 of 7
(2,934 Views)