Jump to content
  • 0

How to check whether DBitOut changes bit success?


Liang

Question

Hi team,

I'm using E-DIO24 to check whether loopback between 2 pins is working. I need to check if pinA(assume connect with bit#A) follows right after I change pinB(assume connect with bit#B) by using DBitOut to set HIGH/LOW. Technically, it requires a short process time so the pinA will have right result. Is there a solid way/function we can use to check it?

Thank you!

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hello @Liang.

The E-DIO24 supports three 8 bit ports and each bit can be independently configured for input or output.  Your proposed technique is correct; write a value to 'bit #B' and then read the value of 'bit #A'.  However, you will need a short delay between writing and reading the bit channels, else repeat the digital bit read function.

 

image.png

 

Regards,

Fausto

Link to comment
Share on other sites

  • 0
Posted (edited)

Thank you for your reply. For us, adding a fixed time of delay is not a desire way. I've noticed DBitOut function returns An ErrorInfo object that indicates the status of the operation. Is it possible to use it as a condition to determine it's right moment to check whether 'bit#A' follows the change after DBitOut 'bit#b'? Basically we need a kind of callback function to watch it, and I've noticed a function named EnableEvent under Miscellaneous Methods, is it possible to handle this question? 

Thank you!

Edited by Liang
Link to comment
Share on other sites

  • 0

"The status of the operation" refers to executing the function call in software, not whether or not the state of the bit changed to be physically measured at the screw terminal.

There is no callback function to notify the user when the state of the bit changed. 

If a fixed time delay is not an option, then call the DBitIn() function in a loop immediately after the DBitOut() function. 

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...