LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing AI and AO function generator

Solved!
Go to solution

Hello, My purpose is to generate signals for imaging. I use Matlab to generate analog signals on ao3 and use this as an analog input in Labview. I'm going to synchronize this analog input with a function generator that generates analog output at the remaining three channels. 

There are two problems that I detected. The first one is error-50103 (reserved error) and another one is that the analog input channel doesn't work. Nothing(even noise) is indicated on the waveform display.

 

p.s. I've uploaded two vi's for the first trial and second trial.

 

Any help is welcome!

Thank you

Download All
0 Kudos
Message 1 of 10
(2,549 Views)

+ I am a beginner of Labview. So any specific advice or modified code(.v) must be a great help.

0 Kudos
Message 2 of 10
(2,541 Views)

Hi mkwan,

 


@mkwan wrote:

Hello, My purpose is to generate signals for imaging. I use Matlab to generate analog signals on ao3 and use this as an analog input in Labview. I'm going to synchronize this analog input with a function generator that generates analog output at the remaining three channels. 

There are two problems that I detected. The first one is error-50103 (reserved error)


Which hardware (aka DAQ device) do you use? Depending on the hardware it may not be allowed to access the AO channels from different DAQmx tasks (like your "MATLAB" vs. "LabVIEW" concurrent usage)!

 


@mkwan wrote:

another one is that the analog input channel doesn't work. Nothing(even noise) is indicated on the waveform display.


Do you get any error with your AI task?

 

LabVIEW also comes with a huge example library. This includes examples on how to sync DAQmx tasks: the main point is using the "StartTrigger" signal…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 10
(2,514 Views)

Hello Gerdw,

 

I am using ni USB 6353.

When I use continuous voltage analog input from the Labview example, no problems had occurred. But when I use my code, the problem occurred.

 

Thank you for your quick answer!

 

Best regards,

mkwan

 

0 Kudos
Message 4 of 10
(2,507 Views)

I'm trying to synchronize multiple AO with AI. With triggered AI signal, AO should be generated through NI 6353.

 

1. But even when I triggered AI with a digital edge, nothing was detected in AI indicator. (No error occurred.) 

I could detect the signal with an example code.

 

2. Actually, I wanted to trigger the input signal with analog edge of the input channel( ex) ao3), But I couldn't find the channel option.

 

Could someone find the problem?

 

0 Kudos
Message 5 of 10
(2,491 Views)

The second question has been solved..!

 

0 Kudos
Message 6 of 10
(2,488 Views)

Hello, I am going to generate an analog signal with Matlab through channel ao3 and acquire that signal as input ai0 in the same DAQ device simultaneously. And then, the NI 6353 generates synchronized analog output voltage through the remaining ao channels. 

 

So I have to run labview first and then run matlab code for triggering. The error message is indicated as below. 

 

NI Error -89137:
Specified route cannot be satisfied, because it requires resources that are currently in use by another route.
Property: DAQmx_DigEdge_StartTrig_Src
Property: DAQmx_DigEdge_StartTrig_Edge
Source Device: Dev1
Source Terminal: Software

Required Resources in Use by
Task Name: _unnamedTask<164>
Source Device: Dev1
Source Terminal: ai/StartTrigger
Destination Device: Dev1
Destination Terminal: ao/StartTrigger

Task Name: _unnamedTask<295>

Status Code: -89137

 

 

I guess this error is related to the definition of the reference clock. But I cannot find a way to deal with this problem.

Any ideas will help!

 

Thank you

0 Kudos
Message 7 of 10
(2,452 Views)

Hi mkwan,

 

why do you need to start 3 threads for the very same problem? (I merged all of them…)

 


@mkwan wrote:

the NI 6353

As I wrote before:

Depending on the hardware it may not be allowed to access the AO channels from different DAQmx tasks (like your "MATLAB" vs. "LabVIEW" concurrent usage)!

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 10
(2,433 Views)

To GerdW

 

I didn't know that these all would appear to you simultaneously... I just wanted to update new problems as I solved some of them.

I'm sorry if I have disturbed you.

 

So, you mean my device don't serve concurrent operations?

 

Best regards,

mkwan

0 Kudos
Message 9 of 10
(2,426 Views)
Solution
Accepted by topic author mkwan

Hi mkwan,

 


@mkwan wrote:

So, you mean my device don't serve concurrent operations?


Your device doesn't like to share its resources between several DAQmx tasks as it uses MUXes!

 

So you need to rethink your overall design! (Like have LabVIEW do all the DAQmx stuff and MATLAB just sends requests to LabVIEW using network communication!?)

 


@mkwan wrote:

To GerdW


The forum allows to use the "@GerdW" notations instead of "To GerdW"…

 


@mkwan wrote:

I didn't know that these all would appear to you simultaneously... I just wanted to update new problems as I solved some of them. I'm sorry if I have disturbed you.


You are always discussing the same problem, but you spread the discussion over several threads. This is not just disturbing for me, but for all other voluntary contributors too: when you start to write an answer someone else might already have given a solution in another thread.

Please keep related things in one thread…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 10
(2,419 Views)