Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulated Signals

Hi,

 

I'm trying to find a way to continually acquire signals by generating them in software.

 

I'm using VS2012 and MS2015 and VB.net.

 

The issue that I'm having is that after about 8-12 generations the application shuts down.

 

Attached are the generatesignals, getSpectra Methods and the dataready event handler.

 

I think the issue is related to recursive calling the generate signals method causing Stack overflows but an exception is not thrown the app just shuts down.

 

Therefore are there any ideas regarding how I should keep call the generatesignals method until a stop button is pressed.

 

I have tried Timers, async methods etc. to no avail.

 

Regards

Steve   

0 Kudos
Message 1 of 6
(4,358 Views)

Hi Steve,

 

Can you reattach the files, I don't think anything was uploaded with original post.

 

Cheers

Pete

Certified LabVIEW Architect
0 Kudos
Message 2 of 6
(4,314 Views)

Hi Pete,

 

Sorry.

 

Hopefully Code attached.

 

 

0 Kudos
Message 3 of 6
(4,299 Views)

Hi stevieB,

 

It seems we are missing some information here.

 

Please provide:

  • Detailed exception information. If you are getting a stack overflow or some other exception, use the Copy Exception Detail to clipboard option in the exception helper that appears, and post it here.
  • A description of the debugging you have performed so far to figure out the cause of the application closure. 
  • More context for the posted code. The code you posted seems to depend on classes such as NMathClass which are not provided in your snippet. If you are starting from an example application, please let us know which one. 

Thanks,

Daniel Dorroh
National Instruments
0 Kudos
Message 4 of 6
(4,292 Views)

Hi,

 

I have the test application working now. (see attached)

 

The original issue was that the application just shut down after 10 updates.

 

There was no error message which is why I assumed it was some form of stack exception

 

Since then I have moved the getSectraData method to it's own class.

 

The questions that I have now are: -

  1.  

What is the best/preferred method of waiting for the dataready event from the signal generation class

At the moment I'm using a timer to get the testSignals and a dataready event to obtain the generated time signals

Is it better to use a while loop within the getSignalsmethod and check for a is taskrunning variable?  Will it keep alive

 

Secondly is it better to raise a data event that passess both a framecount and the actual generated signals to the calling method

or is it better to pass the dataready event and get the data via a property in the class.

 

Finally on the Lofarplot it always starts as 12:00:00.  How can you make it start at the current time?

 

Cheers

Steve

0 Kudos
Message 5 of 6
(4,269 Views)

Hi StevieB,

 

Sorry I haven't replied in a long while I've had to shift my attention onto email and phone support.

 

If you are still having issues and you have SSP I would recommend emailing or phoning in to get another AE to look at the issue.

 

Kind regards

Pete

Certified LabVIEW Architect
0 Kudos
Message 6 of 6
(4,055 Views)