04-12-2015 11:58 AM
How can we creating 1/0 signal to the digital output pin 0~7 on myDAQ with using LabView?
As I want three of the pins outputing signal when I select option 1, another three pins outputing when I select option 2.
Which mean when I select different options, different pin(s) will provide signal.
04-12-2015 12:12 PM
04-12-2015 12:18 PM
Yes I did, but a DAQ assist can not complete this task. I have looked at using a DAQ write and a DAQ read, but it is not working.
04-12-2015
01:20 PM
- last edited on
08-12-2024
05:56 PM
by
Content Cleaner
Two basic "rules" that will stand you in good stead.
04-12-2015 01:33 PM
04-12-2015 01:45 PM
Thanks for telling these, it really helps. So now I have run through the MAX and created one task which is to generate digital signal on pin 0,1,2.
Then what I should do is placing the task on labview and connect up with control to make it selecting which pin(s) are on. Am I right?
Should I create 3 different task with controlling each pin instead of one task controlling 3pins?
04-12-2015 02:39 PM
04-12-2015 03:01 PM
The answer is -- whichever seems more sensible to you. I don't know how the DIO is specified -- on one of my devices, it is grouped in 8-bit "ports", with the possibility of combining some ports into a 16-bit or 32-bit Port, as well. I usually stick with 8-bit ports, all input or all output, and create a Task to address a Port. Then when I start my DAQmx Task (using this saved Task Variable), I do a Bit or Byte-wide I/O as appropriate for what I need to do.
Bob Schor
P.S. -- doing port-wide Reads almost always makes sense, since if you only need to know about, say, bit 0, you can mask off the other bits (or convert a U8 to an array of Booleans and use Array Index 0). On the other hand, if you want to output digital data, and are writing to an 8-bit Port, then you need to write all 8 bits. This is also not a problem, but takes a little more work. You need to keep a variable (I use either a Global Variable or a Functional Global Variable, also called an FGV or VIG, for VI (Version 2) Global) that has the current value of the 8-bit DO port. To set bit 0, set bit 0 in the Variable, then write the Variable to the Port. To clear bit 1, clear bit 1 in the Variable, then write the Variable to the Port. Note that if the bits do not change, then you don't need to write to the Port, as it will "hold" the current bits.
04-22-2015 05:37 AM - edited 04-22-2015 05:37 AM
I have now sucessfully made the combo box selecting which digital pins are on. Which as the 1.vi I attached. Now I am going to connect each digital pin to 2 8-bits multiplexer, then different sensors are connect to these two mux. Therefore the combo box can controlling the multiplexer to drive different sensors.
So now those different sensors have there own vi, should I make them as a DAQmx write and put all the things on one vi? Also, on the 1.vi I attached, in the DAQmx write just got one task out pin, it means only one task can perform? Or it can make it to different tasks?