From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Write to Digital Line" vi's send all signals to same line?

I hope someone can help with this... It seems like a simple case of
using two "Write to Digital Line" vi's in a simple larger vi with two
on/off switches, but it's not working as I expected:

I have a 96 line digital I/O card, and I've used DAQ Channel Wizard
to assign names to the various ports and lines. For example:
"Pump" = Digital output to Port APA Line 1
"LineVent" = Digital output to Port APB Line 5

I created a simple vi with a LabView switch going to the line input of
a "Write to Digital Line" "Easy vi", with the digital channel
output going to "Pump". When I run the vi and click
on the switch I do indeed see APA line 1 go high and low.
So with a single W.toD.L. vi things wo
rk as expected.

I added another switch and another W.toD.L. vi, with the
digital channel of this one going to "LineVent". When
I run the vi now I see something unexpected: APA line 1
is toggling between the value of the "Pump" switch
and the value of the "LineVent" switch, so if one switch
is ON and one OFF I see a square wave on APA line 1
as it toggles between ON and OFF. APB line 5 is
flat. It seems both signals are going to the same line.

Further, if I delay the port configuration (via the iteration input
to W.toD.L.) to "LineVent" so that it occurs AFTER the "Pump" port is
configured, then the shared line is APB line 5 and APA line 1 is
now flat. In other words, it seems the last line to get configured
is the one which shares BOTH the signals.

I thought perhaps it was incorrect to use the same W.toD.L. vi
for both lines, so I renamed the W.toD.L. vi used for "LineVent" to
"Write to Digital Line - LV" so it would have a different name
from the "Pump" one, but that didn't mak
e any difference.

Does anyone have any advice or clues?

-Doug Rogers, Space Sciences Lab, UC Berkeley
0 Kudos
Message 1 of 2
(2,583 Views)
Doug,
It sounds like your vi is continually going through a reset operation. I
had
a similar problem with and at-mio16de10 card which used an 8255 chip for
the extra digital I/O. If your card uses an 8255 to control the large
number of
digital lines, you are probably suffering the same problem.
When you call an easy vi, it goes through an initialisation stage, that
resets all
digital lines! curse it. What you are seeing is you card setting one
digital line
with one instance of the write to digital line vi and subsequently resetting
ALL digital
lines with the next occurance of another write to digital line vi.

Anyway, you overcome the problem by saving a re-entrant copy of the vi
(write to digital line easy vi)
that you are using in your project directory. You make the vi re-entrant,
by opening the vi
and right clicking in the upper right corner of the display on the icon
(easy vi icon in this case)
and choosing vi setup. Check the re-entrant box then click ok and save the
changes.

Now you can use multiple instances of the write to digital line vi (because
it re-entrant).
The last thing to do is to wire the counter i of the while loop, (or for
loop) that you are using
to the iteration terminals of all the write to digital line (re-entrant) vis
terminals that you are using.
On the first pass of the loop, the write to digital line vi, will initialise
(occurs when input is 0)
on subsequent passes through the loop, the initialisation process is not
performed (count is not 0).
Hence you vi wont be reset.
The re-entrant bit allows you to place multiple write to digital line vi's
on the diagram, so that
you can write to more than one digital line at a time.

Hope this makes some sense - also hope it helps
Cheers
John


Doug Rogers wrote in message
news:38b184f5@newsgroups.ni.com...
> I hope someone can help with this... It seems like a simple case of
> using two "Write to Digital Line" vi's in a simple larger vi with two
> on/off switches, but it's not working as I expected:
>
> I have a 96 line digital I/O card, and I've used DAQ Channel Wizard
> to assign names to the various ports and lines. For example:
> "Pump" = Digital output to Port APA Line 1
> "LineVent" = Digital output to Port APB Line 5
>
> I created a simple vi with a LabView switch going to the line input of
> a "Write to Digital Line" "Easy vi", with the digital channel
> output going to "Pump". When I run the vi and click
> on the switch I do indeed see APA line 1 go high and low.
> So with a single W.toD.L. vi things work as expected.
>
> I added another switch and another W.toD.L. vi, with the
> digital channel of this one going to "LineVent". When
> I run the vi now I see something unexpected: APA line 1
> is toggling between the value of the "Pump" switch
> and the value of the "LineVent" switch, so if one switch
> is ON and one OFF I see a square wave on APA line 1
> as it toggles between ON and OFF. APB line 5 is
> flat. It seems both signals are going to the same line.
>
> Further, if I delay the port configuration (via the iteration input
> to W.toD.L.) to "LineVent" so that it occurs AFTER the "Pump" port is
> configured, then the shared line is APB line 5 and APA line 1 is
> now flat. In other words, it seems the last line to get configured
> is the one which shares BOTH the signals.
>
> I thought perhaps it was incorrect to use the same W.toD.L. vi
> for both lines, so I renamed the W.toD.L. vi used for "LineVent" to
> "Write to Digital Line - LV" so it would have a different name
> from the "Pump" one, but that didn't make any difference.
>
> Does anyone have any advice or clues?
>
> -Doug Rogers, Space Sciences Lab, UC Berkeley
>
>
0 Kudos
Message 2 of 2
(2,583 Views)