02-20-2009 04:26 PM
I have a single GPIB board connected to two pieces of equipment. The equipment has different GPIB address (3 and 4) and I am using VISA to address (VISA write vi and VISA read vi) them with the VISA references "GPIB0::3::INSTR" and "GPIB0::4::INSTR". I was experiencing a problem with getting garbage back from one of the pieces of equipment and I used NI-spy to track down that there seems to be interference between messages to the different addresses. This a good example:
28357. viWrite (0x00211168, "TEC:T?", 6, 6)
Process ID: 0x00000E04 Thread ID: 0x00000350
Start Time: 11:22:02.093 Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
28358. viWrite (0x002104D0, "LAS:COND?", 9, 9)
Process ID: 0x00000E04 Thread ID: 0x00000350
Start Time: 11:22:02.093 Call Duration 00:00:00.016
Status: 0 (VI_SUCCESS)
28359. viRead (0x00211168, "36.7778", 255, 7)
Process ID: 0x00000E04 Thread ID: 0x00000350
Start Time: 11:22:02.109 Call Duration 00:00:00.000
Status: 0 (VI_SUCCESS)
28360. viRead (0x002104D0, "64.", 20, 3)
Process ID: 0x00000E04 Thread ID: 0x00000350
Start Time: 11:22:02.109 Call Duration 00:00:00.016
Status: 0 (VI_SUCCESS)
The writes and reads are shuffled together and the read to the first write doesn't return 36.7778 to the VI doing the calling as expected.
I had though that the GPIB took care of separating all the messages by address, but this doesn't appear to be the case. Can anyone shed any light on why this is happening. A simple (though time consuming) fix would be to use semaphores to "lock" the GPIB card until the write-read combination is complete, but I would have thought that this was unnecessary.
Thanks for any help,
Damian
02-23-2009 09:15 AM