Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing txt-file to ao of DAQ to simulate meassurement

Solved!
Go to solution

Hi guys,

 

I'm quite new in this whole DAQ game so I'm sorry if this question is something one should basically know. Is there a possibility to write a text-file full of voltage samples (ECG track over 1 Minute, I link it below) to an analog output of the DAQ? My idea is to run it continuously to kind of simulate a real meassurement to test my algorithm. For that I connect the output with an analog input where I read the samples and go on with calculations like peak detection etc. I'm using the USB-6361 BNC, the sample frequency of the signal is 1000Hz and as I wrote it is an ECG.

 

In the end I want to connect a real ECG device to my daq analog input but until then I need to feed my DAQ with some data to simulate the meassurement because I can't sit with electrodes attached to my body at my working place the whole time.

 

The last weeks I worked with Python and the DAQ and there I already managed to write data to the ao continuously and to read it parallel with the ai. But Python is to slow for my ideas so I have to implement it in LabView.

 

It would be a great help if somebody has an idea how to realise that.

 

Thanks 😄

0 Kudos
Message 1 of 6
(1,776 Views)

Of course, you can generate the signal using DAQ AO, do the following,

  • Configure AO with an appropriate sampling rate
  • use regenerative mode, continuous sampling
  • Subset 1 complete cycle of ECG samples
  • Write these 1 complete cycle of ECG samples to DAQmx write
  • Initiate the task
  • Now, the DAQ will continuously repeat the ECG waveform form memory until you call Abort task

Note - USB 6361 has only one AO timing engine, this means, if you're generating the ECG waveform on AO, you cannot create or use another AO DAQmx Task in parallel. But you can use all other features in parallel such as AI, DI, DO, Counters.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 6
(1,745 Views)

Hi Santhosh,

 

thank you for your help. But actually my problem is not how to write something to the analog output continuously but how to write a text-file that is full of samples to an analog output. So which components I have to use to do that. I found some examples for plotting data from a text-file but all those solutions don't work.

 

 

0 Kudos
Message 3 of 6
(1,740 Views)

Again, as I mentioned you don't need to continuously write to DAQmx write, you once write a chunk of samples to DAQ and it will loop on it forever using the regenerate mode.

 

All you have to do is, use the File IO functions to read the text file, convert it into an array of numeric data, write it to DAQmx AO.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 4 of 6
(1,727 Views)
Solution
Accepted by topic author skittlesgiraffe

Alright thanks. It is working now.

0 Kudos
Message 5 of 6
(1,713 Views)

Please mark appropriate post as answer to close this thread

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 6 of 6
(1,697 Views)