Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulation Module Example needed (in RT)

Hi,
I have 3 separate working applications performing Analog Input, some transfer functions etc. and then Analog Outputs.
The code for each of these applications are within an 'infinite' simulation loop and each have a 'Wait Until Next Multiple' VI to allow that process to sleep.

If I download and run more than one application the activity locks, i.e. no more Analog Input -> Analog Output occurs.
I have the Execution Trace Tool but after 2 days do not know how to get it working.

Please, is there any examples anyone knows of for using the simulation module in RT.

Thanks,
Andy
0 Kudos
Message 1 of 3
(3,556 Views)
Hi Andy

What happens if you try to combine all 3 operations into the same application, do the problems still remain?

I wonder if some to applications are sharing resources and therefore locking of threads in occuring?

You should find realtime simulation examples shipped with the toolkit. Open up the LabVIEW example finder and browse to Toolkits and Modules>Simulation>Realtime to find them.

Regards

SimonS
0 Kudos
Message 2 of 3
(3,527 Views)
Simon,
I contacted NI support for this problem and they were very helpfull.
The reason for deadlock was one VI getting access to hardware resource and not letting it go, meaning the other VIs waiting forever.

The solution was to perform all analog inputs using a single DAQmx Read which went into an array. These values were then used within my simulation model producing an array of modified values in a new array. These were all output using a single DAQmx Write.

The problem was having a working VI, and then trying to multi-thread this 2 more times. Now I have gained a little LabVIEW knowledge I now know what to do in similar situations.

cheers,
Andy
0 Kudos
Message 3 of 3
(3,524 Views)