LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control Simulation and Design with DAQmx

Hi all, thanks in advance for any helpful direction you can provide.

 

I was recently setup with Labview 2013 Developer Suite and the Control and Simulation Design add-on and was hoping to get a little nudge in the right direction.

 

I have used Labview and the NI DAQmx setup for regular external measurements before but never integrated with the Control and Simulation toolbox. I am trying to use the Control and Simulation Toolbox to model a simple system (to start) in conjunction with the DAQmx setup I have, and am somewhat at a loss.

 

For example, I want to use Labview Control and Simulation to simulate a simple integrator (1/s). The input for the integrator is an external analog voltage (from separate electronics) coming in through the DAQmx setup and the output of the integrator is also and external analog voltage going back to the external electronics. In essence, a very simple control loop.

 

I have been digging through tutorials and searching for examples, of which there have been many excellent ones. However, I have yet to find an example whereby the control and simulation loop is talking to the outside world through the DAQmx interface. I do not believe the RT module or RT target is necessary for timing as the fastest we are running the loop is around 10Hz. I have found some small examples discussing how the Control and Simulation Toolbox timing can be controlled by the RT target or even the DAQmx but I am still struggling on how to pass data in and out of the loop and how to set the timing parameters. How do you get it to simply run endless, for example.

 

Again, thanks for any information or direction you can provide.

0 Kudos
Message 1 of 3
(2,525 Views)

Hey Cabala,

 

Based on your description this would be a great starting example. 

https://decibel.ni.com/content/docs/DOC-11521 

 

Depending on your hardware you may or may not be able to use hardware timed single point for acquisition but you could set it up for continuous as well and use the same structure of 1 read and 1 rate for each cycle of the loop. 

 

You can replace proportional gain function with the CD and Sim Loop and place a Integrator function with in that.

 

Sorry it appears one of the dependencies for that example is missing so you can't run it off immediately. 

 

Please let us know if you have any other questions. 

Kyle Hartley
Senior Embedded Software Engineer

0 Kudos
Message 2 of 3
(2,487 Views)

Hey Cabala, 

 

Looks like my link got deleted by the time I posted this. I found a shipping example that was very similar and can be located starting from the LabVIEW direcotry. 

 

<LabVIEW>\examples\Control and Simulation\Simulation\Real-time\DAQmx

 

You'll need to move everything over from the Real-Time Target to My Computer in the Project Explorer but all the dependencies are there on this example. 

 

Kyle Hartley
Senior Embedded Software Engineer

Message 3 of 3
(2,475 Views)