LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

viRead hp34970A 410 error

Dear fellow LabView users,
 
I am using HP34970A driver for Agilent, on Windows XP and getting error 410 on the (DAQ) unit. When I used the NI-spy I noticed that for any function that reads back data this error comes up.  I am a bit new to Labview and HP34970A, I would appreciate if somebody can help me on this.  Interestingly this code was working fine for some time. I am not sure what has changed (or broken) on the system that is causing the error. I have used both versions of Labview (6.1, and 7) both gave me the same result.
 
 Part of the NI-spy log file is provided below. I am assuming that action 39 (viRead) is retrieving data for the earlier call, action 35 (viWrite).
 
Has anybody exprienced this before?
 
I would greatly appreciate your help on this.  
 
 
Thanks in advance,
Farsh
 

35. viWrite (0x001B4918,"MEAS:VOLT:DC? AUTO, (...",27 (0x1B),27 (0x1B))

Process ID: 0x00000A20 Thread ID: 0x00000D1C

Start Time: 12:52:17.059 Call Duration: 00:00:00.015

Status: 0 (VI_SUCCESS)

36. viSetAttribute (0x001B4918,0x3FFF001A,320000 (0x4E200))

Process ID: 0x00000A20 Thread ID: 0x00000D1C

Start Time: 12:52:17.090 Call Duration: 00:00:00.000

Status: 0 (VI_SUCCESS)

37. viWrite (0x001B4918,"SOUR:VOLT 0.000E+0, (...",28 (0x1C),28 (0x1C))

Process ID: 0x00000A20 Thread ID: 0x00000D1C

Start Time: 12:52:17.090 Call Duration: 00:00:00.000

Status: 0 (VI_SUCCESS)

38. viWrite (0x001B4918,"ROUT:OPEN (@203).",17 (0x11),17 (0x11))

Process ID: 0x00000A20 Thread ID: 0x00000D1C

Start Time: 12:52:17.090 Call Duration: 00:00:00.000

Status: 0 (VI_SUCCESS)

39. viRead (0x001B4918,0x0604FDF8,500 (0x1F4),0x05AEFEE4)

Process ID: 0x00000A20 Thread ID: 0x00000D1C

Start Time: 12:52:17.090

0 Kudos
Message 1 of 11
(4,538 Views)
As the manual explains, error -410 is query interupted. It looks like you are doing a query (the MEAS?) but then you are not doing a read right after that. You are then sending another command. You should do a read right after querying the instrument. Are you not using the driver?
0 Kudos
Message 2 of 11
(4,537 Views)

Dear Dennis,

 

I am using the driver.  There a couple of loops running at the same time making calls to the driver with different commands. Are you implying that I should use some sort of Semaphore or lock around the driver call?

 

Thanks,

Farsh 

0 Kudos
Message 3 of 11
(4,531 Views)
Yes. Trying to do parallel loops with a single instrument is always risky because of this very issue. Look at the shipping example called Locking.VI for how to use the VISA Lock mechanism. Semaphores should work too.
0 Kudos
Message 4 of 11
(4,527 Views)
I truly appreciate this. I will apply the changes and let you know I make out.
 
Thanks a lot,
Farsh
0 Kudos
Message 5 of 11
(4,522 Views)
Hello Dennis,
 
I put Semaphores around my the calls to hp34970A driver calls, but I still get errors. This time the errors are different (101, 112) . Error 101 means Invalid Character, and the error 112 means Program mnemonic tool long. I am not sure why this is happneing since the low leve calls are handled by the hp34970A drivers.
 
Part of the NI-Spy is shown below. 
 
I attached the whole run NI-Spy file to this email. 
 
I would appreciate your help.
 
Thanks,
Farsh
 
 
 
 
 

37. viWrite (0x001B4848,"ROUT:OPEN (@201).",17 (0x11),17 (0x11))

Process ID: 0x000009D4 Thread ID: 0x00000E4C

Start Time: 19:27:11.479 Call Duration: 00:00:00.016

Status: 0 (VI_SUCCESS)

Buffer Contents

00000000: 52 4F 55 54 3A 4F 50 45 4E 20 28 40 32 30 31 29 ROUT:OPEN (@201)

00000010: 0A .

38. viClose (0x001B4848)

Process ID: 0x000009D4 Thread ID: 0x00000E4C

Start Time: 19:27:11.495 Call Duration: 00:00:00.000

Status: 0 (VI_SUCCESS)

39. viParseRsrc (0x001B4808,"ASRL1",4 (0x4),1 (0x1))

Process ID: 0x000009D4 Thread ID: 0x00000E4C

Start Time: 19:27:12.464 Call Duration: 00:00:00.000

Status: 0 (VI_SUCCESS)

40. viOpen (0x001B4808,"ASRL1",4 (0x4),0 (0x0),0x001B4848)

Process ID: 0x000009D4 Thread ID: 0x00000E4C

Start Time: 19:27:12.464 Call Duration: 00:00:00.187

Status: 0 (VI_SUCCESS)

41. viGetAttribute (0x001B4848,0x3FFF0171,4 (0x4))

Process ID: 0x000009D4 Thread ID: 0x00000E4C

Start Time: 19:27:12.651 Call Duration: 00:00:00.000

Status: 0 (VI_SUCCESS)

42. viWrite (0x001B4848,"SOUR:VOLT 2.609E-1, (...",28 (0x1C),28 (0x1C))

Process ID: 0x000009D4 Thread ID: 0x00000E4C

Start Time: 19:27:12.651 Call Duration: 00:00:00.016

Status: 0 (VI_SUCCESS)

Buffer Contents

00000000: 53 4F 55 52 3A 56 4F 4C 54 20 32 2E 36 30 39 45 SOUR:VOLT 2.609E

00000010: 2D 31 2C 20 28 40 20 33 30 34 29 0A -1, (@ 304).

43. viWrite (0x001B4848,"SOUR:VOLT 3.478E-1, (...",28 (0x1C),28 (0x1C))

Process ID: 0x000009D4 Thread ID: 0x00000E4C

Start Time: 19:27:13.464 Call Duration: 00:00:00.015

Status: 0 (VI_SUCCESS)

Buffer Contents

00000000: 53 4F 55 52 3A 56 4F 4C 54 20 33 2E 34 37 38 45 SOUR:VOLT 3.478E

00000010: 2D 31 2C 20 28 40 20 33 30 34 29 0A -1, (@ 304).

44. viWrite (0x001B4848,"SOUR:VOLT 4.348E-1, (...",28 (0x1C),28 (0x1C))

Process ID: 0x000009D4 Thread ID: 0x00000E4C

Start Time: 19:27:14.464 Call Duration: 00:00:00.015

Status: 0 (VI_SUCCESS)

Buffer Contents

00000000: 53 4F 55 52 3A 56 4F 4C 54 20 34 2E 33 34 38 45 SOUR:VOLT 4.348E

00000010: 2D 31 2C 20 28 40 20 33 30 34 29 0A -1, (@ 304).

Page 5

45. viWrite (0x001B4848,"ROUT:OPEN (@203).",17 (0x11),17 (0x11))

Process ID: 0x000009D4 Thread ID: 0x00000E4C

Start Time: 19:27:16.464 Call Duration: 00:00:00.016

Status: 0 (VI_SUCCESS)

Buffer Contents

00000000: 52 4F 55 54 3A 4F 50 45 4E 20 28 40 32 30 33 29 ROUT:OPEN (@203)

00000010: 0A .

46. viWrite (0x001B4848,"MEAS:VOLT:DC? AUTO, (...",27 (0x1B),27 (0x1B))

Process ID: 0x000009D4 Thread ID: 0x00000E4C

Start Time: 19:27:16.480 Call Duration: 00:00:00.015

Status: 0 (VI_SUCCESS)

Buffer Contents

00000000: 4D 45 41 53 3A 56 4F 4C 54 3A 44 43 3F 20 41 55 MEAS:VOLT:DC? AU

00000010: 54 4F 2C 20 28 40 31 30 32 29 0A TO, (@102).

47. viSetAttribute (0x001B4848,0x3FFF001A,320000 (0x4E200))

Process ID: 0x000009D4 Thread ID: 0x00000E4C

Start Time: 19:27:16.495 Call Duration: 00:00:00.000

Status: 0 (VI_SUCCESS)

48. viRead (0x001B4848,0x0612EBC0,500 (0x1F4),0x059EFEE4)

Process ID: 0x000009D4 Thread ID: 0x00000E4C

Start Time: 19:27:16.495

0 Kudos
Message 6 of 11
(4,507 Views)
Nothing is jumping out at me right now but the VISA Open in the middle is a little suspicious. I'll have to run an NI-Spy on one of my 34790's tomorrow and do a comparison. All I use is GPIB though.
0 Kudos
Message 7 of 11
(4,484 Views)
Thanks Dennis.
 
Some background on my code, I create the VISA session in the top VI, and pass that to the sub VIs. Could it be that one of the sub VIs is initialized (has defaulted) to some new value?  Would that cause a new VISA Open?  I need to check that, if that's the case.
 
I look forward to your comments.
 
Thanks for your help,
Farsh
0 Kudos
Message 8 of 11
(4,454 Views)
Passing a VISA resource to a subVI should not cause the reference to be lost and require a new VISA Open. It's going to be a while until I can get to a 34970. Could you post an example of your code? Maybe there will be something that can be seen there.
0 Kudos
Message 9 of 11
(4,445 Views)
Dear Dennis,
 
Thanks for all your help. I managed to find out what my problem was. All of them were due to timing, and having different threads running. I also had one initialization problem.  Interestingly, this code was running fine on Windows 98, when we moved it to Windows XP that's when we hit all those probelms.  Is this common? or I am the only one experiencing this.
 
Once again, thanks for your help.
 
Take care,
Farsh 
0 Kudos
Message 10 of 11
(4,391 Views)