LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to connect simulation on control design to DAQ card????

Solved!
Go to solution

hi guys.. i have problems about control and design on simulation path I just make PID simulation and i can not to connect to DAQ card from simulation path in control design (function)...anyone can help me how to connect that????? 

Untitled.jpg

0 Kudos
Message 1 of 8
(3,822 Views)
Solution
Accepted by topic author ayb

Ayubi,

 

First, keep in mind that the Control and Simulation has a PID under the Palette "Control & Simulation >> Controllers".

 

Then, to connect a Daq Card, you need to use the DAQmx interface to connect to it. In general National Instruments recommend you use a Real-time system to deploy a controller, but most likely your Windows computer should be good enough for your application. Please look at the shipping example (in 2013):

C:\Program Files (x86)\National Instruments\LabVIEW 2013\examples\Control and Simulation\Simulation\Real-time\DAQmx\RT PXI DAQmx single channel PID.lvproj

 

If you do not have LabVIEW Real-time (RT), you can just open the VI:

C:\Program Files (x86)\National Instruments\LabVIEW 2013\examples\Control and Simulation\Simulation\Real-time\DAQmx\DAQmx Single channel PID.vi

 

and remove the Shared Variables from the code and it would run on a Host computer with a DAQ board.

singlechannel.PNG

 

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 2 of 8
(3,789 Views)

Ot course, I am assuming you are using one of National Instruments Data Acquisition boards with at least one analog input/output that supports Single-Point I/O. If you have a third party board or a cRIO, this the code will be very different. However, the pattern of:

a) Configuring the board outside the Control and Simulation Loop,

b) Read input signal,

c) Process with PID,

d) Write output signal

e) Close the reference to a board after the simulation is stopped (with making the output of the controller zero).

 

still valid to any application. 

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 3 of 8
(3,785 Views)

thank you very much...

 

anyway can you give me what you done it??

 i mean your VI.

so sorry sir 

you may send that vi. to my email

ayo3bi@hotmail.com

 

 

 

0 Kudos
Message 4 of 8
(3,773 Views)

Untitled.png

 

i found that by google 🙂

so i cannot solve that how to connect that DAQ to simulation maybe this other option

and what the function to connet to DAQ??

0 Kudos
Message 5 of 8
(3,767 Views)

Ayubi,

 

Please go to your file system and open:

 

C:\Program Files (x86)\National Instruments\LabVIEW 2013\examples\Control and Simulation\Simulation\Real-time\DAQmx\RT PXI DAQmx single channel PID.lvproj

 

If you don't have this example, please let me know which version of LabVIEW you have and I can try to post this example.

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 6 of 8
(3,713 Views)

Hi Ayubi,

 

You can find the exact example that Barp used at this location (he is using LabVIEW 2013) C:\Program Files (x86)\National Instruments\LabVIEW 2013\examples\Control and Simulation\Simulation\Real-time\DAQmx\DAQmx Single channel PID.vi

 

I recommend to get a better idea of how to create/configure/run a DAQmx task using the DAQmx API before incorporating it into your simulation loop. Here are several videos that will help you get started with the DAQmx API: http://www.ni.com/white-paper/5468/en/ [VIDEOS]

 

The functions referenced by the arrows in your screenshot are "Convert from Dynamic Data" and "Convert to Dynamic Data" express VIs.

 

 

Aldo A
Applications Engineer
National Instruments
Message 7 of 8
(3,709 Views)

thank you very much

 

0 Kudos
Message 8 of 8
(3,686 Views)