LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to collect data from a signal in a simulation loop

Hi, I am trying to tabulate data into a form such that I can display data points from a signal into an array that ultimately can be displayed graphically in a restful web service.

I've been able to simulate data via a waveform indicator using a simple simulate signal vi, but I can't seem to find a solution anywhere that will allow me to extract and display points from a signal from within a simulation loop.

I've tried using the indexer function which seems to be limited and using the collector function which I am struggling to get to grips with.

If anyone could help me find a solution or give me advice on how to go about solving this problem I would appreciate it so much!

Thanks, Christian

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

How do you want to present the data? The output of the collector actually gives you a cluster with the data tabulated in it. You can easily use the 'unbundle' or 'unbundle by name' functions from LabVIEW to access the 1D arrays and then use the convert 'convert to string' functions to show the data in a 'table'.

 

Here is the reference code:

tableandstring2.PNG

and here is how it looks like on the front panel:

table and string.PNG

 

When tabulating data, I always prefer converting to string than trying to use the Matrix, but it all depends on your use case.

 

Hope this helps...

Barp - Control, Simulation, RTT and HIL - National Instruments
Message 2 of 4
(2,408 Views)

Thanks for the reply, this is a massive help! I want to be able to use the data with restful webservices, but there is always a problem when deploying the simulation for some reason. I think it might not be possible to run the simulation via a web server. Do you have any ideas?

I've used waveform data before and plotted it using an API from google graphs although i don't think this is the same.

Also how did you get the table control?

Thanks again

0 Kudos
Message 3 of 4
(2,400 Views)

Hi Chris,

 

Try checking the Use 8.x file layout in the Advanced tab of the Build Specifications for the web service. If you still see an error, are you able to deploy and use a simple web service that does not have simulation components? What is the error you are seeing when deploying?

 

The table control is available on the front panel in the Modern palette. You can right-click and select Switch to Indicator after placing it.

 

Regards,

Zach P.

Staff Software Engineer | LabVIEW R&D | National Instruments
0 Kudos
Message 4 of 4
(2,378 Views)