03-05-2015 02:14 PM
I used Langint.dll with VB.net 2003 several years ago to design a automatic parametric tester. The old XP 32bit PC died and they upgraded to Windows 7 64 bit. The old program would not run on the new PC. I had to upgrade all the drivers and found out VB.net 2003 doesn't like 64 bit. I upgraded to program to VB.net 2013 and re-wrote the GPIB commands for NI488.dll because Langint was not supported. The old program didn't require any programming delays and everything ran quickly, giving me the correct timing I needed for testing. The new programming required delays (200ms) or I would get communication errors. The new program runs to slow and gives me bad data. How can I speed-up the GPIB operations. I'm talking with 5 pieces of monitoring equipment. Some require several commands for setup. Everything I've read, blames the monitoring equipment for slowing things down. I built two of the units and the other still runs fine. I compared the same setup in both units (one with old PC and one with new PC). The old PC runs the cycle 2.4 times faster. What can I do to speed things up?
Thanks
03-06-2015 01:35 PM
Bob,
It would be difficult to tell exactly what the problem is without looking at your code. What sections of code did you change when you switched .dll's? What function calls did you have in your old program that you had to adapt to the new dll? Are you using NI488 or 488.1, 488.2, etc?
03-10-2015 08:27 AM
I had to change every thing. Every line of GPIB code was a complete redo. I did add more subroutines in the new code to make it easier to re-program.
I'm using NI 488.2 now.
New Code, is per the NI Examples: (had to add the delay timers to keep from getting communication errors)
The old and new code should be attached.
Thanks
03-10-2015 02:21 PM
Bob,
1.When you take out the delays, what kind of error are you getting? Could you list the exact error message you receive? Where in your code is the error produced?
2. Which NI Examples were you referencing when you created your code?
3. Can you break your code up into segments and see exactly which section is creating the error? It'll be easier to diagnose if we know which part of the GPIB communication process is having trouble.
03-12-2015 10:52 AM
1:"Asynchronous I/O operation in progress" Error. If the delays are removed, between any GPIB command and the next GPIB command (read, write, open, and close).
2. NI 488.2 (on NI CD) SimpleAsynchronousReadWrite.2008. I had trouble getting these to run due to the example referencing the wrong DLL version. After a few hours on the forum I found everyone was having the same problem. One person got it to run by updating it to 2013VB.net. I tried that and got it to work. The example requires manual clicks to read, write, open, and close, so the odds of someone selecting the next step under 200ms is unlikely (AKA it runs without errors). In an automated program these commands happen quicker.
3. The code is already broken down into read, write, open and close subroutines. I can step through the program and it doesn't give me "Asynchronous I/O operation in progress" errors due to the slow process of stepping. All the GPIB commands work fine as long as they have 200ms between each command, my application can't wait that long. All of the GPIB commands have this problem. I started by adding one delay timer to one section / GIPB command sudroutine at a time and testing the program. Only after all GPIB command subroutines had the delay did it run without errors.
Thanks
03-12-2015 04:07 PM
@BobSwift wrote:
3. The code is already broken down into read, write, open and close subroutines.
Are you doing a open and close with each command?
03-13-2015 06:45 AM
No, I call the open subroutine to open the device. Then I call the write subroutine to send the commands, sometimes it gets called multiple times. If I need to read then the read subroutine is called. Only when all the writes and reads are completed do I close the device. Note: Do to talking with multiple devices there are several open and closes. It's my understanding that only one device can be open at a time. Some of the equipment takes several writes to setup. I've tried to use a semi-colon ; to put as many commands into one write as possible. This seems to only work with "like" commands and some system commands. Does everyone else need some type of delay when doing GPIB commands in a automated program? My old program didn't need delays. I talked to another local programmer about this and he also had to add delays. The delays are killing my timing.
Thanks
03-13-2015 07:57 AM
@BobSwift wrote:
No, I call the open subroutine to open the device. Then I call the write subroutine to send the commands, sometimes it gets called multiple times. If I need to read then the read subroutine is called. Only when all the writes and reads are completed do I close the device. Note: Do to talking with multiple devices there are several open and closes. It's my understanding that only one device can be open at a time. Some of the equipment takes several writes to setup. I've tried to use a semi-colon ; to put as many commands into one write as possible. This seems to only work with "like" commands and some system commands. Does everyone else need some type of delay when doing GPIB commands in a automated program? My old program didn't need delays. I talked to another local programmer about this and he also had to add delays. The delays are killing my timing.
Thanks
Only one device can be open at one time?
Where are you getting this idea?
At the start of your program, one would "open" communication to all the instruments
While the program is running one would write and read from whichever instrument is required.
At the end of your program, one would "close" communication to all the instruments.
03-13-2015 08:50 AM
If all the devices are open at the same time how do you control which device you are sending the commands to? Do you just resend the open command to switch between devices?
03-13-2015
10:14 AM
- last edited on
08-09-2024
02:28 PM
by
Content Cleaner
Did some reading and found this.
https://www.ni.com/en/support/documentation/supplemental/06/gpib-messages.html
This link covers Board Level vs Device Level
There are two types of GPIB functions: board-level functions and device-level functions. At the device level, you are limited to communicating with one device at a time, while at the board level, you can communicate with multiple devices (but only one device can talk at a time!). With respect to GPIB messages, board-level functions require you to perform Talker/Listener assignments manually with the ibcmd function; device-level functions take care of the Talker/Listener assignments for you.
Also saw that 488.2 can mix the two.
I know openning and closeing take time and removing the extra open / close commands could help speed things up. I still need to write and read from a device quicker as well. Can you post some VB.net code using 488.2. All the code I've found is Device-Level.
Thanks