LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

'myDAQ multiple digital line with DAQmx read and Write

I want to do the communication as done in the VI Digital_test(using express VIs) with DAQmx Read and write. Please help

Download All
0 Kudos
Message 1 of 6
(3,298 Views)

Hi Omershah,

 

usually you can look "under the hood" of ExpressVIs by opening their front panel. Can you do this with those ELVIS ExpressVIs too? (I can't as I don't have that toolkit installed.)

 

In your "please help" VI you surely don't want to open/create DAQmx tasks to just stop/clear them microseconds later!

Did you examine all those example VIs available in the ExampleFinder?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(3,295 Views)

@GerdW

it is not possible for ELVIS Express VIs.

I examined the examples in example finder and others on internet.

0 Kudos
Message 3 of 6
(3,286 Views)

Hi Omershah,

 

then which settings did you choose in your ELVIS ExpressVIs? (Again: I can't check them as I don't have this toolkit installed.)

Use the same settings for DAQmx…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(3,281 Views)

@GerdW

i attached the screen shots of express VIs.

Download All
0 Kudos
Message 5 of 6
(3,270 Views)

Omer,

 

     You got the basic idea of what the myDAQ Express VIs are doing in your Please Help code.  There are several things "wrong" (from the standpoint of what the Digital_Test VI is doing), and a few questions for you to answer.

 

  • The first line says to write Device 3, Port 0, Lines 0 through 7.  I assume Device 3 is your myDAQ, that Port 0 is a DIO port, and you are using all 7 bits for output.  The second line says to use all 7 lines of Port 2 for input.  You obviously have a fancier myDAQ than I, as mine only has a single DIO port (0), so I'd need to use, say, Lines 0 through 3 for output, and 4 through 7 for input.
  • Your Create Channel functions are just fine.
  • When doing Digital Output, it is usually a good idea to write to the Port before turning on the DAQ (otherwise you might get a spike on the line).  So I'd do the DAQmx Write before I did the DAQmx Start.
  • Gerd correctly points out that you open a Task to read or write, start the task, do the read or write, then end and stop the task.  Everything happens very quickly, and once.  If you wanted this to loop, where would you put the loop?
  • Here a question -- which comes first, writing the data to the digital lines, or reading it from the digital lines?  If you want to use the Read to see the "results" of the Write, do you think that "order of operation" matters?
  • Remember the principles of Data Flow.  I'm sure you can figure out how to properly sequence things.  Here's a hint -- use the Cluster wire that is in your code.

Bob Schor

 

 

Message 6 of 6
(3,255 Views)