LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

making the digital outputs automatic

What I have done in the past with the 6008 is to write to the whole line to turn each output on as I wanted.  In order to do this, you setup the digital I/O as a multiple sample 1D array of U8/16/32, or a single sample U8/16/32.  Once you put a DAQmx write vi on the block diagram, go to Digital > Single or multiple channel (probably single channel since you only have 6 ouptuts) > Single sample > U8 (port format).

What you can then do is write 2^0, 2^1, 2^2, etc (or 1,2,4 if you calculate those out), and that will turen on one of the outputs at a time.

I was working on something similar to this awhile back, and I got some help on this same thing here on the forum.  You can look here and here for some discussion on the topic.
Kenny

0 Kudos
Message 11 of 31
(1,548 Views)
hey kenny
that sounds like excalty like what i want to do
i am still a little lost i will try this and post back how i am out
I will also be looking if there is anymore ideas


Thanks
Mike
0 Kudos
Message 12 of 31
(1,537 Views)
hey kenny is there a way you could send me a picture of the code that was in the other discussion becuase i was not able to open it for some reason
thanks
Mike
0 Kudos
Message 13 of 31
(1,533 Views)
hello
Well trying to understand what is going on
I was looking at the some examples i found the Write Dig Chan.vi example which looks like (see attachment)
now is there anyway that i could change this to make the output come on and off automatically?

thank you again
Mike

0 Kudos
Message 14 of 31
(1,531 Views)
Yes, see the answer here.

 

That happens to be the example I modified. If the exampe works as is, make the modifications I described. If you have problems with that, please review the tutorials already mentioned. What you are attempting to do is very basic.

0 Kudos
Message 15 of 31
(1,521 Views)
hey dennis i am glad that we are on the same page now
the problem was and still is that i am getting this error which is the following
Error- 200463 occurred at DAQmx write (digital 1D Bool 1 Chan 1 Samp)
Possible resons
Specified read or write operation failed, because the number of lines in the channel does not match the number of lines in the channel
.
Then is says that the
Number of Lines in channel:8
Number of Lines in data: 9

Could you help me and guide me in the direction to get rid of this error?

Also I am sorry but i am not a programmer and it take me longer to learn programming
but thank you very much for this
Mike

0 Kudos
Message 16 of 31
(1,515 Views)
hey dennis and everyone
the rest of the block diagram is in the attachment

0 Kudos
Message 17 of 31
(1,511 Views)

Mike,

How many elements of the array do you have defined in the constant?  I am guessing there are 9 elements defined, which is too many for the DAQmx write which only needs 8.  Resize the border of that constant to see how many are defined.  You may have to delete an element out of that constant.

One other thing.  I don't think you would need the for loop which is being iterated 5 times.  It is just writing the same data 5 times.  Notice in Dennis' example in reply 4 that he is using a 2-D array that is being autoindexed at the tunnel of the 4 loop (and no constant wired to the N).  His loop will break the 2-D array into 1-D arrays (probably 8 elements) for as many rows (or is it columns?) as there are in the 2-D array.

Message Edited by Ravens Fan on 06-18-2007 10:09 PM

0 Kudos
Message 18 of 31
(1,507 Views)
hey everyone i am onw needing help to get the boolean data changed to get the right data sent to the outputs
was wondering if anyone has any ideas about this that would be great

thanks again

Mike
0 Kudos
Message 19 of 31
(1,484 Views)

Still haven't taken the LabVIEW turorial yet, huh?Smiley Wink

Look at the picture below. It's just a 2D Boolean array constant expanded to show 8 columns and 7 rows. Use your mouse to left click on any element you want to change from True to False or False to True. You click on the increment/decrement buttons of the array to display different columns or rows. If you see an entire row or column that is faintly colored (such as rows 8 and 9 in the image), that means that row or column is not assigned to the array and would not be sent. You need to click on any element in that row or column to assign it to the array.

Message Edited by Dennis Knutson on 06-19-2007 02:22 PM

0 Kudos
Message 20 of 31
(1,476 Views)