LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with using DAQ Card in Traditional DAQ VI

Hi all,
My problem is that
 
e.g. Channel 0 is  on , If send turn on 1 , Channel  0 will Off incorrectly, but channel 1 turn on correctly.
I can't keep the previous setting by another programme. (i.e. Channel 0, 1 On as Isend the message)
 
[Channel 0 and Channel 1 are send by different programme
 
Thank you.
0 Kudos
Message 1 of 4
(2,829 Views)
Hello HeartShield,

I would like to first re-state your question, please correct me if this is not your question:
   1. If Channel 0 (which contains Lines 0 to 7) is set ON by program#1 then Channel 1 (which also contains Lines 0 to 7) is set ON by program#2
       then Channel 0 is set to OFF.



Here is what could be happening:
   If you are writing less than a byte (8 Lines) to, say, Channel 0, then it will write out a entire byte anyways.
   So if Channel 0 and Channel 1 overlap in Lines, and you write to part of Channel 0 then it will write out to the entire Channel 0
  and possibly change the state of Channel 1.

Additionally, in MAX when you create the virtual channels for Labview. You can set the inversion state of digital lines, possibly Channel 1 has inverted logic from Channel 0.

Try the examples that ship with Labview for Traditional NI-DAQ, Write to 1 Dig Port.VI.
 Save 2 copies of this program, program1 and program2.
 Run these 2 copies and you should be able to write to the digital port from either program without a problem and demonstrate what I've said above.
This example program can be found: Run Labview->Help menu->Find Examples->Browse According to Directory Structure->daq->digital->

What NI hardware, version of Labview and version of Traditional NI-DAQ drivers are you using?

Thank you, have a great afternoon!

Best regards,

MatthewW
Applications Engineer
National Instruments




0 Kudos
Message 2 of 4
(2,806 Views)
Thank you, MatthewW.

I am using labview7.1 and my daq is pci-6503

My Programme is that I want to send 2 swich-on pulse throgh the daq in same port,
but by different program.

Can I read the another program port setting, i.e. if other channel using the port 0 address 1, then other program can't overwrite it??

Thank you
0 Kudos
Message 3 of 4
(2,786 Views)

 Hi HeartShield,

 It sounds like you want to write to a digital port using two different programs. This is legal as long as the first task has released the resources.

 Try this by setting a breakpoint in the Digital Generation shipping examples, you can stop the program after it has released the resources but before it ends. Then you can write to the digital port with the second program .

 Have a great evening!

 MatthewW
 Applications Engineer
 National Instruments

Message Edited by Matthew W on 07-26-2007 10:58 PM

0 Kudos
Message 4 of 4
(2,772 Views)