LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

> Related links

Visit our LabVIEW Wiki Real Time article


Tags
(This content has not been tagged yet)
 
Reply to this topic Start new topic
> Reading both digital and analog signals in the same VI
georgekm
post Jun 6 2008, 03:05 PM
Post #1


Active
*

Member
Posts: 12
Joined: 6-June 08
Member No.: 11699
Using LabVIEW Since:2008
LV:8.5.1 ,. ,.
United States Nothing Selected Nothing Selected


Is there a way to read both digital and analog signals in the same VI? I have an encoder line that is used as a trigger for aquiring data from an analog input. But I also want to be able to plot the encoder signal. Is there some way to do this?

Thx


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ad
post Jun 6 2008, 03:05 PM
Post #















Tags
(This content has not been tagged yet)
Go to the top of the page
Quote Post
jgcode
post Jun 6 2008, 03:51 PM
Post #2


Very Active
***

Premium Member
Posts: 218
Joined: 1-January 08
From: Perth, Australia
Member No.: 10325
Using LabVIEW Since:2006
LV:8.5.1 ,8.6 ,.
Australia Poland Nothing Selected


Definately can be done in DAQmx using the DAQmx APIs.

Can't confirm NI-DAQ.

Which drivers are you using?


--------------------
all day...


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
BrokenArrow
post Jun 6 2008, 04:09 PM
Post #3


Very Active
***

Member
Posts: 223
Joined: 30-July 05
From: Tampa Bay
Member No.: 2655
Using LabVIEW Since:2001
LV:8.5 ,8.2.1 ,7.1
United States Sweden us_florida My Gallery


QUOTE (georgekm @ Jun 6 2008, 11:05 AM) *
Is there a way to read both digital and analog signals in the same VI? I have an encoder line that is used as a trigger for aquiring data from an analog input. But I also want to be able to plot the encoder signal. Is there some way to do this?

Thx


I'm not sure what you mean by "...in the same VI". Do you mean, in one VI? For example (and to jgcode's point), using DAQmx, you can make one Multi-Function VI that does ALL of your Digital & Analog reads and writes. Of course, this one VI will contain several polymorphic sub VI's, but these ship with LabVIEW, your one VI (i.e. same VI) just makes calls to the other VI's. Do you need an example? We also need to know what interface (driver) you are using: DAQmx, NI-DAQ (i.e. Traditional DAQ), or third party.

Richard


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
jdunham
post Jun 6 2008, 08:24 PM
Post #4


Very Active
***

Member
Posts: 200
Joined: 6-March 05
From: Mountain View, CA
Member No.: 1764
Using LabVIEW Since:1994
LV:8.5 ,. ,.
United States us_california Nothing Selected


QUOTE (georgekm @ Jun 6 2008, 08:05 AM) *
Is there a way to read both digital and analog signals in the same VI? I have an encoder line that is used as a trigger for aquiring data from an analog input. But I also want to be able to plot the encoder signal. Is there some way to do this?


(Assuming you are using DAQmx)

Generally a timing/trigger line is not digitized and stored, as far as I know. The easiest thing is to just run the trigger line to an unused analog channel so that it's easy to plot. Of course you will likely see a one-sample delay in the digital plot, because you won't start sampling until after the line goes high (assuming a typical trigger configuration).

You can also wire the encoder line into a counter input and do a buffered counter operation at the same rate as the analog input. You will want to set the counter task to start and clock with the analog input scan clock, and make sure it starts and is armed before your analog operation starts. You should be able to find some DAQmx examples for syncrhonized tasks. You will still have to call separate functions to get the analog data versus the digital data, and you will want to set the DAQmx.Read properties of the slave task so that you know you are reading the same samples as from the master task. See this post for DAQmx Read properties.


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
georgekm
post Jun 11 2008, 05:03 PM
Post #5


Active
*

Member
Posts: 12
Joined: 6-June 08
Member No.: 11699
Using LabVIEW Since:2008
LV:8.5.1 ,. ,.
United States Nothing Selected Nothing Selected


Thx guys,
I figured out the mistake I was making. I had two DAQmx read VIs trying to access the same channel at the same time. I've now wired the error out from one read vi to the next one so that the two activities are performed one after the other.
ge


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic

 




Time is now: 4th December 2008 - 07:40 AM