LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Changes in VISA interrupt handling?

Solved!
Go to solution

Hello all,

I'm grasping at straws here, so I'm looking for a shoulder to cry on.

 

I wrote a USB acquisition prog with CVI a decade ago for a custom board. It worked fine for a few years and then was turned off. We are trying to use it again but it's not working properly.

 

We don't have the original PC, so we are using it with the lastest CVI on Win7 or XP, with latest VISA driver (regenerated .inf file).

 

Communication with USB works fine... except for the interrupt routine. Instead of receiving one interrupt with 3 bytes of data (say 'ABC'), I receive TWO interrupts, the first with 0x1, the 2nd one with 'BC'. There are different types of interrupt frames of different lengths, all have the same split in two, with the 1st as 0x1, the 2nd with valid data.

 

Anybody has any idea why there could be such a change in the way my interrupt routine works ?Has VISA changed its handling of interrupts in this time period ?

Short of a PC-side solution we are ready to reflash the card, hoping that we have the most recent version of the firmware !!!

 

If it can be useful, here's a dump of USB VISA parameters (I'm not familiar with most of them):

VI_ATTR_RSRC_IMPL_VERSION: 0x500400
VI_ATTR_RSRC_SPEC_VERSION: 0x500100
VI_ATTR_RSRC_MANF_ID: 4086
VI_ATTR_RSRC_MANF_NAME: National Instruments
VI_ATTR_INTF_TYPE: 7
VI_ATTR_INTF_NUM: 0
VI_ATTR_INTF_PARENT_NUM error: L'attribut spécifié n'est pas défini ou supporté par la ressource référencée.
VI_ATTR_INTF_INST_NAME: USB0
VI_ATTR_MAX_QUEUE_LENGTH: 50
VI_ATTR_RSRC_LOCK_STATE: 0
VI_ATTR_RSRC_CLASS: RAW
VI_ATTR_DMA_ALLOW_EN error: L'attribut spécifié n'est pas défini ou supporté par la ressource référencée.
VI_ATTR_TMO_VALUE: 2000
VI_ATTR_TRIG_ID error: L'attribut spécifié n'est pas défini ou supporté par la ressource référencée.
VI_ATTR_IO_PROT: 1
VI_ATTR_TERMCHAR: 10
VI_ATTR_TERMCHAR_EN: 0
VI_ATTR_SEND_END_EN error: L'attribut spécifié n'est pas défini ou supporté par la ressource référencée.
VI_ATTR_SUPPRESS_END_EN: 0
VI_ATTR_RD_BUF_OPER_MODE: 3
VI_ATTR_WR_BUF_OPER_MODE: 2
VI_ATTR_RD_BUF_SIZE: 4096
VI_ATTR_WR_BUF_SIZE: 4096
VI_ATTR_USB_SERIAL_NUM: 1240332
VI_ATTR_USB_INTFC_NUM: 0
VI_ATTR_USB_PROTOCOL: 0
VI_ATTR_USB_MAX_INTR_SIZE: 64
VI_ATTR_USB_CLASS: 0
VI_ATTR_USB_SUBCLASS: 0
VI_ATTR_USB_ALT_SETTING: 0
VI_ATTR_USB_NUM_INTFCS: 1
VI_ATTR_USB_NUM_PIPES: 2
VI_ATTR_USB_CTRL_PIPE: 0
VI_ATTR_USB_BULK_OUT_PIPE: 1
VI_ATTR_USB_BULK_IN_PIPE: -1
VI_ATTR_USB_INTR_IN_PIPE: 129
VI_ATTR_USB_BULK_OUT_STATUS: 0
VI_ATTR_USB_BULK_IN_STATUS error: La référence d'objet spécifiée n'est pas initialisée.
VI_ATTR_USB_INTR_IN_STATUS: 1
VI_ATTR_USB_END_IN: 5

 

0 Kudos
Message 1 of 5
(4,758 Views)

Correction: I receive all the interrupts I'm supposed to receive (they don't double), but for each of them the 1st byte of the data is missing. I'm leaning for a corrupted firmware...

0 Kudos
Message 2 of 5
(4,732 Views)

Hi,

 

I have a few questions that may help clarify the problem:

 

1. What Operating System were you originally using?

2. What version of CVI and VISA was originally used when this was working?

3. If you revert back to the old machine/system, do you recieve the same error?

 

It sounds like it could be a firmware issue. Another thought, since this is a custom device, it is possible that it was using a USB RAW Driver, which supports Bulk, Interrupt, and Control communication protocols. I have included some general information about USB instrument Control below, including the required changes for setting the communication protocols for USB RAW.

 

http://www.ni.com/white-paper/4478/en/

 

I would recommend reading through this. Best of luck!

National Instruments
0 Kudos
Message 3 of 5
(4,713 Views)

Thanks, I'll read that today.

We were using XP and we are now testing with XP and Win7. As for the versions of CVI and VISA, it was the current version from 2007 I guess. We can't revert to the original system because it doesn't exist anymore...  And yes, I'm using raw mode.

0 Kudos
Message 4 of 5
(4,691 Views)
Solution
Accepted by topic author gdargaud

Well, after a long hard look at the firmware code, it appears to be simply a version discrepancy between the software and the firmware... What a waste of time.

0 Kudos
Message 5 of 5
(4,590 Views)