From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measure

cancel
Showing results for 
Search instead for 
Did you mean: 

How to temporally match/save Input and Output Channels's data?

Hello, I have a voltage-input, voltage-output SISO system, and need to indentify its dynamic response (or transfer function) as a reference to a PID control. Without using the system identification toolbox, my goal is to generate/provide a sine sweep input (ranging 1Hz-5kHz for 10sec) to the system and to save the corresponding output response signal as well as the sweep input signal simultaneously.

 

I got a sample program online and am trying to modify it as attached, but I really need your advices/comments concerning several problems I am facing with:

 

1) With the below setting, the number of the acquired Input channel samples obtained is 5461, which is smaller than expected (i.e., 10000). What would I be missing in setting parameters?


- H/W: NI-USB-6341 DAQ
- AO: continuous samples with the waveform timing (1k sampling, 10000 samples => 10 sec, slower sampling just for testing purpose)
- AI: continuous samples, samples to read: 30k, rate: 1k

 

 

2) I am using flat sequence structure as a way to making the start point of saving AI and AO data same, but wonders if this is a right method or if there is other better approaches. (I had an idea of using an internal clock with "1-sample mode" for sync, but this may not work at the high speed sine sweep like 5kHz, right?)

 

 

3) I just want to provide the sine sweep just once to the system and do not require the "reset" functionality implemented in the original sample program. I failed to remove this "reset" part as I did not fully understand the sample code. If I run the attahed, the generated AO signal is periodically provided to the system. Please give me any advice to modify the program as I want.

 

 

Thanks for your help and valualble time.

 

siso.png

0 Kudos
Message 1 of 2
(5,670 Views)

Hi J. Kim,

 

To begin, you say you want to synchronize your analog input and output so that they start at the exact same time, yes? To achieve tight synchronization, you need to use DAQmx VIs instead of the DAQ Assistant. There's a good overview of DAQmx VIs  here. There's also a document that deals specifically with synchronization in DAQmx here. Additionally, if you go to Help>>Find Examples in the LabVIEW example finder, you can see many other examples of acquiring data using DAQmx.

 

As for your configuration, you have your analog input DAQ assistant wired far before your analog output DAQ assistant in your sequence strucutre, so the dataflow of the program will cause the analog input DAQ Assistant to execute before the output. They cannot be in different sequences if they are executing simoultaneously, and I would not use flat sequences here except to start the two tasks in DAQmx. Where did you find this example?

 

Best,

Dan N

Applications Engineer

National Instruments 

0 Kudos
Message 2 of 2
(5,662 Views)