Jump to content
  • 0

Reading a Digital Output State


bramesh2

Question

9 answers to this question

Recommended Posts

  • 0
10 minutes ago, Fausto said:

Hello @bramesh2.

Which MCC device are you using?

Are you referring to a visual element on the panel?

Have you tried the digital I/O examples in the ULx folder ('C:\Program Files\National Instruments\LabVIEW {version}\examples\ULx\Digital')?

image.png

 

Regards,

Fausto

Hi @Fausto

I'm using the USB-1024LS. I have a UI element which when flipped to ON will write a true to a digital output port, when flipped back to off it writes false to that same port. The problem is that when the UI is initialized, I need to know what the digital output port is currently set to. If it is already true, I need to initialize this control to the ON state. 

 image.png.83ec22fd1dd4e5b03c8a5b12bb5a5226.png

Link to comment
Share on other sites

  • 0

@bramesh2,

With the USB-1024LS, the digital lines default to input mode at Power up / reset state.  Additionally, all digital pins are pulled up 'HI' via internal 47 KOhm resistors.  In other words, when there is nothing on the inputs, the inputs themselves will float and read 5 volts. 

Reference Table 1 in the user's guide.  https://www.mccdaq.com/pdfs/manuals/USB-1024LS.pdf

 

Link to comment
Share on other sites

  • 0
9 hours ago, Fausto said:

@bramesh2,

With the USB-1024LS, the digital lines default to input mode at Power up / reset state.  Additionally, all digital pins are pulled up 'HI' via internal 47 KOhm resistors.  In other words, when there is nothing on the inputs, the inputs themselves will float and read 5 volts. 

Reference Table 1 in the user's guide.  https://www.mccdaq.com/pdfs/manuals/USB-1024LS.pdf

 

For this application, I'm not resetting the device. I'm launching a UI, setting digital outputs, closing and relaunching the UI all while the I/O module is constantly running. I could save previous output commands in a variable, but it would be more convenient if I could read the digital output settings back from the device.

Link to comment
Share on other sites

  • 0

Hello @Gan Dalf.

There is no software query as previously mentioned.  

On 7/28/2023 at 10:34 AM, Fausto said:

There is no command to read the physical state of a digital output bit.  You would need to physically loop a wire to a digital input line and then read the digital input line.

 

If there is a point in your code to set the digital outputs to a low state, then use that as a reference point.

Regards,

Fausto

Link to comment
Share on other sites

  • 0

dear @Fausto, I understand that at the moment there no existing software query to obtain the current state of the digital output lines.

So let me rephrase the question as it is at least of interest for @bramesh2 and myself:

Is there a possibility for a code to be written and made available to query the state of the digital outputs lines?

 

Regards,

Gan Dalf

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...