Jump to content
  • 0

USB-1024LS Loopback on 2 bits in same Port


Liang

Question

Hi,

I'm implementing the Winform app to test whether loopback works on all pairs of bits. It works well on pair of bits in two different Ports, when it comes to pair of bits within one Port, no changes happen. What I'm looking for is the answer whether detecting loopback on 2 bits in one Port works on USB-1024LS? if no, do you have any recommendation of device that works for at least 24 DIO. Below is my POC gives a better understanding. Any suggestion would help. Thank you!!!

I've tried two way with loopback PortA0 and PortA1.
First is sending high/low to a single bit being connected to another:

  1. DConfigPort(FirstPortA, DigitalIn) 
  2. Start timer to keep reading by using DBitIn(FirstPortA, BitNum, out BitValue)
  3. when click a button, DConfigPort(FirstPortA, DigitalOut) and DBitOut(FirstPortA, 0,  High)
  4. Expecting PortA0 and PortA1 change to 1 and other 6 bits in PortA changes to 0, but all bits in PortA change to 0
  5. If I remove loopback, only PortA0 changes to 1(wondering why)

Second is sending 0-255 to portA:

  1. DConfigPort(FirstPortA, DigitalIn) 
  2. Start timer to keep reading by using DIn(FirstPortA, out DataValue)
  3. when click a button, DConfigPort(FirstPortA, DigitalOut) and DOut(FirstPortA, 1)
  4. Expecting PortA0 and PortA1 change to 1 and other 6 bits in PortA changes to 0, but all bits in PortA change to 0
  5. If I remove loopback, only PortA0 changes to 1(wondering why)
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

You can only loop from one port to another on the USB-1024LS for a loopback. The DConfigPort function resets the port, preventing you from switching directions to detect a condition. On the other hand, devices that support the DConfigBit function can set one bit as input and the other as output on the same port—for example, the USB-DIO32HS. You could also add a second USB-1024LS. Then, one could be your inputs and the outputs. 

 

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