Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VeriStand Instrument Addon USB VISA Read issue(no data) with Wait Type>>Wait Second #190

Closed
grigg3 opened this issue Nov 2, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@grigg3
Copy link

grigg3 commented Nov 2, 2021

**Issue - Internal bug 1720960
No data read when using the Instrument Addon Custom Device with a USB VISA device with wait type as Wait Second. Does not matter if casting to data type or formatting to a String for output to VeriStand screen indicator. No data will be read or displayed to a screen indicator.

Versions Noted
Confirmed in VeriStand 2019 R3 and VeriStand 2020 R5 with the 20.4 Instrument Addon Custom Device release from Github.

Replicating Steps

  1. Create new VeriStand default project and save to a desired test location
  2. Open System Definition file using the Configure button
  3. Add a new Instrument Addon by right clicking on Custom Devices, then selecting National Instruments>>Instrument Addon
  4. Select VISA as protocol
  5. Select the applicable VISA resource (tested with Tektronix 2001C USBTMC Oscilloscope)
  6. Now create a message group by right clicking the new device from the tree view and selecting Add Group
  7. Right click the message group and select Add Message
  8. Expand the message group and individual message and configure the message and response
  9. For example, for the Tektronix instrument, a "MEASU:MEAS:VAL?" command was used after verifying in a VISA test panel in NI-MAX
  10. Configure the response by assigning a variable such as [myMeasurement]
  11. Right click on the response and create the data for the response
  12. Connect the data to the variable under the Linkage section of the Response entry item from the tree view
  13. Navigate to the screen (UI manager)
  14. Add an indicator and connect it to the response data
  15. Ensure the Wait Type is Wait Second (This is the problem setting while Byte Count works great)
  16. Deploy the system definition to Windows LocalHost
  17. No data is seen updating in the indicator

Work Around
Current work around is to use Byte Count and give big enough buffer so that the VISA Read.vi function will complete successfully.

Root Cause
The Instrument Addon Custom Device uses an incorrect VISA attribute called Number of Bytes at Serial Port when on the Wait Second wait type. This attribute is not applicable to USB or USBTMC devices.

  1. Using source code, navigate to Instrument Addon Engine.llb>>Protocol Engine.vi See screenshot below of Protocol Engine.viProtocol Engine Code.png
  2. Double click on Read function (icon with glasses) to view the different Class definitions for reading different instrumentsProtocol Engine Class VISA class Read.png
  3. Note the bad VISA attribute VI_ATTR_ASRL_AVAIL_NUM on page 3-4 of programmers manual. This is not valid for USB VISA resources as seen in this IO trace log from replicated case.Bad VISA attribute IO trace.png
@grigg3 grigg3 added the bug Something isn't working label Nov 2, 2021
@PaulDanH
Copy link
Collaborator

PaulDanH commented Nov 2, 2021

Hi @grigg3,

We will have a look at this issue.

Thanks,
Paul

@momo815
Copy link

momo815 commented Nov 12, 2021

How can you open the codes normally?
Can it be deployed in NI Linux RT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants