Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
3 ratings:
 3 out of 5     Rate this Document

Why Do the Voltages of My Digital Lines Decrease When Using Multiple Write to Digital Line VIs?

Hardware: Legacy DAQ Devices>>Multifunction DAQ>>PCI-1200

Problem: When I use a single Write to Digital Line VI within a while loop in LabVIEW and change the state of my digital line to a high state, I see a voltage of five volts on that digital line. When I add additional Write to Digital Line VIs within my while loop, the "high" voltage state of the digital lines drops dramatically. It seems that the more Write to Digital Line VIs I add within my while loop, the more the output voltages of my digital lines change.

Solution: There are two reasons your board may exhibit this behavior:
  1. As a result of configuring the ports on boards that use the 8255 or 82C55 digital chip. The Write to Digital Line.vi configures the digital port every time this VI is called. When a port is configured on a board with the 8255 or 82C55 chip, all the lines on that port are reset to a digital "low" state of zero volts. The explanation as to why the voltage levels drop when using multiple Write to Digital Line VIs is this:

    When multiple Write to Digital Line VIs are used within a loop, the voltage being generated on a digital line is changing between five volts and zero volts. This is because within your loop, one Write to Digital Line VI is writing five volts to the specified digital line, and the other Write to Digital Line VIs are reconfiguring the digital port and writing zero volts to the digital line. The result is somewhat of an AC signal being generated on the digital line, and the RMS voltage of that digital line will be lower than the normal "high" state of five volts. When more than one Write to Digital Line VIs are used within the while loop, the lines on the port are being reset more often and a lower RMS voltage results.

    The solution to this problem is to configure the digital port only once within a program. After configuring the port, you can continuously write to a digital line on a board with the 8255 or 82C55 chip without seeing this decrease in the voltage.

  2. As a result of using multiple non-reentrant VIs. Write to Digital Line VI use an uninitialized shift register to store the task ID. If you display the block diagram of these VIs, you see that the DIO Port Config VI always executes the first time these VIs are executed. If you wire the iteration input of the Write to Digital Line VI, each successive call uses the stored task ID and does not execute the DIO Port Config VI again. This greatly speeds up execution of multiple calls to these VIs. Yet, when using multiple instances of these digital VIs with the iteration input wired, each execution refers to the same task ID stored by the shift register.

    To avoid this problem, make the Write to Digital Line VI reentrant. Use the following instructions to make the VI reentrant:
    1. Open the Write to Digital Line VI and select File»VI Properties.

    2. From the Category pull-down menu, select Execution.

    3. Place a check mark in the Reentrant execution check box and click OK.

    4. Save the VI.



    If you have additional questions on effectively programming with boards that have the 8533 or 82C55 chip, see the link below.

    Related Links: KnowledgeBase 0489FD8Q. Why Do All My Digital I/O Ports Reset When I Configure One Port?
    KnowledgeBase 2YRFT1HM. Incorrect Behavior When Using Multiple Instances of the Write to Digital Line VI

    Attachments:





    Report Date: 08/02/2002
    Last Updated: 11/26/2003
    Document ID: 2O19OS0T

    Your Feedback! poor Poor  |  Excellent excellent   Yes No
     Document Quality? 
     Answered Your Question? 
      1 2 3 4 5
    Please Contact NI for all product and support inquiries.submit