Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with a digital output during the monitorization of a analog input

Solved!
Go to solution

Hi,

 

I'm using a SCXI-1000DC with a SCXI-1600, a SCXI-1531 and a SCXI-1163 to receive a analog signal from an accelerometer and send a digital signal.
I pretend that the accelerometer is constantly monitored, and the output is activated when I want, by a impulse that I comand in labview.
I'm using a 25k rate and a 12,5K samples per channel on DAQmx Timing.


I notice that in DAQmx read, if I put a hight sample per channel, the output is not there when I want, and if I put few samples per channel, I have the output when I want, but the program seems to be slow with the pass of the time. I don't know how I can resolve this!

 

I'm sorry for my english, and I hope you can help me.

 

Thanks

Silvia

0 Kudos
Message 1 of 9
(4,014 Views)
Solution
Accepted by topic author s35148

Hi Silvia,

 

If you request a higher number of samples, the labview diagram will stay longer in the DAQmx Read function, so the while loop will execute slowly, and the digital output is updated less frequently.

 

I suggest that you use 2 separated while loops: one for the analog input, and the other one for the digital output, so that each loop can execute at a different speed.

 

Best regards,

Thomas B. | CLAD
National Instruments France

0 Kudos
Message 2 of 9
(3,971 Views)

Hi Thomas,

Thanks for your quick reply.
Unfortunately I can only test on Tuesday.


I just have one more question, if I have two separate loops, labView can execute them at the same time?

Best regards,
Sílvia

0 Kudos
Message 3 of 9
(3,951 Views)

Hi Silvia,

 

Yes, LabVIEW can execute the 2 loops at the same time (multi thread), and if you have a multi-core PC, the loops will execute on different cores.

 

Best regards,

Thomas B. | CLAD
National Instruments France

Message 4 of 9
(3,916 Views)

Hi Thomas,

 

I already test the program with two separated while loops, and it run perfectly.
Nevertheless, I notice that I have to use two stops, to stop the program, one for each loop. Is this normal? What can I do to use only one?

 

Thanks for all your help,
best regards,

Silvia

0 Kudos
Message 5 of 9
(3,907 Views)

Hi,

 

You can use a "local variable" to do that.

 

The following document explains how to use them.

 

LabVIEW Introduction Course - Six Hours

 

Best regards,

Thomas B. | CLAD
National Instruments France

0 Kudos
Message 6 of 9
(3,904 Views)

Hi Thomas,

 

Now is working 🙂

I don't know why, besause I had already tried the use of local variables.
Maybe I was doing something wrong.

 

Best regards,
Silvia

0 Kudos
Message 7 of 9
(3,902 Views)

Hi Thomas,

 

Now I have another problem, and I should have realized that this would happen!
I need to sincronize the input and the output, to in the end have a waveform graphic with the two signals.
Can this be done in software? I analised some trigger examples, but I don't understand them at all!

 

Sorry for so many questions, I'm new in labview.

 

Best regards,
Silvia

0 Kudos
Message 8 of 9
(3,870 Views)

Hi Silvia,

 

As it is a new question, I suggest that you open a new forum and someone will probably be able to help you.
In order to synchronise an AI with an AO you need to share the clock and the trigger. This can be done in LabVIEW.

 

Maybe it would be useful that you attend one of our training course in LabVIEW and/or Data Acquisition.

You will find information about that here.

 

Best regards,

Thomas B. | CLAD
National Instruments France

0 Kudos
Message 9 of 9
(3,857 Views)