LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

Tags
This content has not been tagged yet

> Related links

Visit our LabVIEW Wiki Hardware Portal


 
Reply to this topic Start new topic
> One task per digital line? Sanity check., LV 8.5, DAQmx
george seifert
post Jul 31 2008, 03:15 PM
Post #1


Very Active
***

Member
Posts: 218
Joined: 19-August 05
From: Minneapolis, MN
Member No.: 2786
Using LabVIEW Since:1995
LV:8.20 ,. ,.
United States Nothing Selected Nothing Selected


In my app I need to control 16 digital lines individually. I was wondering if makes sense to setup 16 different digital output tasks where there's one channel for each line. Then to control a line I'd use the appropriate task when using DAQmx Write. Otherwise, if I setup the output as a port, then I'd either have to keep track of the output state for all the lines or read the state of the lines before ORing in the one line I need to control.

I'd appreciate any thoughts on which way makes more sense.

George


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
Ad
post Jul 31 2008, 03:15 PM
Post #















Tags
This content has not been tagged yet
Go to the top of the page
Quote Post
Neville D
post Jul 31 2008, 04:24 PM
Post #2


Extremely Active
****

Member
Posts: 464
Joined: 2-August 05
Member No.: 2680
Using LabVIEW Since:1996
LV:8.5.1 ,8.6 ,.
Canada Nothing Selected Nothing Selected


Might depend on the hardware you are using.. Low cost DAQ's may not allow the lines to be treated individually..

Why not try an example with two lines and tasks and if it works, go from there?


Neville.


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
george seifert
post Jul 31 2008, 05:13 PM
Post #3


Very Active
***

Member
Posts: 218
Joined: 19-August 05
From: Minneapolis, MN
Member No.: 2786
Using LabVIEW Since:1995
LV:8.20 ,. ,.
United States Nothing Selected Nothing Selected


QUOTE (Neville D @ Jul 31 2008, 11:24 AM) *
Might depend on the hardware you are using.. Low cost DAQ's may not allow the lines to be treated individually..

Why not try an example with two lines and tasks and if it works, go from there?


Neville.


I'm using a PXI-6254. I've tried setting individual tasks for each line and it works fine. I'm just wondering that's a good way to go vs the other way I mentioned.

George


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
Neville D
post Jul 31 2008, 05:37 PM
Post #4


Extremely Active
****

Member
Posts: 464
Joined: 2-August 05
Member No.: 2680
Using LabVIEW Since:1996
LV:8.5.1 ,8.6 ,.
Canada Nothing Selected Nothing Selected


QUOTE (george seifert @ Jul 31 2008, 10:13 AM) *
I'm using a PXI-6254. I've tried setting individual tasks for each line and it works fine. I'm just wondering that's a good way to go vs the other way I mentioned.

George


Individual lines are always more flexible. You have more control, and don't have to remember the states of the other lines.

Two caveats:

1 You have some logic that requires you to remember prev line states.. e.g: Line1 can only come ON if Line2 and Line3 are OFF..or something like that.

2 You have to carry around 16 separate task ID's.

Neville.


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
Scott Carlson
post Jul 31 2008, 05:48 PM
Post #5


Active
*

Member
Posts: 23
Joined: 28-July 08
From: CT
Member No.: 12118
Using LabVIEW Since:2005
LV:8.5.1 ,. ,.
United States Nothing Selected Nothing Selected


QUOTE (george seifert @ Jul 31 2008, 11:15 AM) *
In my app I need to control 16 digital lines individually. I was wondering if makes sense to setup 16 different digital output tasks where there's one channel for each line. Then to control a line I'd use the appropriate task when using DAQmx Write. Otherwise, if I setup the output as a port, then I'd either have to keep track of the output state for all the lines or read the state of the lines before ORing in the one line I need to control.

I'd appreciate any thoughts on which way makes more sense.

George



George -- In my head it seems simpler to keep track of a 16bit (U16) integer, holding all of your current states. Then apply OR's (or whatever) to the appropriate bit in the U16 variable.? (a little binary to decimal understanding is required, and I think that covers you) That way you have only 1 task. That would be better than 16 tasks. You would not have to read at all in this case,..

Also, is it even possible to have multiple tasks that are of the same type (on the device)?

-Scott

This post has been edited by ScottC: Jul 31 2008, 05:50 PM


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
Ton
post Jul 31 2008, 06:29 PM
Post #6


CCT It
*****

Premium Member
Posts: 1290
Joined: 13-June 05
From: Woerden, Netherlands
Member No.: 2399
Using LabVIEW Since:2001
LV:8.5.1 ,6.1 ,8.2.1
Netherlands hol_utrecht Nothing Selected My Blog My Gallery


QUOTE (ScottC @ Jul 31 2008, 07:48 PM) *
Also, is it even possible to have multiple tasks that are of the same type (on the device)?

-Scott

Yes, at least for non-timed tasks.

Ton

--------------------
Certified LabVIEW Developer
Shouldn't you be programming a Code Repository solution?


Tags
This content has not been tagged yet
Go to the top of the page
+Quote Post
brianafischer
post Aug 14 2008, 11:19 PM
Post #7


Very Active
***

Member
Posts: 54
Joined: 28-February 06
From: Michigan
Member No.: 4274
Using LabVIEW Since:2005
LV:8.5.1 ,. ,.
United States United States United States


I have run into this decision a few times. My final solution was to create a functional global with the following actions: Init, Write, Write Line, Read Status, and Close. A boolean array or single line was used for the input and a global virtual channel was used to specify multiple individual channels.

One "trick" that a few don't realize is that DAQmx Read can be used on output analog channels, digital ports, and digital lines! Note: This doesn't work on some devices or on simulated devices.


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

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No New Posts   0 daytonaman 1619 2nd March 2004 - 04:00 PM
Last post by: daytonaman
No New Posts   5 Xocet 2454 28th May 2004 - 02:53 PM
Last post by: dhuff
No New Posts   0 Bryan 1352 14th June 2004 - 10:27 PM
Last post by: Bryan
No New Posts   5 nightdweller 1199 13th September 2004 - 04:39 PM
Last post by: nightdweller


Reply to this topicStart new topic

 




Time is now: 8th October 2008 - 04:03 AM